Skip to documentation content

Typography

Apply Honest UI's font-family, weight, body, title, and technical-text tokens with readable pairings.

Honest UI separates typography into family roles and coordinated scales. Each size has a matching line height and letter spacing value, so text remains consistent across component labels, body copy, headings, and technical content.

The default family resolves through --font-geist-sans and falls back to Arial, then the system sans-serif. You can load Geist in your application or point --font-geist-sans at a typeface you already own.

Font families

Honest UI font-family tokens
PreviewTokenValue
--hui-font-sansShared family stack and customization pointvar(--font-geist-sans), Arial, sans-serif
--hui-font-titleHeadings and display titlesvar(--hui-font-sans)
--hui-font-bodyBody copy, controls, labels, and supporting textvar(--hui-font-sans)
--hui-font-monoTechnical-text role; override it when true monospaced alignment is requiredvar(--hui-font-sans)

Titles and body copy use the same family. Controls use a 14px label size (--hui-font-size-control), with 13px for small controls and 12px for extra-small ones.

To provide an application font without changing component code:

:root {
  --font-geist-sans: "Your Product Sans";
  --hui-font-mono: "Your Product Mono", ui-monospace, monospace;
}

If character alignment matters—for code, tabular output, or logs—do not assume the default --hui-font-mono value is monospaced. Override the role with a real monospace family and test the content you display.

Font weights

Honest UI font-weight tokens
PreviewTokenValue
--hui-font-weight-regularBody copy, descriptions, and most control text400
--hui-font-weight-mediumLabels, headings, and moderate emphasis500
--hui-font-weight-semiboldStrong labels and compact structural emphasis600

Load every weight you use. Honest UI disables synthetic bold and italic through font-synthesis: none, so a missing face will not be fabricated by the browser.

Body scale

Use the three tokens for a named step together. The base aliases point to the regular body step and are useful where a component needs the default without repeating its specific size name.

Honest UI body font-size tokens
PreviewTokenValue
--hui-font-size-microDense metadata and short supporting labels10px
--hui-font-size-miniCaptions, badges, and compact field help11px
--hui-font-size-smallSecondary text, labels, and compact controls12px
--hui-font-size-controlText inside controls: button labels, field values, and tabs14px
--hui-font-size-regularDefault component and body text14px
--hui-font-size-largeProminent body copy and large controls16px
--hui-font-size-baseAlias for the default body sizevar(--hui-font-size-regular)
Honest UI body line-height tokens
PreviewTokenValue
--hui-line-height-microLine height paired with micro text12px
--hui-line-height-miniLine height paired with mini text14px
--hui-line-height-smallLine height paired with small text16px
--hui-line-height-controlLine height paired with control text16px
--hui-line-height-regularLine height paired with regular text20px
--hui-line-height-largeLine height paired with large text24px
--hui-line-height-baseAlias for the default body line heightvar(--hui-line-height-regular)
Honest UI body letter-spacing tokens
PreviewTokenValue
--hui-letter-spacing-microTracking paired with micro text0.01em
--hui-letter-spacing-miniTracking paired with mini text0.005em
--hui-letter-spacing-smallTracking paired with small text0em
--hui-letter-spacing-controlTracking paired with control text0
--hui-letter-spacing-regularTracking paired with regular text-0.006em
--hui-letter-spacing-largeTracking paired with large text-0.011em
--hui-letter-spacing-baseAlias for the default body trackingvar(--hui-letter-spacing-regular)

Title scale

The four title steps map to the global h4 through h1 styles included by Honest UI. Those selectors use the title family, medium weight, the matching line height, and balanced wrapping.

Honest UI title typography tokens
PreviewTokenValue
--hui-font-size-t1Small heading size; used by h420px
--hui-line-height-t1Line height paired with t128px
--hui-letter-spacing-t1Tracking paired with t1-0.01em
--hui-font-size-t2Section heading size; used by h324px
--hui-line-height-t2Line height paired with t232px
--hui-letter-spacing-t2Tracking paired with t2-0.013em
--hui-font-size-t3Page-section heading size; used by h228px
--hui-line-height-t3Line height paired with t336px
--hui-letter-spacing-t3Tracking paired with t3-0.016em
--hui-font-size-t4Page-title size; used by h132px
--hui-line-height-t4Line height paired with t440px
--hui-letter-spacing-t4Tracking paired with t4-0.02em

Technical-text scale

The technical scale supplies size, line-height, and tracking pairs. Apply --hui-font-mono separately because these tokens do not set the family.

Honest UI technical-text typography tokens
PreviewTokenValue
--hui-font-size-mono-miniSmall technical labels and timestamps11px
--hui-line-height-mono-miniLine height paired with mono mini16px
--hui-letter-spacing-mono-miniTracking paired with mono mini0px
--hui-font-size-mono-smallInline code and compact output12px
--hui-line-height-mono-smallLine height paired with mono small16px
--hui-letter-spacing-mono-smallTracking paired with mono small0px
--hui-font-size-mono-regularDefault code blocks and technical output14px
--hui-line-height-mono-regularLine height paired with mono regular20px
--hui-letter-spacing-mono-regularTracking paired with mono regular0px
--hui-font-size-mono-largeProminent technical output16px
--hui-line-height-mono-largeLine height paired with mono large24px
--hui-letter-spacing-mono-largeTracking paired with mono large0px

Tailwind usage

Use arbitrary properties for the complete type recipe. This avoids ambiguity between Tailwind's text-color and font-size utilities:

<section>
  <p
    className="
      [font-family:var(--hui-font-body)]
      [font-size:var(--hui-font-size-small)]
      [font-weight:var(--hui-font-weight-medium)]
      [letter-spacing:var(--hui-letter-spacing-small)]
      [line-height:var(--hui-line-height-small)]
    "
  >
    Monthly revenue
  </p>
  <p
    className="
      [font-family:var(--hui-font-title)]
      [font-size:var(--hui-font-size-t3)]
      [font-weight:var(--hui-font-weight-medium)]
      [letter-spacing:var(--hui-letter-spacing-t3)]
      [line-height:var(--hui-line-height-t3)]
    "
  >
    $42,180
  </p>
</section>

For Tailwind v4 shorthand, use a type hint when needed: text-(length:--hui-font-size-regular) sets font size, while text-(color:--hui-color-foreground-base-primary) sets color.

Readability checks

  • Keep body copy at a readable size for its context; micro and mini steps are for short supporting text, not long instructions.
  • Pair each size with its named line height and letter spacing instead of mixing steps casually.
  • Do not encode heading structure with size alone. Use semantic heading levels in a logical order, then style them.
  • Let text wrap. Avoid fixed heights on labels, buttons, and fields that break when text is enlarged or translated.
  • Test at 200% and 400% zoom, with browser text-spacing overrides, and with long unbroken content.
  • Use real text rather than text baked into an image, and maintain at least the contrast required by the product's accessibility target.