Phosphor Score
CRT-style sheet music that scrolls down a grand staff and glows at the playhead.
Preview
Installation
pnpm dlx shadcn@latest add @23rd/phosphor-scoreOr from the public GitHub registry:
pnpm dlx shadcn@latest add radiumcoders/23rd.dev/phosphor-scoreUsage
Give the parent a size; the transparent canvas fills it.
"use client"
import { PhosphorScore } from "@/components/ui/phosphor-score"
export function HeroScore() {
return (
<div className="relative h-svh w-full bg-background">
<PhosphorScore />
</div>
)
}Lock a theme or set the glow:
<PhosphorScore theme="light" glow={50} />
<PhosphorScore theme="dark" color="#4DFF6A" glow={50} />Tilt the plane in perspective, like CSS rotations:
<PhosphorScore rotateX={50} />
<PhosphorScore rotateX={35} rotateY={-20} rotateZ={8} />Props
| Prop | Type | Default |
|---|---|---|
color | string | theme phosphor / forest ink |
glow | number | 50, 0–100 |
speed | number | 1.35, beats per second |
density | number | 1, 0.35–1.85 |
sway | boolean | true, slow camera drift |
seed | number | 23, new seed crossfades |
rotateX | number | 0, degrees, -70–70 |
rotateY | number | 0, degrees, -70–70 |
rotateZ | number | 0, degrees |
theme | "light" | "dark" | "auto" | "auto" |
className | string | React only |
class | string | Svelte only |
