Skip to content

Outline

@astryxdesign/core v0.7.1 · Outline

Props ​

NameTypeDefaultDescription
itemsOutlineItem[]—Ordered headings. Each item is { id, label, level }. level is 1–6.
activeIdstring—Controlled active heading. When set, built-in scroll-spy stays off. Bind with v-model:active-id.
labelstringTable of contentsAccessible name of the nav landmark. The default is localized.
density'default' | 'compact''default'Item padding. compact is for dense sidebars.
offsetnumber0Pixels of a fixed header covering the scroll root. Shifts the activation line and the scroll landing together.
scrollContainerHTMLElement | null—Scroll container to track. Omit it to use the nearest scrollable ancestor, or the viewport.
hasScrollOnClickbooleantrueWhether activating an item smooth-scrolls to it.

Events ​

NamePayloadDescription
update:activeIdstringThe active id changed, from scroll-spy or from activating an item.
navigateStartstringA click started a scroll to this id.
navigateEndstringThat navigation finished, was interrupted, or hit the 1.2 second limit. Fires once per start.

Theme ​

The root class is astryx-outline. The indicator reads --astryx-outline-indicator-top and --astryx-outline-indicator-height, which the component measures from the active link.

Indent is a 2px track plus padding-inline-start: spacing 3 at the first indent, spacing 7, spacing 11, then spacing 12. compact changes block padding from spacing 2 to spacing 1.