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
Scroll this page down and observe the button being pinned as it approaches the top of the viewport (position: fixed).
Custom offset
Custom offset
Combined content
Combined content
API
Attributes
| Attribute | Description | Type | Default |
|---|---|---|---|
offset | Fixed distance from the viewport top (px) | string | 0 |
Slots
| Name | Description |
|---|---|
| default | — |
Listens to window scroll; the content is pinned once it scrolls out of the viewport and is passed through the default slot.