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.

On this page

CScrollspy

jsx
import { CScrollspy } from '@coreui/vue'

Props

PropertyDefaultType
containernullHTMLElement, 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.

rootMarginnullstring, 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).

Events

Event name
activate

Callback fired when the active section changes.

  • id string | null