Heading
A section title rendered inside the native heading element matching its semantic depth.
Related articles
Rendered as <h2>: the scope this island opens says how deep it sits.Published this month
Rendered as <h3>: one level past the scope above.A fine-print aside
Rendered as <h6>: an explicit level always wins.View code
// The page knows the depth it is placing the island at, and hands it over:
// <RelatedArticles level={2} />
function RelatedArticles(handle: Handle<{ level: HeadingLevel }>) {
return () => (
<HeadingScope level={handle.props.level}>
<Heading>Related articles</Heading>
<Text>
Rendered as <h{handle.props.level}>: the scope this island opens says how deep it sits.
</Text>
<HeadingScope>
<Heading>Published this month</Heading>
<Text>Rendered as <h{handle.props.level + 1}>: one level past the scope above.</Text>
</HeadingScope>
<Heading level={6}>A fine-print aside</Heading>
<Text>Rendered as <h6>: an explicit level always wins.</Text>
</HeadingScope>
);
}Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Or copy it into your project to edit it:
sdxc ui add headingUsage
import { Heading } from "@sdxc/ui";Renders its children inside the native heading element matching level.
The default size is semibold, tight-tracked emphasis at lg; "display"
and "chapter" swap in displayHeading so large landing titles
stay light-weighted.
Examples
Chapter size
Tell customers before they ask
View code
<Heading size="chapter">Tell customers before they ask</Heading>Level from context
Billing settings
View code
<Heading>Billing settings</Heading>Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
level | Level | — | No | Semantic depth. Defaults to the nearest ancestor HeadingScope's depth, or 1 where no scope wraps this heading at all. |
size | "default" | "display" | "chapter" | — | No | Visual size recipe. Defaults to DEFAULT_SIZE. Landing pages reach for "display" (H1) or "chapter" (section H2); app chrome keeps "default". |
Also accepts everything in TagProps<"h1">.
Types
| Name | Values | What it decides |
|---|---|---|
Size | "default" | "display" | "chapter" | Visual size recipe: the catalog default, a page H1 display scale, or a section chapter (~40–48px) from the landing tokens. |