Componentticket-stub0.56 KB gzipZero dependencies
VinylRecord
Spinning vinyl with radial grooves, center label, a tonearm that slides in and a wobble on drop.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add vinyl-recordOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { VinylRecord } from "@/components/ui/vinyl-record"; <VinylRecord label="SIDE A" playing={playing} onToggle={() => setPlaying(p => !p)} />Source code
vinyl-record.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxvinyl-record.tsx42 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface VinylRecordProps extends Omit<React.HTMLAttributes<HTMLElement>, "onToggle"> { label?: React.ReactNode; playing?: boolean; onToggle?: () => void;} export function VinylRecord({ label, playing = false, onToggle, ...props }: VinylRecordProps) { return ( <div role={onToggle ? "button" : undefined} tabIndex={onToggle ? 0 : undefined} aria-pressed={onToggle ? playing : undefined} aria-label={onToggle ? (playing ? "Pause vinyl record" : "Play vinyl record") : undefined}Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { VinylRecord } from "@/components/ui/vinyl-record"; <VinylRecord />| Prop | Type | Description |
|---|---|---|
| label | React.ReactNode | Accessible label text rendered or attached to the control. |
| playing | boolean | Toggles playing. (Default: false) |
| onToggle | () => void | Callback invoked on toggle. |