Exploded Orbit
v1.0.0A pinned product section. Scroll, and your 3D model comes apart along its own axis like an exploded drawing, then its parts swing out to orbit the core, each with a label. Takes a .glb, a model built in three.js, or a stack of images. Lists the parts under reduced motion.
Installation
Run once in your project root to configure paths and dependencies:
npx vectorvesper initDownloads and registers the component in your project:
npx vectorvesper add exploded-orbitIf installing manually or managing your package lock:
npm install @vectorvesper/motion threeUsage
A product page that should show what a thing is made of: a lens, a watch, a speaker, a bottle. Load a .glb whose root holds one child per part, or build the model with three.js, and name the parts you want labelled.
Import
Usage
Do
- Keep the parts as separate children of the model's root; a model merged into one mesh has nothing to take apart.
- Give round products a little twist, so the parts unscrew as they come off.
- Pass progress when something other than the page scroll should drive it, such as a slider or a step in a story.
Don't
- Do not label every screw. Six to ten named parts read well; the rest still orbit, unlabelled.
WebGL — render it on the client only
On Next.js, load it with ssr: false from a Client Component, as below. Vite apps need nothing extra.
prefers-reduced-motion and provides a graceful fallback.Props
Your 3D model comes apart as the page scrolls. The parts slide off along one axis, then swing out and orbit the core, each with its label and a short note. Scroll back and it puts itself together again.
<ExplodedOrbit />
A section that pins while you scroll through it and takes the model apart. Without progress it is as tall as length.
| Prop | Type | Default | Description |
|---|---|---|---|
model | string | (() => THREE.Object3D | Promise<THREE.Object3D>) | — | A .glb or .gltf URL, or a function that builds the model with three.js. Each child of its root is a part. |
parts | ExplodedOrbitPart[] | — | Labels for the model's parts, matched by name. Parts left out still split and orbit, unlabelled. |
layers | ExplodedOrbitLayer[] | — | Images to take apart instead of a model, listed from the back to the front. |
core | string | null | the largest part | The part that stays in the middle while the rest orbit it. null sends every part into orbit. |
axis | "x" | "y" | "z" | the longest side | Which of the model's axes the parts come apart along, with its front facing the positive way. |
twist | number | 0 | Turns each part makes as it comes off, as if unscrewing. Suits round products. |
align | number | 0.5 | Where the whole product sits across the stage before it splits, 0 to 1. |
length | string | "400vh" | How far the section scrolls while pinned, as a CSS length. |
progress | number | — | Drives it yourself instead of the page scroll, from 0 assembled to 1 in orbit. The section is then one screen tall and never pins. |
theme | "light" | "dark" | "light" | The stage colour, and the label colours that read on it. |
children | React.ReactNode | — | Shown over the stage. Stage it with data-phase and --eo-progress on the root. |
fallback | React.ReactNode | a list of the labelled parts | Shown instead of the scene under reduced motion. |
onPhaseChange | (phase: "assembled" | "splitting" | "split" | "orbiting") => void | — | Called as the scroll moves it from one stage to the next. |
className | string | — | Classes for the section. |
style | React.CSSProperties | — | Inline styles for the section. |
<ExplodedOrbitPart />
typeOne labelled part.
| Prop | Type | Default | Description |
|---|---|---|---|
id* | string | — | The part's name in the model: its node name in a .glb, or name on an object you built. |
label* | string | — | The part's name on the page. |
note | string | — | A short line under the label. |
<ExplodedOrbitLayer />
typeOne image layer, when you take apart pictures instead of a model.
| Prop | Type | Default | Description |
|---|---|---|---|
src* | string | — | A transparent PNG, WebP or SVG. |
id | string | — | A name for the layer, so core can point at it. |
label | string | — | The layer's name on the page. |
note | string | — | A short line under the label. |