import { Meta, Typeset } from 'storybook/blocks';
<Meta title="Style Guide/Typography" />
Typography creates hierarchy, improves readability, and establishes visual rhythm throughout the interface.
Typography Principles#
- Readability First: Optimize for long-form reading and scanning
- Clear Hierarchy: Use size and weight to establish importance
- Consistent Scale: Follow modular scale for harmonic sizing
- Responsive: Adjust sizes for different screen sizes
Font Families#
Primary: Inter#
Inter is our primary font for all UI text. It's designed for screens with excellent legibility at small sizes.
font-family: 'Inter', system-ui, sans-serif;
Use for:
- Body text
- UI elements (buttons, labels, inputs)
- Headings (when simplicity is preferred)
Display: Playfair Display#
Playfair Display adds elegance for large display text and special emphasis.
font-family: 'Playfair Display', Georgia, serif;
Use for:
- Hero headlines
- Marketing content
- Special callouts
- Spiritual/philosophical contexts
Mono: JetBrains Mono#
JetBrains Mono is used for code, technical content, and fixed-width displays.
font-family: 'JetBrains Mono', 'Fira Code', monospace;
Use for:
- Code blocks
- Technical identifiers
- Timestamps
- Version numbers
Type Scale#
Our type scale follows a modular progression for consistent hierarchy.
| Token | Size | Line Height | Use |
|---|---|---|---|
xs |
12px | 16px | Captions, labels |
sm |
14px | 20px | Secondary text, meta |
base |
16px | 24px | Body text |
lg |
18px | 28px | Lead paragraphs |
xl |
20px | 28px | H5 |
2xl |
24px | 32px | H4 |
3xl |
30px | 36px | H3 |
4xl |
36px | 40px | H2 |
5xl |
48px | 48px | H1 |
6xl |
60px | 60px | Display |
7xl |
72px | 72px | Hero |
8xl |
96px | 96px | Jumbo |
9xl |
128px | 128px | Maximum |
Font Weights#
| Token | Weight | Use |
|---|---|---|
thin |
100 | Decorative only |
light |
300 | Large display text |
normal |
400 | Body text |
medium |
500 | Emphasis, labels |
semibold |
600 | Subheadings, buttons |
bold |
700 | Headings, strong emphasis |
extrabold |
800 | Hero text |
black |
900 | Maximum impact |
Heading Styles#
H1 - Page Title#
<h1 className="text-5xl font-bold tracking-tight">
Page Title
</h1>
Size: 48px | Weight: Bold | Tracking: Tight (-0.025em)
H2 - Section Title#
<h2 className="text-4xl font-bold tracking-tight">
Section Title
</h2>
Size: 36px | Weight: Bold | Tracking: Tight
H3 - Subsection#
<h3 className="text-3xl font-semibold">
Subsection
</h3>
Size: 30px | Weight: Semibold
H4 - Card Title#
<h4 className="text-2xl font-semibold">
Card Title
</h4>
Size: 24px | Weight: Semibold
H5 - Component Header#
<h5 className="text-xl font-semibold">
Component Header
</h5>
Size: 20px | Weight: Semibold
H6 - Label#
<h6 className="text-base font-semibold">
Label
</h6>
Size: 16px | Weight: Semibold
Body Text Styles#
Lead Paragraph#
Used for introductory text that should stand out.
<p className="text-lg text-neutral-700 dark:text-neutral-300">
Lead paragraph introduces the section with larger, slightly muted text.
</p>
Body#
Standard body text for content.
<p className="text-base text-neutral-900 dark:text-neutral-100">
Body text is optimized for reading with appropriate line height
and contrast for extended passages.
</p>
Small#
Secondary information and meta content.
<p className="text-sm text-neutral-600 dark:text-neutral-400">
Small text for secondary information like timestamps and metadata.
</p>
Caption#
Minimal size for labels and captions.
<span className="text-xs text-neutral-500 dark:text-neutral-500">
Caption or label text
</span>
Line Heights#
| Token | Value | Use |
|---|---|---|
none |
1 | Single line text only |
tight |
1.25 | Headings |
snug |
1.375 | Compact layouts |
normal |
1.5 | Body text |
relaxed |
1.625 | Long-form reading |
loose |
2 | Maximum readability |
Letter Spacing#
| Token | Value | Use |
|---|---|---|
tighter |
-0.05em | Large display text |
tight |
-0.025em | Headings |
normal |
0 | Body text |
wide |
0.025em | Small caps, labels |
wider |
0.05em | All caps |
widest |
0.1em | Decorative uppercase |
Practical Examples#
Article Layout#
<article className="max-w-prose mx-auto">
<h1 className="text-5xl font-bold tracking-tight mb-6">
Article Title
</h1>
<p className="text-lg text-neutral-700 dark:text-neutral-300 mb-8">
Lead paragraph that summarizes the article content and draws
the reader in.
</p>
<div className="prose prose-neutral dark:prose-invert">
<p>
Regular paragraph text with optimal line height for reading...
</p>
<h2>Section Heading</h2>
<p>
More content follows with consistent spacing...
</p>
</div>
</article>
Card Typography#
<Card>
<CardHeader>
<span className="text-xs font-medium uppercase tracking-wide text-primary-600">
Category
</span>
<CardTitle className="text-2xl font-semibold mt-1">
Card Title
</CardTitle>
<CardDescription className="text-sm text-neutral-600">
Brief description of the card content
</CardDescription>
</CardHeader>
</Card>
Navigation Typography#
<nav>
<a className="text-sm font-medium text-neutral-700 hover:text-neutral-900">
Navigation Link
</a>
</nav>
Responsive Typography#
Scale typography based on viewport:
// Responsive heading
<h1 className="text-3xl md:text-4xl lg:text-5xl font-bold">
Responsive Heading
</h1>
// Responsive body
<p className="text-sm md:text-base">
Body text that grows on larger screens
</p>
Typography Tokens in Code#
import { fontSizes, fontWeights, lineHeights } from '@/design-system/tokens';
// Access typography values
console.log(fontSizes['2xl']); // '1.5rem'
console.log(fontWeights.semibold); // 600
console.log(lineHeights.normal); // 1.5
Best Practices#
Do#
- Use semantic HTML elements (h1-h6, p, etc.)
- Maintain consistent heading hierarchy (don't skip levels)
- Use appropriate line height for content type
- Test readability on actual devices
- Apply negative letter-spacing to large headings
Don't#
- Use more than 2-3 font sizes on a single view
- Mix font families without purpose
- Use thin weights for small body text
- Create text lines longer than 75 characters
- Justify text (use left alignment)
Accessibility#
- Minimum body text size: 16px
- Minimum line height for body: 1.5
- Color contrast: 4.5:1 for normal text, 3:1 for large text
- Allow users to resize text up to 200%
- Don't use font size as the only indicator of hierarchy