Skip to main content
Shadcn/ui doesn’t ship with default typography styles. Instead, it provides utility classes and examples to help you style text elements consistently across your application.

Typography Examples

Here are common typography patterns you can use in your application:

Headings

h1

The text-balance utility helps create more visually balanced text wrapping.

h2

h3

h4

Paragraph

Default paragraph styling:

Blockquote

Lists

Unordered list:
Ordered list:

Inline Code

Lead Text

Larger paragraph text for introductions:

Large Text

Small Text

Muted Text

Complete Example

Here’s a complete example combining various typography elements:

Tables

For table styling, use the Table component or these utility classes:
Style links with these utilities:

Utility Classes Reference

Common spacing utilities for typography:
  • leading-7 - Line height for body text
  • scroll-m-20 - Scroll margin for anchor links
  • [&:not(:first-child)]:mt-6 - Top margin for all but first element
  • my-6 - Vertical margin for block elements

Responsive Typography

Adjust typography for different screen sizes:

Right-to-Left (RTL) Support

For RTL language support, see the RTL configuration guide.

Best Practices

  • Use semantic HTML elements (h1, p, ul, etc.) for better accessibility
  • Apply text-balance to headings for better text wrapping
  • Use scroll-m-* utilities to add scroll margin for anchor links
  • Maintain consistent spacing with utility patterns like [&:not(:first-child)]:mt-6
Avoid applying global typography styles. Use utility classes directly on elements for maximum flexibility and to prevent specificity issues.