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: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:Links
Style links with these utilities:Utility Classes Reference
- Tab Title
- Tab Title
- Tab Title
- Tab Title
Common spacing utilities for typography:
leading-7- Line height for body textscroll-m-20- Scroll margin for anchor links[&:not(:first-child)]:mt-6- Top margin for all but first elementmy-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-balanceto 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