Toggle Sidebar B
header.lightDarkMode D

Scroll Spy

Auto-generated "On this page" sidebar that tracks the currently visible heading. Powers the right rail of every UI Library doc page.

Default

Point it at a container; ScrollSpy finds h2-h6 inside and renders a sticky nav.

Introduction

Some intro copy here.

Installation

Steps to install.

Usage

How to use the component.

API Reference

Props, events, and slots for each sub-component.

ScrollSpy

Props

PropTypeDefaultDescription
contentSelectorstringCSS selector for the container ScrollSpy walks for headings.
excludeSelectorstring""Skip headings whose closest match this selector (e.g. "[role=tabpanel]").
showLabelbooleantrueShow the 'On This Page' label above the nav.

Events

EventDescription
headings-foundEmitted on mount with the resolved headings array.