Heading
A semantic document heading using the DS typography role for its level, with an optional DS action beside the anchor.
Start here
Installation
import { Heading } from "@catalog-developer/components";Usage
Choose the level that represents the heading's place in the document. Heading supplies the correct DS type role; its parent owns surrounding layout spacing.
Start here
Configure access
<Heading as="h2">Start here</Heading><Heading as="h3">Configure access</Heading>Anchor actions
An id turns the heading text into its fragment link. Attach a DS CopyButton as action when the surface needs a companion action such as Docs' concise copy control. Heading reveals the action on hover, focus, and touch by default.
<Heading as="h2" id="start-here" action={<CopyButton value={url} label="Copy" size="xs" />}> Start here</Heading>API reference
| Prop | Type | Default | Description |
|---|---|---|---|
as | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "h2" | Sets both the semantic element and its matching DS text-heading role. |
id | string | — | Makes the heading text an anchor to its section. |
action | ReactNode | — | A sibling DS control, revealed on heading hover or keyboard focus. Docs supplies its ghost, tooltip-free CopyButton here. |
children | ReactNode | — | The heading's accessible name and visible content. |