Valyro Русская версия

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

PropTypeDefault
snapshots *VersionSnapshot[]Prepared snapshots, in order.
valuestringId of the shown snapshot. A controlled id missing from snapshots shows an error until a valid one comes.
defaultValuestringInitial snapshot when uncontrolled. Default: the first. If it disappears, the first remaining one is shown.
onValueChange(id: string) => voidCalled with the new value when it changes.
onValueCommit(id: string) => voidCalled when a choice is settled: the slider released, a key, a button or a thumbnail. Not on every pixel.
renderSnapshot(snapshot: VersionSnapshot) => ReactNodeDraws a snapshot instead of its image; it handles its own loading and errors.
aspectRationumber16 / 9Width / height of the viewer, reserved before images load. Default 16 / 9.
showThumbnailsbooleantrueA thumbnail row when there are at most 8 snapshots. Default true.
labelsPartial<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