Generated from heading text via rehype-slug.
Heading Anchors
1 min readStableBeginner
Every h2–h6 heading inside a doc article gets a hover-revealed copy button. Clicking it copies a deep-link URL and updates the address bar fragment without navigating.
Quick Start
Hover a heading, or focus it with the keyboard, to reveal the copy button. Click it to copy the deep link.
Adding Options
Headings get their id from rehype-slug. rehype-autolink-headings prepends a visible anchor link, and HeadingAnchors appends the copy button. The two affordances are independent — the link jumps, the button copies.
Advanced
Share a deep link that scrolls to a specific heading and opens it via the URL fragment.
Plain Text
https://example.com/features/platform/heading-anchors#optionsOptions
heading idslugRelated pages
Was this page helpful?