Components · Content
Heading
A heading. level 1-4 (default 2) sets its place in the outline; use one level-1 heading at most. size (sm, md, lg, xl, 2xl, display) sets how large it looks without changing the level; align places it.
ExamplesLink to this section
Release 2.4
What changed
Breaking changes
Migration notes
Show JSONHide JSON
{
"version": 1,
"root": "page",
"elements": {
"page": {
"type": "Stack",
"props": { "gap": "sm" },
"children": ["h1", "h2", "h3", "h4"]
},
"h1": {
"type": "Heading",
"props": { "text": "Release 2.4", "level": 1 }
},
"h2": { "type": "Heading", "props": { "text": "What changed" } },
"h3": {
"type": "Heading",
"props": { "text": "Breaking changes", "level": 3 }
},
"h4": {
"type": "Heading",
"props": { "text": "Migration notes", "level": 4 }
}
}
}`size` sets the look; `level` still sets the outline.
Plans your whole team can read
Show JSONHide JSON
{
"version": 1,
"root": "heading",
"elements": {
"heading": {
"type": "Heading",
"props": {
"text": "Plans your whole team can read",
"level": 2,
"size": "display",
"align": "center"
}
}
}
}PropsLink to this section
Generated from the zod schema the server validates with. Unknown props are ignored with a warning. Any prop can also be a dynamic value such as { "$state": "/path" }; it is checked again once it resolves.
| Prop | Type | Limits and defaults |
|---|---|---|
| textrequired | string | max 200 chars |
| level | integer | 1–4 |
| size | "sm" | "md" | "lg" | "xl" | "2xl" | "display" | — |
| align | "start" | "center" | "end" | — |
RulesLink to this section
- Use one level-1 heading at most.
sizechanges how large a heading looks, never its level. The two largest sizes shrink on a narrow page column or canvas frame.
Children and eventsLink to this section
Heading is a leaf: it does not show children. Validation warns when a leaf has some; wrap them in a Stack or Card instead.
It emits no events.