Affix

Pins content to a viewport or scroll container edge.

Affix

Viewport pinning

Without target, Affix listens to the page. Content pins to the viewport top after it reaches offset-top.

Code copied

Container pinning

Code copied

Bottom

Code copied

Custom content

The default slot can pin a toolbar, filter row, status, or any other component.

Code copied

PROPS

PropertyTypeValuesDescriptiondefaultExampleMore
offset-topNumberpixelsDistance from the top edge before the content is pinned.
offset-bottomNumberpixelsPin content to the bottom edge instead of the top.
targetFunction() => HTMLElement | WindowScroll target. Use a container element for local pinning.window
z-indexNumbernumberStacking order while pinned.100
No matching data

SLOTS

PropertyTypeValuesDescriptiondefaultExampleMore
defaultSlotany contentContent that should be pinned.
No matching data

EVENTS

PropertyTypeValuesDescriptiondefaultExampleMore
changeFires when the pinned state changes. Receives a boolean.
No matching data
Last Updated: 2026-08-17, 08:33:54