Component Layers, animated React component
- Pro
- 3D Components
- 3D
- Spring
- Hover
A finished music player card tips into an isometric view and peels apart into its surface, spacing, layout and content layers, each with a leader-line label.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| accent | string | "#0071e3" | Used in the cover art and for the hovered layer's outline and leader line. |
| autoplay | boolean | false | Explodes and assembles on a loop until someone uses the toggle. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry with your API key
Component Layers is a Pro item, so the CLI has to send your API key. Do this once per project:
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
nxs_and is shown only once. - In your project root, next to
package.json, create a file named.env.localwith this line, using your own key:NEXUS_API_KEY=nxs_your_key_here
- Open
components.jsonand add this entry inside the outermost braces, next to"aliases". Leave{name}and${NEXUS_API_KEY}exactly as written; the CLI fills them in:"registries": { "@nexus-labs": { "url": "https://www.nexus-ui.com/api/registry/{name}", "headers": { "Authorization": "Bearer ${NEXUS_API_KEY}" } } }
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
How Component Layers works
A finished card tips into an isometric view and peels apart into the layers it is made of, each with a leader-line label. Assemble stacks it back.
The source, the install command and the build prompt come with Pro.
Component Layers questions
How do I install Component Layers?
Run `npx shadcn@latest add @nexus-labs/component-layers`. It installs framer-motion. Component Layers is a Pro component, so it needs a Pro plan and an API key; key setup is on the CLI docs page (/docs/cli).
Can I explode my own component instead of the music player?
There is no `children` or layers prop. The four layers (Surface, Spacing, Layout, Content) come from the exported `COMPONENT_LAYERS` array in the file, so edit its names, notes and `render` functions, and the Player function, to show your own card.
Which props can I set?
Only two. `accent` (default "#0071e3") colors the cover art and the hovered layer's outline and leader line. `autoplay` (off by default) explodes and reassembles the card on a loop until someone uses the toggle.
How do I switch views, and what does hovering do?
The Assemble and Explode buttons switch views and report their state with `aria-pressed`. Hovering a layer in the exploded view outlines it and colors its leader line with `accent`.
Does it use WebGL or three.js?
No. It is CSS 3D transforms driven by Framer Motion: the card is tilted with `rotateX` and `rotateZ` under a 1400 px perspective, and each layer is pushed out along z with a spring.

