Scrollspy
Available as: Web ComponentShortcodeOxygen ElementAutomatically add CSS classes to navigation items and content elements depending on the scroll position.
Properties
nav-class
Type: stringDefault: spx-scrollspy__nav--active
Applied class to active navigation element.
root-margin
Type: stringDefault: 0px
Intersection observer root margin.
target
Type: stringDefault: a
Target element. Can take any querySelector value. (id, class, tag etc.)
threshold
Type: numberDefault: 0.5
Intersection observer threshold.
url-change
Type: booleanDefault: false
Appends the currently active link to the end of the URL.
Slots
inner
Slot (between HTML tag).
Events
spxScrollspyDidLoad
Fires after component has loaded.