Anchor

Navigate directly between related sections on the current page.

Anchor

Default

Code copied

Hierarchy

Use children to organize related links. The parent remains a normal target; child items represent the more specific sections beneath it.

Code copied

Secondary link

Each item uses a stable href that points to a real page ID. offset controls when an item becomes active, while target-offset controls the final scroll position after a click.

Horizontal

Code copied

Scroll container

By default Anchor listens to the page window. For a panel or virtualized page, provide get-container and return that scrolling element. The navigation and active-state calculation then use the same container.

Code copied

API

PROPS

PropertyTypeValuesDescriptiondefaultExampleMore
model-value/v-modelStringhrefActive anchor href.''
itemsArray{ hreftitledisabled?children? }[]Anchor items. Use children for one nested level in vertical mode.[]
offset / target-offset / boundsNumberpixelsActive-state offset, scroll destination offset, and detection tolerance.88 / offset / 5
affixBooleantrue / falseKeeps the anchor navigation sticky in the viewport.
get-containerFunction() => HTMLElement | WindowReturns the scroll container. Defaults to the page window.window
get-current-anchorFunction(activeHref) => hrefLets you override the highlighted href.undefined
replaceBooleantrue / falseReplaces browser history instead of appending a hash entry.
directionStringvertical / horizontalAnchor layout direction. Nested items are available in vertical mode.vertical
scroll-behaviorStringauto / smoothScroll behavior after selecting an anchor.smooth
No matching data

EVENTS

PropertyTypeValuesDescriptiondefaultExampleMore
changeFired when the active anchor changes.
clickFired when an anchor item is selected.
No matching data
Last Updated: 2026-08-17, 08:33:54