SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

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
tsx
// 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 &lt;h{handle.props.level}&gt;: the scope this island opens says how deep it sits.
			</Text>

			<HeadingScope>
				<Heading>Published this month</Heading>
				<Text>Rendered as &lt;h{handle.props.level + 1}&gt;: one level past the scope above.</Text>
			</HeadingScope>

			<Heading level={6}>A fine-print aside</Heading>
			<Text>Rendered as &lt;h6&gt;: 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.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Or copy it into your project to edit it:

Terminal
sdxc ui add heading

Usage

typescript
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
tsx
<Heading size="chapter">Tell customers before they ask</Heading>

Level from context

Billing settings

View code
tsx
<Heading>Billing settings</Heading>

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

PropTypeDefaultRequiredDescription
levelLevel—NoSemantic depth. Defaults to the nearest ancestor HeadingScope's depth, or 1 where no scope wraps this heading at all.
size"default" | "display" | "chapter"—NoVisual 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

NameValuesWhat 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.
@sdxc/ui

Can’t find it? Contact us