Typography

Utilities for controlling font family, size, weight, alignment, line height, letter spacing, decoration, transforms, whitespace, and text rendering.

Font Family

ClassCSS Property
font-sansfont-family: var(--font-sans)
font-seriffont-family: var(--font-serif)
font-monofont-family: var(--font-mono)

Font Size

Each font size class also sets an appropriate line-height.

ClassCSS Property
text-xsfont-size: var(--text-xs); line-height: var(--leading-normal)
text-smfont-size: var(--text-sm); line-height: var(--leading-normal)
text-basefont-size: var(--text-base); line-height: var(--leading-normal)
text-lgfont-size: var(--text-lg); line-height: var(--leading-relaxed)
text-xlfont-size: var(--text-xl); line-height: var(--leading-relaxed)
text-2xlfont-size: var(--text-2xl); line-height: var(--leading-snug)
text-3xlfont-size: var(--text-3xl); line-height: var(--leading-snug)
text-4xlfont-size: var(--text-4xl); line-height: var(--leading-tight)

Example: Font size scale

text-xs - Extra small

text-sm - Small

text-base - Base

text-lg - Large

text-xl - Extra large

text-2xl

text-3xl

text-4xl

<p class="text-xs">Extra small</p> <p class="text-sm">Small</p> <p class="text-base">Base</p> <p class="text-lg">Large</p> <p class="text-xl">Extra large</p> <p class="text-2xl">2XL</p> <p class="text-3xl">3XL</p> <p class="text-4xl">4XL</p>

Font Weight

ClassCSS Property
font-lightfont-weight: var(--font-light)
font-normalfont-weight: var(--font-normal)
font-mediumfont-weight: var(--font-medium)
font-semiboldfont-weight: var(--font-semibold)
font-boldfont-weight: var(--font-bold)
font-extraboldfont-weight: var(--font-extrabold)

Text Alignment

ClassCSS Property
text-lefttext-align: left
text-centertext-align: center
text-righttext-align: right

Line Height

ClassCSS Property
leading-noneline-height: var(--leading-none)
leading-tightline-height: var(--leading-tight)
leading-snugline-height: var(--leading-snug)
leading-normalline-height: var(--leading-normal)
leading-relaxedline-height: var(--leading-relaxed)
leading-looseline-height: var(--leading-loose)

Letter Spacing

ClassCSS Property
tracking-tightletter-spacing: var(--tracking-tight)
tracking-normalletter-spacing: var(--tracking-normal)
tracking-wideletter-spacing: var(--tracking-wide)

Text Decoration

ClassCSS Property
underlinetext-decoration-line: underline
line-throughtext-decoration-line: line-through
no-underlinetext-decoration-line: none

Text Transform

ClassCSS Property
uppercasetext-transform: uppercase
lowercasetext-transform: lowercase
capitalizetext-transform: capitalize
normal-casetext-transform: none

Whitespace

ClassCSS Property
whitespace-normalwhite-space: normal
whitespace-nowrapwhite-space: nowrap
whitespace-prewhite-space: pre
whitespace-pre-wrapwhite-space: pre-wrap

Truncate

ClassCSS Property
truncateoverflow: hidden; text-overflow: ellipsis; white-space: nowrap

Example: Truncating text

This is a very long paragraph that will be truncated with an ellipsis when it overflows its container width.

<p class="truncate max-w-sm"> This is a very long paragraph that will be truncated... </p>

Font Style & Miscellaneous

ClassCSS Property
italicfont-style: italic
not-italicfont-style: normal
antialiased-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale
text-balancetext-wrap: balance

Example: Composing typography utilities

Article Title

Category

Body text with relaxed line-height for comfortable reading across long paragraphs of content.

<h2 class="text-2xl font-bold tracking-tight mb-2">Article Title</h2> <p class="text-sm uppercase tracking-wide font-semibold text-gray-500 mb-2">Category</p> <p class="text-base leading-relaxed text-gray-600">Body text...</p>