Skip to content

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.

heading(2, 'Installation', { id: 'installation' });
heading(3, 'From source', { id: 'from-source' });
heading(3, 'From registry', { id: 'from-registry' });
data-cpd-step flag
heading(2, 'Create the account', { id: 'create-account', step: true });
OptionTypeDescription
level1–6Heading level (first argument).
textstringHeading text (second argument).
idstringAnchor id — also used by the copy-link button.
stepbooleanMarks the heading as a ClerkTOC step (data-cpd-step).
  • The anchor link is href="#<id>"; the copy button copies the absolute location.origin + pathname + #<id> URL.
  • step headings render with a step badge in the article and get step dots in the ClerkTOC rail.