Typography
Heading
Headings where the outline level (h1–h6) is chosen independently from the visual size.
import { Heading } from '@reactloom/ui';Examples
Default sizes per level
Workspace settings
Members
Pending invitations
Expired
import { Heading, Stack } from '@reactloom/ui';
export default function Example() {
return (
<Stack gap="3" style={{ width: '100%' }}>
<Heading level={1}>Workspace settings</Heading>
<Heading level={2}>Members</Heading>
<Heading level={3}>Pending invitations</Heading>
<Heading level={4}>Expired</Heading>
</Stack>
);
}Level ≠ size
A small h2 in a dense sidebar.
Recent activity
3 deployments in the last hour.
import { Heading, Stack, Text } from '@reactloom/ui';
export default function Example() {
return (
<Stack gap="1">
{/* An h2 for the outline, styled small for a dense sidebar. */}
<Heading level={2} size="sm" tone="muted" weight="medium">Recent activity</Heading>
<Text>3 deployments in the last hour.</Text>
</Stack>
);
}API reference
| Prop | Type | Default |
|---|---|---|
levelrequiredOutline level. | 1 | 2 | 3 | 4 | 5 | 6 | — |
size | 'xs' … '5xl' | by level |
weight · tone · align · truncateAs on Text. | | — |
Customization
Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.
State attributes
Target these in your CSS to style states without depending on class names.
| Attribute | Values |
|---|---|
[data-align] | start · center · end |
[data-size] | xs · sm · md · lg · xl · 2xl · 3xl · 4xl · 5xl |
[data-tone] | default · muted · subtle · accent · danger · success · warning |
[data-weight] | regular · medium · semibold · bold |
Theme tokens it reads
--pl-color-accent-fg --pl-color-danger-fg --pl-color-fg-default --pl-color-fg-muted --pl-color-fg-subtle --pl-color-success-fg --pl-color-warning-fg --pl-font-size-2xl --pl-font-size-3xl --pl-font-size-4xl --pl-font-size-5xl --pl-font-size-lg --pl-font-size-md --pl-font-size-sm --pl-font-size-xl --pl-font-size-xs
Accessibility
- Pick levels from the document outline; never skip levels for styling.
Usage guidelines
Do
- One h1 per page.
Don’t
- Don’t choose a level for its size.