Exploded View

An isometric stack of slabs springs apart with leader lines and labels, holds, then clicks back together

Installation
$ pnpm dlx shadcn@latest add @remocn/exploded-view

Usage

ExplodedView draws a stack of square slabs in isometric projection, left of center. The slabs spring apart from the top down, each one leaving a beat after the one above it. A leader line then draws out from each slab to the right, and a numbered label slides in at its end. After a short hold the labels retract, the slabs spring shut, and the stack gives a small downward knock as it clicks together.

import { ExplodedView } from "@/components/remocn/exploded-view";
 
export const Stack = () => (
  <ExplodedView
    layers={3}
    labels={["Edge", "Runtime", "Database"]}
    highlight={2}
  />
);

layers is clamped to 2–6. labels are listed top slab first and numbered 01, 02 and so on; a slab with no label gets no leader line. highlight picks the slab painted in the highlight colors, counted from the top starting at 0; an index past the last slab highlights nothing. The labels use Inter with a system fallback.

Timing

At 30 fps and speed={1}, with 4 slabs:

FramesMotion
3–20Slabs spring apart from the top down, 1.5 frames apart, overshoot and settle
14–32Leader lines draw out, 2.5 frames apart per slab
19–35Labels slide in and fade up at the end of each line
33–38Lines and labels retract
38–46The slabs spring shut
43–50The stack knocks down and settles

All labels are on screen together for only a few frames before they retract at frame 33. If they need longer, slow the whole piece with speed={0.5}, which doubles every time in the table.

Props
PropTypeDefaultDescription
layers
number4Number of slabs, rounded and clamped to 2–6
labels
string[]["Interface", "Engine", "Storage", "Hardware"]One label per slab, top slab first; missing entries get no leader line
highlight
number1Index of the highlighted slab, counted from the top starting at 0
colors
Partial<ExplodedViewColors>{ background: "#111111", top: "#F4F4F4", left: "#A6A6A6", right: "#747474", highlightTop: "#E5322D", highlightLeft: "#B5231F", highlightRight: "#8A1A17", line: "#FFFFFF", label: "#FFFFFF" }Background, the three visible faces of a slab and of the highlighted slab, leader lines and labels; merged over the defaults. The flat color props below win over it
backgroundColor
string"#111111"Background; overrides colors.background
labelColor
string"#FFFFFF"Label text; overrides colors.label
speed
number1Playback multiplier