Vue Scrollspy Component API
Scrollspy API
Explore the API reference for the Vue Scrollspy component and discover how to effectively utilize its props for customization.
import { CScrollspy } from '@coreui/vue'
| Property | Default | Type |
|---|
| container | null | HTMLElement, null |
The scrollable element holding the sections. Bind a template ref; without it the viewport is the root. |
| ids | - | string[] |
Ids of the sections to observe, in document order. |
| rootMargin | null | string, null |
Raw IntersectionObserver rootMargin. When set it takes precedence over topMargin and is passed straight to the observer. |
| threshold | () => [0] | number[] |
Intersection observer thresholds. |
| topMargin | '12%' | string |
Position of the activation line, measured from the top of the scroll root. The active section is the deepest one whose top has scrolled to or above it. Accepts a percentage (12%) or pixels (96px, e.g. below a sticky navbar). |
| Event name |
|---|
| activate |
Callback fired when the active section changes. |