Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

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

PropTypeDefaultWhat it does
tapesDEFAULT_TAPESCases on the shelf, left to right: title, artist, color (spine and label) and ink (text colour on them).
onPick—Called with the picked index when someone picks a tape, or null when it goes back.
size1Size of the cases, 0.8 to 1.3. The shelf gets taller with it.
spacing6Space between the cases in pixels, 0 to 20.
tilt1How far the shelf is turned away from you, 0 to 1.6. 0 shows the spines straight on.
lift1How far a hovered case slides up, 0 to 2.
snap1How quickly the cases spring into place, 0.5 to 2.5. Lower is slow and soft, higher is snappy.
autoplayfalsePulls 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. 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 creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 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:

    1. Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with nxs_ and is shown only once.
    2. In your project root, next to package.json, create a file named .env.local with this line, using your own key:
      NEXUS_API_KEY=nxs_your_key_here
    3. Open components.json and 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}"
          }
        }
      }

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.