Title
Renders an <h1>–<h6> element via the order prop. Visual size can be overridden independently with size, and text can be clamped with lineClamp.
Heading levels
h1 — Title order=1
h2 — Title order=2
h3 — Title order=3
h4 — Title order=4
h5 — Title order=5
h6 — Title order=6
<Title order={1}>h1 heading</Title>
<Title order={2}>h2 heading</Title>
<Title order={3}>h3 heading</Title>
<Title order={4}>h4 heading</Title>
<Title order={5}>h5 heading</Title>
<Title order={6}>h6 heading</Title>Size override
Use size to control the visual size independently of the semantic heading level.
order=2 size="h1"
order=1 size="h4"
order=3 size="xl"
order=3 size="sm"
<Title order={2} size="h1">Semantic h2, visual h1</Title>
<Title order={1} size="h4">Semantic h1, visual h4</Title>
<Title order={3} size="xl">xl size token</Title>
<Title order={3} size="sm">sm size token</Title>Color
Violet title
Blue title
Green title
<Title order={2} c="violet">Violet title</Title>
<Title order={2} c="blue">Blue title</Title>
<Title order={2} c="green">Green title</Title>Text wrap
Balanced wrapping keeps heading lines close in length
Pretty wrapping avoids orphaned words at the end of headings
<Title order={2} textWrap="balance">
Balanced wrapping keeps heading lines close in length
</Title>
<Title order={2} textWrap="pretty">
Pretty wrapping avoids orphaned words at the end
</Title>Line clamp
A very long heading that will be clamped to a single line with an ellipsis
<Title order={2} lineClamp={1}>
A very long heading that will be clamped to a single line...
</Title>Polymorphic component
Pass any Davaux component to component to change the rendered element while keeping heading styles. A common use case is rendering a heading as an Anchor so it becomes a styled, clickable link.
import { Anchor, Title } from '@davaux/ui'
<Title order={2} component={Anchor} href="#">
Clickable h2 heading
</Title>
<Title order={3} component={Anchor} href="#" c="violet">
Violet h3 link
</Title>Props
| Prop | Type | Default | Description |
|---|---|---|---|
order | 1|2|3|4|5|6 | 1 | Heading level — renders <h1>–<h6> |
size | 'xs'|'sm'|'md'|'lg'|'xl'|'h1'–'h6'|string | — | Visual size override, independent of order |
lineClamp | number | — | Max lines before clamping with ellipsis |
textWrap | 'wrap'|'nowrap'|'balance'|'pretty' | — | How the heading text wraps |
c | string | — | Text color — theme key or CSS value |
ta | 'left'|'center'|'right'|'justify' | — | Text alignment |
component | string | UiComponent | — | Overrides the rendered element — e.g. pass Anchor for a heading that is also a link |