Skip to main content

molecules

Article nav links

An "On this page" list of jump links to an article's headings, collapsible on small screens.

Specimens

Headings Docs pages don't load the toggle script, so the small-screen button does nothing here.
{{ ArticleNavLinks.render({
  headings: [
    { id: "context", text: "Context" },
    { id: "approach", text: "Approach" },
    { id: "outcome", text: "Outcome" }
  ]
}) }}

Params

ParamTypeDescription
headingsarrayRequired array of {id, text} objects from the extractHeadings filter.
classesstring | variant map | arrayOptional extra CSS classes on the <nav>.

Notes

Get headings from the extractHeadings filter on the article body. The component renders nothing when the list is empty.