shadcn.io is not affiliated with official shadcn/ui
Scroll Progress Ruler Track Features Block for Vue
A features section for an analytics SDK: a sticky ruler of six anchor-link ticks that follows six full sections as you scroll, lighting the tick of the section on screen with a sliding thumb.
Installation
Overview
A features section for Vue with Ark UI, built around a ruler that follows the page. Under a compact header, a band of six ticks (install, capture, identify, funnels, privacy and export), each an anchor link, sticks to the top of the screen while six sections scroll beneath it. The section on screen lights its tick, and a thumb slides along the ruler to it. Each section is a number, a title, a sentence and one figure, with a small greyscale drawing of the feature beside them from md up. The ruler is a table of contents, so a click jumps to a section and the keyboard works as it does on any outline. It's built from Table of Contents (Toc) and the Guides line kit, with your theme's tokens for every colour and no button. For long product tours, SDK walkthroughs and any page where people want to know how far along they are.
FAQ
How do I change the sections?
Edit the six stop objects at the top of the file: each has a number, a name for the ruler, a heading, a sentence, a figure with its label and an anchor id. The ruler's items are built from the same list, and each section's heading carries that id, so a link and its section can't come apart. A drawing is a small component beside them; pass your own as the section's child.
How does the ruler know which section is on screen?
The Toc component watches the headings with an intersection observer, in a band a little below the top of the screen (its rootMargin). The tick of the heading in that band is marked active, and the thumb is placed from the active link's position, so it follows the section even when the window is resized. With reduced motion the thumb jumps instead of sliding.
Can it sit under a fixed header?
Yes. The ruler is sticky at the top of the screen; if your page has a fixed navigation bar, change top-0 on the ruler to the bar's height, and raise the scroll-mt-24 on each heading by the same amount so a jump doesn't hide the title behind the ruler.
How does it work from the keyboard?
The ticks are plain links in a navigation landmark named "Stops": Tab moves along them, and Enter jumps to the section. There's no custom key handling, so it behaves like any table of contents.
Related
- Chapter Outline FeaturesDocuments and objects
- Glossary Term Grid FeaturesDocuments and objects
- Alternating Stripe Sections FeaturesAlternating rows
- Timeline Evolution Story FeaturesTimelines and steps
- Sequential Milestone Checklist FeaturesTimelines and steps
- Agenda Hour Timeline FeaturesTimelines and steps