Exploded Layers
Prepared image layers pulled apart with captions. Free, MIT · Interactive blocks › Interactive explainers
Installation
npx valyro-cli@latest add exploded-layers
npx shadcn@latest add https://valyro.xyz/r/exploded-layers.json
npm install valyro-ui
import 'valyro-ui/styles.css';
import { ExplodedLayers } from 'valyro-ui';
Props
| Prop | Type | Default | |
|---|---|---|---|
layers * | ExplodedLayer[] | Layers from bottom to top. Every image shares the canvas, so they line up when assembled. | |
canvasSize * | { width: number; height: number } | Size of the common canvas of the sources; it reserves the scene's space before the images load. | |
separation | number | How far the stack is opened, 0 (assembled) … 1. | |
defaultSeparation | number | 0 | Initial separation when uncontrolled. |
onSeparationChange | (value: number) => void | Called with the new separation when it changes. | |
selectedId | string | null | Id of the selected layer, or null. | |
defaultSelectedId | string | null | null | Initial selectedId when uncontrolled. |
onSelectedIdChange | (id: string | null) => void | Called with the new selectedId when it changes. | |
angle | LayerAngle | DEFAULT_ANGLE | Tilt of the opened scene in degrees: x tips it back, y turns it. Default { x: 55, y: -30 }. |
labels | Partial<ExplodedLayersLabels> | 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
- 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
- Version Scrubber — Step through prepared versions of a design with one slider
- 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: Feature Hotspots · Next: Prediction Card · All Interactive blocks