Typography
Unified typography system for consistent text styling across your application.
Overview
The Typography system provides consistent text styling for documents, articles, and MDX content. It includes individual text components and an MDX components map that can be passed directly to your MDX renderer.
MDX Components
The mdxComponents object maps HTML tags to styled React components. Pass it to your MDX renderer for automatic styling.
import { mdxComponents } from "@/registry/components/typography"
import { Content } from "astro:content"
<Content components={mdxComponents} />Supported elements: h1–h6, p, a, blockquote, ul, ol, li, pre, code, em, strong, hr, br, img, del, table, thead, tbody, tr, th, td.
Individual Components
Each typography element is exported as a named component for use outside MDX:
import { H1, H2, P, A, Blockquote } from "@/registry/components/typography"
function MyPage() {
return (
<>
<H1>Page Title</H1>
<P>Body text with a <A href="/docs">link</A>.</P>
<Blockquote>A meaningful quote.</Blockquote>
</>
)
}Code Block Integration
Fenced code blocks in MDX are automatically rendered with the CodeBlock component, providing syntax highlighting with a Mac terminal style.
```tsx
const greeting = "Hello, world!"
console.log(greeting)
```The integration detects the language-xxx class on <code> elements and delegates rendering to CodeBlock with the appropriate language.
Available Components
| Component | HTML Tag | Description |
|---|---|---|
H1–H6 | h1–h6 | Heading levels with scroll-margin and tracking |
P | p | Paragraph with comfortable line height |
A | a | Link with underline and external detection |
Blockquote | blockquote | Styled quote with left border |
Ul / Ol | ul / ol | Lists with disc/decimal markers |
Li | li | List item with comfortable line height |
Pre | pre | Code block (delegates to CodeBlock for syntax) |
InlineCode | code | Inline code with background |
Em | em | Italic emphasis |
Strong | strong | Bold emphasis |
Hr | hr | Horizontal rule |
Img | img | Responsive image with rounded corners |
Del | del | Strikethrough text |
MdxTable | table | Table wrapper with overflow |