Overlays & feedback / Progress bars
Vertical Scroll Indicator
Thin vertical track at the right viewport edge with a short black rounded thumb marking scroll position.
Rebuilt from lusion.co in the Periwinkle Studio Float style.
npx shadcn@latest add https://justyoink.it/r/periwinkle-studio-float/blocks/scroll-progress-indicator.json
Looks exactly like lusion.co: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/periwinkle-studio-float/mine/scroll-progress-indicator.json
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
Usage
Drop it anywhere; by default it is fixed at the right viewport edge and its thumb follows page scroll. Props: trackHeight, thumbHeight (px), label (aria), fixed (set false to place inline).
components/scroll-progress-indicator.tsx
import { useEffect, useState } from "react"; export default function VerticalScrollIndicator({ label = "Page scroll position", trackHeight = 180, thumbHeight = 36, fixed = true }: { label?: string; trackHeight?: number; thumbHeight?: number; fixed?: boolean }) { const [p, setP] = useState(0); useEffect(() => { const onScroll = () => { const max = document.documentElement.scrollHeight - window.innerHeight; setP(max > 0 ? Math.min(1, Math.max(0, window.scrollY / max)) : 0); }; onScroll(); window.addEventListener("scroll", onScroll, { passive: true }); window.addEventListener("resize", onScroll); return () => { window.removeEventListener("scroll", onScroll); window.removeEventListener("resize", onScroll); }; }, []); const travel = trackHeight - thumbHeight; return ( <div role="progressbar" aria-label={label} aria-valuemin={0} aria-valuemax={100} aria-valuenow={Math.round(p * 100)} className={(fixed ? "fixed right-1 top-1/2 -translate-y-1/2 z-50 " : "relative ") + "w-[6px] rounded-pill bg-ink/10 pointer-events-none"} style={{ height: trackHeight }} > <div className="absolute left-0 w-full rounded-pill bg-ink will-change-transform" style={{ height: thumbHeight, transform: `translateY(${p * travel}px)` }} /> </div> ); }import { useEffect, useState } from "react"; export default function VerticalScrollIndicator({ label = "Page scroll position", trackHeight = 180, thumbHeight = 36, fixed = true }: { label?: string; trackHeight?: number; thumbHeight?: number; fixed?: boolean }) { const [p, setP] = useState(0); useEffect(() => { const onScroll = () => { const max = document.documentElement.scrollHeight - window.innerHeight; setP(max > 0 ? Math.min(1, Math.max(0, window.scrollY / max)) : 0); }; onScroll(); window.addEventListener("scroll", onScroll, { passive: true }); window.addEventListener("resize", onScroll); return () => { window.removeEventListener("scroll", onScroll); window.removeEventListener("resize", onScroll); }; }, []); const travel = trackHeight - thumbHeight; return ( <div role="progressbar" aria-label={label} aria-valuemin={0} aria-valuemax={100} aria-valuenow={Math.round(p * 100)} className={(fixed ? "fixed right-1 top-1/2 -translate-y-1/2 z-50 " : "relative ") + "w-[6px] rounded-full bg-foreground/10 pointer-events-none"} style={{ height: trackHeight }} > <div className="absolute left-0 w-full rounded-full bg-foreground will-change-transform" style={{ height: thumbHeight, transform: `translateY(${p * travel}px)` }} /> </div> ); }
Quality checks
Automated, in a real browser · today- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: passedUses design tokens rather than hard-coded colours, so it follows your theme cleanly.
- Animates cleanly: doesn't applyDoesn't animate, so there's nothing to check.