DesignOverviewDesign SystemMapsGraphIntroductionInstallationDeriving a themeSandboxTheme builderVisual testingAgentsCortexMemoryActiveProvenanceActiveContextActiveServicesInsightsGet in touchSource on GitHub
Loading the reference
OutlineView sourceEdit in SandboxView MarkdownCopy MarkdownOpen in ClaudeOpen in CursorLinks to the headings on the page, with the section in view marked.Also called Table of contents, On this page, and Outline.StableSince 0.1.0NavigationImportimport'@fusion.dev/helix/outline'import'@fusion.dev/helix-headless/outline'Preview
GuidelinesWhen to use
Links to the headings of a long page, such as a guide, with the section in view marked.OutlineThis page
Set data-level on each link to its heading's level, 2 through 6.The outline does not read heading levels from the document, because the headings are not always in it.
Set follow on an outline with a scrollbar of its own.It keeps the link of the section in view showing as you scroll the page.
Anatomy
1::part(nav)The navigation landmark.
2::part(indicator)The mark that moves to the link of the section in view. It carries that link's place and size as --indicator-x, --indicator-y, --indicator-inline-size and --indicator-block-size, and data-placed once it has been placed, for a mark you draw and animate yourself.
API referenceRoothelix-outlineLinks to the headings on the page, with the section in view marked.
PropTypeDescriptionbehaviorScrollBehaviorDefault"auto"How the page scrolls to a section when its link is clicked.fallbackLabelstringDefault"On this page"The name the element gives itself where label is empty.followbooleanDefaultfalseKeeps the link of the section in view in view itself, in an outline
longer than the box it scrolls in, such as a contents rail with a
scrollbar of its own. Only that box moves: never the page, and never the
box the sections scroll in.labelstringDefault""The navigation's name, read by screen readers. A heading in the heading
slot names it in place of this.marker"rail"The rail form: a slim column of ticks, one per link, that opens on hover,
focus, or a tap into a surface holding the links.marks"reading"|"visible"Default"reading"Which links are marked. reading marks the one section being read, the
last whose heading has passed the reading line. visible marks every
section with part of it on screen, and the mark runs across their links.offsetnumberDefault0How far below the top of the scroll container a heading counts as reached,
in pixels. The scroll container is the window or the panel the sections
scroll in.
ReadTypeDescriptioncurrentstringThe id of the section in view, or empty before anything is measured.markedstring[]The ids of the sections whose links are marked, in page order: the one
current names, or under marks="visible" every section on screen.
Read-only, for the reason current gives.whenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The links, as anchors with fragment hrefs, or lists holding them.headingA heading above the links, such as "On this page". It names the navigation.indicatorA mark of your own, drawn inside the indicator part, where --indicator-x, --indicator-y, --indicator-inline-size and --indicator-block-size reach it.
EventTypeDescriptionhelix-activateHelixActivateEventFired when the section in view changes, with its id as the value. It reports the scroll position and cannot be prevented.
MethodTypeDescriptionscrollToSection(id: string) => booleanScrolls to the section with this id, as a press on its link does, with
behavior, and marks its link at once. The address and focus stay where
they are. Returns whether the outline has a link to that section.
PartDescriptionheadingThe box holding the heading slot, above the navigation.indicatorThe mark that moves to the link of the section in view. It carries that link's place and size as --indicator-x, --indicator-y, --indicator-inline-size and --indicator-block-size, and data-placed once it has been placed, for a mark you draw and animate yourself.navThe navigation landmark.surfaceThe box holding the heading and the navigation under marker="rail", which opens over the ticks.tickOne tick of the rail, for one link, with data-current while its section is in view. It carries the link's depth as --outline-depth.ticksThe column of ticks under marker="rail", hidden from assistive technology.
CSS PropertyDescription--outline-depthThe depth of the link a tick stands for, from one, set on each tick.--outline-heading-colorThe color of the heading in the heading slot.--outline-indentHow far each level is inset from the one above.--outline-indicator-colorThe color of the mark that moves to the section in view.--outline-link-colorThe color of a link.--outline-link-current-colorThe color of the link to the section in view.--outline-link-current-weightThe weight of the link to the section in view.--outline-link-font-sizeThe size of a link's text.--outline-link-hover-background-colorThe fill behind a link under the pointer.--outline-link-hover-colorThe color of a link under the pointer.--outline-link-padding-blockThe space above and below a link's text.--outline-link-padding-inlineThe space either side of a link's text, before any indent.--outline-link-radiusThe corner radius of a link's hover fill.--outline-railThe width of the gutter that holds the line and the moving mark.--outline-rule-colorThe color of the line down the leading edge.--outline-surface-backdropThe backdrop filter of that surface, which blurs what is behind it.--outline-surface-background-colorThe fill of the surface the rail opens into.--outline-surface-max-inline-sizeThe widest the surface grows before a title is cut with an ellipsis.--outline-tick-colorThe color of a tick in the rail.--outline-tick-current-colorThe color of the tick of the section in view.--outline-tick-gapThe space between ticks.--outline-tick-lengthThe length of a top-level tick, from which deeper levels are shortened and the current one lengthened.
Custom stateDescriptionopenThe rail is open: the pointer is over it, focus is inside it, or a tap opened it, and nothing has closed it.settledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Roothelix-headless-outlineLinks to the headings on the page, with the section in view marked.
PropTypeDescriptionbehaviorScrollBehaviorDefault"auto"How the page scrolls to a section when its link is clicked.fallbackLabelstringDefault"On this page"The name the element gives itself where label is empty.followbooleanDefaultfalseKeeps the link of the section in view in view itself, in an outline
longer than the box it scrolls in, such as a contents rail with a
scrollbar of its own. Only that box moves: never the page, and never the
box the sections scroll in.labelstringDefault""The navigation's name, read by screen readers. A heading in the heading
slot names it in place of this.marker"rail"The rail form: a slim column of ticks, one per link, that opens on hover,
focus, or a tap into a surface holding the links.marks"reading"|"visible"Default"reading"Which links are marked. reading marks the one section being read, the
last whose heading has passed the reading line. visible marks every
section with part of it on screen, and the mark runs across their links.offsetnumberDefault0How far below the top of the scroll container a heading counts as reached,
in pixels. The scroll container is the window or the panel the sections
scroll in.
ReadTypeDescriptioncurrentstringThe id of the section in view, or empty before anything is measured.markedstring[]The ids of the sections whose links are marked, in page order: the one
current names, or under marks="visible" every section on screen.
Read-only, for the reason current gives.whenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The links, as anchors with fragment hrefs, or lists holding them.headingA heading above the links, such as "On this page". It names the navigation.indicatorA mark of your own, drawn inside the indicator part, where --indicator-x, --indicator-y, --indicator-inline-size and --indicator-block-size reach it.
EventTypeDescriptionhelix-activateHelixActivateEventFired when the section in view changes, with its id as the value. It reports the scroll position and cannot be prevented.
MethodTypeDescriptionscrollToSection(id: string) => booleanScrolls to the section with this id, as a press on its link does, with
behavior, and marks its link at once. The address and focus stay where
they are. Returns whether the outline has a link to that section.
PartDescriptionheadingThe box holding the heading slot, above the navigation.indicatorThe mark that moves to the link of the section in view. It carries that link's place and size as --indicator-x, --indicator-y, --indicator-inline-size and --indicator-block-size, and data-placed once it has been placed, for a mark you draw and animate yourself.navThe navigation landmark.surfaceThe box holding the heading and the navigation under marker="rail", which opens over the ticks.tickOne tick of the rail, for one link, with data-current while its section is in view. It carries the link's depth as --outline-depth.ticksThe column of ticks under marker="rail", hidden from assistive technology.
CSS PropertyDescription--outline-depthThe depth of the link a tick stands for, from one, set on each tick.
Custom stateDescriptionopenThe rail is open: the pointer is over it, focus is inside it, or a tap opened it, and nothing has closed it.settledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Examples
NameDescriptionEventsThe section in view, reported by helix-activate as the page scrolls.PreviewHeadings on a page, with the one in view marked as the page scrolls.PreviewHeadings on a page, with the one in view marked as the page scrolls.RailThe outline as a rail of ticks at the edge of a long scroll, opening into the section titles on hover or focus.Smooth with offsetThe same outline, scrolling smoothly and stopping clear of a sticky header.