Version Scrubber
Step through prepared versions of a design with one slider. Free, MIT · Interactive blocks › Interactive explainers
One slider through prepared versions of a design, an illustration or a product: the image of each step, its title, date and what changed. Selection is by id; images fit the reserved area without jumps, only the neighbours preload, and a late load of a previous image never replaces the current one.
Installation
npx valyro-cli@latest add version-scrubber
npx shadcn@latest add https://valyro.xyz/r/version-scrubber.json
npm install valyro-ui
import 'valyro-ui/styles.css';
import { VersionScrubber } from 'valyro-ui';
Props
| Prop | Type | Default | |
|---|---|---|---|
snapshots * | VersionSnapshot[] | Prepared snapshots, in order. | |
value | string | Id of the shown snapshot. A controlled id missing from snapshots shows an error until a valid one comes. | |
defaultValue | string | Initial snapshot when uncontrolled. Default: the first. If it disappears, the first remaining one is shown. | |
onValueChange | (id: string) => void | Called with the new value when it changes. | |
onValueCommit | (id: string) => void | Called when a choice is settled: the slider released, a key, a button or a thumbnail. Not on every pixel. | |
renderSnapshot | (snapshot: VersionSnapshot) => ReactNode | Draws a snapshot instead of its image; it handles its own loading and errors. | |
aspectRatio | number | 16 / 9 | Width / height of the viewer, reserved before images load. Default 16 / 9. |
showThumbnails | boolean | true | A thumbnail row when there are at most 8 snapshots. Default true. |
labels | Partial<VersionScrubberLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Related components
- Feature Hotspots — Numbered points on an image that open a note about each detail
- Exploded Layers — Prepared image layers pulled apart with captions
- Prediction Card — The reader guesses first, then sees the answer and the explanation
- Detail Dial — Choose how deep an explanation goes: short, detailed or full
- Page Minimap — Schematic map of a long page with the visible area
- Peel Sticker — A sticker you peel back by its corner to reveal what is under it
- Scratch Reveal — Scratch off a cover to reveal text or a picture
- Tear-off Ticket — A ticket whose stub tears off along the perforation
- Split-Flap Board — Mechanical departure board: only the changed characters flip
- Swipe Action Card — Swipe a card sideways to reveal its actions
- Sticker Board — A free composition of photos, stickers and notes to move and rotate
- Lasso Select — Drag a rectangle to select a group of cards
Previous: Detail Dial · Next: Page Minimap · All Interactive blocks