Phosphor Sweep Background

Phosphor Sweep Background

Rotating beam sweeps a dot grid, leaving dots to fade with phosphor-persistence decay.

Installation

▸ Run the following command

npx shadcn@latest add https://www.mellowui.com/r/phosphor-sweep.json

▸ Or install manually

  1. Copy the source from the Code tab above.
  2. Place it at components/mellow/phosphor-sweep.tsx
  3. Import and use.

API Reference

PropTypeDefaultDescription
dotColorstring"rgba(var(--ink-rgb),0.07)"Base color of unlit dots.
dotSizenumber1.5Radius of each dot in pixels.
spacingnumber28Gap between dots in pixels.
speednumber0.12Beam rotations per second.
decaynumber2.5Phosphor fade duration in seconds.
classNamestringAdditional CSS classes.
childrenReact.ReactNodeContent rendered above the canvas.