Tape Shelf, animated React component
- Pro
- 3D Components
- Hover
- 3D
- Spring
Cassette cases stand spine-out on a tilted 3D shelf. Hovering slides one up; picking one swings it round to show its cover with the reels turning, while the rest of the shelf steps aside and dims.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| tapes | ShelfTape[] | DEFAULT_TAPES | Cases on the shelf, left to right: title, artist, color (spine and label) and ink (text colour on them). |
| onPick | (index: number | null) => void | — | Called with the picked index when someone picks a tape, or null when it goes back. |
| size | number | 1 | Size of the cases, 0.8 to 1.3. The shelf gets taller with it. |
| spacing | number | 6 | Space between the cases in pixels, 0 to 20. |
| tilt | number | 1 | How far the shelf is turned away from you, 0 to 1.6. 0 shows the spines straight on. |
| lift | number | 1 | How far a hovered case slides up, 0 to 2. |
| snap | number | 1 | How quickly the cases spring into place, 0.5 to 2.5. Lower is slow and soft, higher is snappy. |
| autoplay | boolean | false | Pulls out the 3rd, 6th and 1st tapes in turn, putting each back, every 1.8s until someone touches the shelf. |
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
Tape Shelf 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 Tape Shelf works
swings out to show its cover with the reels turning, while the shelf behind steps back.
The source, the install command and the build prompt come with Pro.
Tape Shelf questions
How do I install Tape Shelf?
Run `npx shadcn@latest add @nexus-labs/tape-shelf`. It installs framer-motion; the 3D shelf is made with CSS transforms and the reels are small SVGs. It is a Pro component, so it needs a Pro plan and an API key; key setup is on the CLI docs page (/docs/cli).
How do I show my own tapes and react to a pick?
Pass `tapes` as `{ title, artist, color, ink }` objects, where `color` is the spine and label colour and `ink` is the text colour on them. `onPick` is called with the tape index when someone picks one and with `null` when it goes back.
Which props change the shelf?
`size` scales the cases (default 1, range 0.8 to 1.3), `spacing` is the gap in px (default 6), `tilt` is how far the shelf turns away (default 1, 0 shows the spines straight on), `lift` is how far a hovered case rises (default 1) and `snap` is the spring speed (default 1). `autoplay` pulls out the 3rd, 6th and 1st tapes in turn every 1.8 seconds until someone touches the shelf.
Can I use it with a keyboard, and what happens with reduced motion?
Each case is a button with `aria-pressed` and a label like "Title by Artist", focusing one lifts it, Enter or Space picks it and Escape puts the picked tape back. With reduced motion on, the reels stop turning; the swing and spring movements still play.

