Typography
Installation
Usage
Choose a role for meaning, then use class for a local exception.
Role reference
h1-h6 --font-header / document heading scale / --font-weight-headerp 1rem / --font-weight-description / foreground-mutedp 1rem / --font-weight-body / foregroundp --font-size-body / --font-weight-body / foreground-mutedcode --font-mono / --radius-sm / secondaryh1-h6 --font-header / --font-size-header / --font-weight-headerp --font-size-body / --font-weight-description / --tracking-bodyspan --text-xs / --font-weight-body / --tracking-bodyExamples
Heading levels
Use the heading that matches the document outline. Compact component titles remain
available through Typography.Title .
Text roles
Choose a paragraph role from its relationship to the surrounding content, not from a standalone size or color.
Numeric metadata
Add tabular-nums when readers compare
values in a column.
API reference
Typography.Description
Renders supporting text.
| Prop | Type | Default |
|---|---|---|
children Required | Snippet<[]> | — |
Typography.H1
Renders the primary document heading.
| Prop | Type | Default |
|---|---|---|
children Required | Snippet<[]> | — |
Typography.H2
Renders a document section heading.
| Prop | Type | Default |
|---|---|---|
children Required | Snippet<[]> | — |
Typography.H3
Renders a document subsection heading.
| Prop | Type | Default |
|---|---|---|
children Required | Snippet<[]> | — |
Typography.H4
Renders a fourth-level document heading.
| Prop | Type | Default |
|---|---|---|
children Required | Snippet<[]> | — |
Typography.H5
Renders a subdued fifth-level heading.
| Prop | Type | Default |
|---|---|---|
children Required | Snippet<[]> | — |
Typography.H6
Renders a subdued sixth-level heading.
| Prop | Type | Default |
|---|---|---|
children Required | Snippet<[]> | — |
Typography.InlineCode
Renders code within prose.
| Prop | Type | Default |
|---|---|---|
children Required | Snippet<[]> | — |
Typography.Metadata
Renders compact secondary information.
| Prop | Type | Default |
|---|---|---|
children Required | Snippet<[]> | — |
Typography.Text
Renders lead, body, or supporting prose.
| Prop | Type | Default |
|---|---|---|
children Required | Snippet<[]> | — |
variant | TypographyTextVariant | undefined | 'supporting' |
Typography.Title
Renders an explicit heading level.
| Prop | Type | Default |
|---|---|---|
children Required | Snippet<[]> | — |
level Required | 1 | 2 | 3 | 4 | 5 | 6 | — |
pnpm dlx @mielui/svelte add typography