Skip to content

Affix

Pins content to the top of the viewport; it becomes fixed once the page scrolls past a given offset. Commonly used for fixed table action bars, toolbars, etc.

Basic usage

Basic usage

Pinned to the top when scrolling

Scroll this page down and observe the button being pinned as it approaches the top of the viewport (position: fixed).

Custom offset

Custom offset

Fixed 80px from the viewport top

Combined content

Combined content

FiltersResetQuery

API

Attributes

AttributeDescriptionTypeDefault
offsetFixed distance from the viewport top (px)string0

Slots

NameDescription
default

Listens to window scroll; the content is pinned once it scrolls out of the viewport and is passed through the default slot.