Scrollspy
Article Outline
An article outline placed above the text rather than beside it: the items are numbered, the active one gets a filled number, and the row scrolls by touch.
What you can change
- the outline heading through title
- the sections through sections: id, title and text
- the accent colour through accent
A link for your AI agent: preview, code and instructions.
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this on the home page as the hero:
https://vibeui.ru/c/scrollspy-002?lang=en&theme=dark
Not sure where to paste it? Step-by-step guide
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
Loading…
For developers
The install command lives in the “Component source” block below — a signed link that stays valid for 24 hours.
Technical notes
The component is self-contained: one file, no dependencies, the palette in local variables --vibeui-scrollspy-002-*. Client-side ("use client") — IntersectionObserver is needed. The observer watches the sections inside its own scroll area: root is the text block itself, rootMargin cuts off the bottom 65%, so the section at the top edge becomes active rather than any visible one. The links are plain anchors without preventDefault: without JS they still take you to the section, the observer only adds the highlight. The active item is marked with aria-current and a filled number circle: in a horizontal row the text colour alone is not enough.
Tags
- scrollspy
- toc
- article
- navigation
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…