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

Version Scrubber

Step through prepared versions of a design with one slider. Free, MIT · Content and social › 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
  • Article Header — Article header: section, headline, lede, authors and date
  • Byline — Byline: authors, published and updated dates, reading time
  • Article Figure — Image with caption and photo credit
  • Pull Quote — Pull quote with attribution
  • Key Points — “Key points” summary block
  • Editor Note — Update, correction, disclosure and sponsored-content notes
  • Article Toc — Article table of contents that tracks the current section

Previous: Detail Dial · Next: Page Minimap · All Content and social