Skip to content
VenusUI
Get started

Cassette Player

A cassette tape whose reels turn and wind the tape from one side to the other as it plays.

Preview

Installation

npx shadcn@latest add @venusui/cassette-player

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/cassette-player.tsx

Usage

The code behind the preview above.

cassette-player-demo.tsx

import { CassettePlayer } from "@/components/ui/cassette-player"

// The track and artist are made up.
export default function CassettePlayerDemo() {
  return <CassettePlayer className="w-[min(26rem,calc(100vw-3rem))]" title="Summer ’98 mixtape" artist="for Sam, from Jo" duration={214} />
}

API reference

PropTypeDefaultDescription
title, artiststring—Handwritten on the label and shown under the tape.
durationnumber214Track length in seconds; the tape winds across it.
sidestring"A"Printed on the label.
accentstringoklch(0.72 0.17 35)Label stripe color: any CSS color.
playing, defaultPlayingboolean—Controlled or initial playing state.
onPlayingChange(playing: boolean) => void—Called on play, pause and when the track ends.

All <div> props.

Requirements

  • lucide-react for the controls. React 19 and Tailwind CSS v4.

Customization

  • It plays no audio: connect onPlayingChange to your own <audio> element.

Accessibility

  • Play, pause and rewind are labelled buttons; the time is shown as text.
  • With reduced motion the reels don't spin (the tape still winds).

Troubleshooting

The label text is tiny or huge.
The label scales with the cassette's width; set a width on it (e.g. w-96).
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A card that tilts in 3D toward the pointer with spring physics.

Loading preview

Camera Shutter

Interactive

A lens with a working iris: blades close to the chosen aperture and snap shut when you release the shutter.

Loading preview

Stacked cards with the next ones peeking out; Next sends the top card to the back.