SectionHeader
Mono eyebrow, heading and lede.
Preview
Components
A page for each part
A live preview, the code that produced it and the options, from one file.
Add to your site
npx docs-sitekit add section-headerIt writes these files, and keeps a file you changed:
src/presentation/components/site/section-header.tsx
It requires these entries of the registry, which add restores first:
Props
Built from the TypeScript types and the TSDoc comments of the component, so they cannot drift from the code.
| Key | Type | Default | Allowed values | Description |
|---|---|---|---|---|
as | string | "h2" | "h2", "h1" | The heading element. Use "h1" for the heading that names the page. |
eyebrow | string | - | - | A short line in mono type over the heading. |
title | string | required | - | The heading. |
lede | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<AwaitedReactNode> | - | - | A sentence under the heading. |
className | string | - | - | Classes added to the wrapper. |
children | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<AwaitedReactNode> | - | - | An action, shown on the right of the text, or under it on a phone. |
Variants and states
The heading of the page
as="h1" for the one heading that names the page.
Examples
Working examples you can copy and adapt.
With an action
Children go on the right, and wrap under the text on a phone.
Docs
Guides and reference
About
The top of a section: a short eyebrow in mono type, a heading and a lede. Children go on the right, and wrap under the text on a phone.
Accessibility
- The heading is an
h2. A page has oneh1, so passas="h1"only for the heading that names the page. - The eyebrow is a paragraph, not a heading, so it adds nothing to the outline of the page.
- The heading and the lede use the
fg-brightandfg-mutedtokens, which reach AA in both themes.
Source
Edit this page
Last updated