shadcn.io is not affiliated with official shadcn/ui
The room lit by a turning mirror ball: hundreds of soft coloured spots sweep across the section at three depths, the nearest largest and fastest, while faint beams fan down from the ball, half hidden at the top edge. Each depth is one layer, a seeded tile of spots slid sideways by exactly one tile, so the loop never jumps; the beams rock slowly about the ball. It all moves with CSS transforms that the browser composites without repainting, and there's no script.
Use it for parties, launches and countdowns. For light without the colour, use Spotlight; for twinkling points, Sparkles; for celebrations that burst, Fireworks or Confetti; for soft out-of-focus lights, Bokeh.
Installation
Usage
import { Disco } from "@/components/ui/disco";<Disco className="flex min-h-[32rem] items-center justify-center">
<h1 className="text-5xl font-semibold">Friday night, all night</h1>
</Disco>Disco is a container: whatever you put inside sits on top of the light, in normal flow. The spots cover the whole box at any size, a little brighter near the ball and dimmer toward the bottom corners. In dark mode the light adds up; in light mode it's quieter, with the colours deepened so they read on white. The surface is the root's own background, so className="bg-…" sets it. For a backdrop behind the whole page, render it empty with className="fixed inset-0 -z-10".
Demos
Ice palace
colors takes up to five CSS colours, repeated when there are fewer; the spots, the beams and the ball's glow all take them. Here whites and blues.
In a card
ball={false} keeps only the light the ball throws, and speed={0.6} turns it more slowly, for a calmer card.
Accessibility
The light is decoration: it's hidden from assistive tech and lets every click through to your content. Nothing flashes: the spots glide, they never blink, so it's safe for photosensitive visitors. With reduced motion the spots and the beams hold still, a still room.
Put copy over it in your foreground colour (text-foreground). The spots are small and spread out, so text keeps above 4.5:1 almost everywhere; for small text, a soft backdrop behind it (bg-background/70) keeps every letter clear as the spots pass.
FAQ
How is it built?
Each depth is one element: a tile of seeded spots (softened squares, like a facet's reflection) as a data-URI mask over bands of the palette, slid left by exactly one tile with translate. The beams are a conic gradient that rocks with rotate, and the ball is a still drawing. Three depths move at three paces, so the light has depth and never visibly repeats.
Can I change the palette?
Pass up to five colors, as any CSS colours; fewer are repeated. Each is also a CSS variable, --disco-color-1 to --disco-color-5.
Can I hide the ball?
Yes: ball={false} keeps only the spots and the beams, as if the ball hung just out of view.
Is it safe for photosensitive visitors?
Yes. Nothing flashes or blinks: the spots slide steadily and the beams rock slowly, and with reduced motion everything stops.
API Reference
Disco
<div> data-slot="disco"
ball?boolean
Whether the mirror ball shows, half hidden by the top edge, with the
beams coming from it; false keeps only the light it throws.
- Default
true
colors?string[]
Up to five CSS colors for the spots and the beams, repeated when there are fewer. By default pink, violet, blue, cyan and amber.
intensity?"subtle" | "medium" | "strong"
How strongly the light shows. @default "medium".
- Type
"subtle" | "medium" | "strong"- Default
"medium"
speed?number
How fast the ball turns, as a multiplier: 1 sweeps the nearest spots across a 1280px box in about 50 seconds.
- Default
1
render?ReactElement | ((props: object, state: object) => ReactElement)
Replace the host element or compose it with another component.
- Type
ReactElement | ((props: object, state: object) => ReactElement)
className?string
Merged with the part's classes.
--disco-color-1string
The first colour (pink); --disco-color-2 to -5 the others.
--disco-speedstring
How fast the ball turns, a multiplier (1).
Related
- Pro


Sparkles Background
ParticlesGolden points that twinkle in place
- Pro


Fireworks Background
ParticlesBursts for celebrations
- Pro


Confetti Background
ParticlesFalling paper for launches
- Pro


Bokeh Background
ParticlesSoft out-of-focus lights drifting
- Pro


Neon lines and pulses
- Pro


Spotlight Background
LightStage lights that sweep, without the colour