Heading
Anchored headings with hover copy-link buttons.
heading() renders an anchored heading: clicking the text jumps to the
anchor, a ghost copy button appears on hover/focus and copies the #<id>
link.
Levels
Section titled “Levels”h2 and h3
heading(2, 'Installation', { id: 'installation' });heading(3, 'From source', { id: 'from-source' });heading(3, 'From registry', { id: 'from-registry' });Step headings
Section titled “Step headings”data-cpd-step flag
heading(2, 'Create the account', { id: 'create-account', step: true });| Option | Type | Description |
|---|---|---|
level | 1–6 | Heading level (first argument). |
text | string | Heading text (second argument). |
id | string | Anchor id — also used by the copy-link button. |
step | boolean | Marks the heading as a ClerkTOC step (data-cpd-step). |
- The anchor link is
href="#<id>"; the copy button copies the absolutelocation.origin + pathname + #<id>URL. stepheadings render with a step badge in the article and get step dots in the ClerkTOC rail.