Heading
A semantic heading with an independent visual size.
Project settings
Manage your project and its members.Installation
Needs the arene setup first. Also adds Text.
Install the packages it imports:
Set up the token layer. See Installation. Also copy Text, which exports the shared typography maps.
Copy the component into your project.
Change the @/ imports if your project uses different aliases.
Usage
level selects h1 through h6 and sets the default size. size overrides it
with sm, base, lg, xl2, xl3 or xl4 from Text, and
does not change the heading level. headingStyles exports base, sizes and
weights.
Level
Choose the level for the document outline. Each level has a default size: h1 is
xl2, h2 is lg, h3 is base, and h4 through h6 are sm.
Level 1
Level 2
Level 3
Level 4
Level 5
Level 6
Size
Set size when a heading should look different from its level's default, such
as an h2 card title at sm or an h1 display heading at xl4.
Contact details
Notifications
Team members
Project settings
Account overview
Build with arene
Weight
Headings default to semibold and inherit the surrounding color.
Normal heading
Medium heading
Semibold heading
Bold heading
Composition
Pass render to choose a semantic element. Put its props on that element.
Team members
API reference
See Base UI's useRender reference for composition props. Native element props are forwarded.
| Prop | Type | Default |
|---|---|---|
level | 1 | 2 | 3 | 4 | 5 | 6 | 2 |
size | keyof typeof headingStyles.sizes | From level |
weight | keyof typeof headingStyles.weights | "semibold" |
render | useRender.RenderProp | Native element |
xstyle | StyleXStyles | None |
className | string | None |
style | CSSProperties | None |
Data attributes
| Attribute | On | Effect |
|---|---|---|
data-slot="heading" | root | Identifies the component |
data-size | root | The size in effect |