shadcn.io is not affiliated with official shadcn/ui
Fireworks sends rockets up from the bottom of the box. Each one slows as it climbs and bursts, anywhere from high in the sky to low over the ground, into a spray of sparks that spread out, slow down, droop under gravity and fade, each drawing a continuous streak behind it. A faint glow lies along the ground, so the frame stays balanced between bursts. A new rocket goes up every 600 milliseconds or so, and a click on empty space launches one toward the pointer.
Use it for launches, milestones and celebration pages. For paper drifting down instead, use Confetti; for what's left long after a star explodes, Supernova; for points that twinkle without any physics, Sparkles. It's a small canvas simulation with drag and gravity; each frame strokes every spark's streak from where it was, batched into one path per color and brightness, the trails come from fading the previous frames, and it stops when it scrolls out of view.
Installation
Usage
import { Fireworks } from "@/components/ui/fireworks";<Fireworks className="min-h-[480px]">
<h1 className="text-5xl font-semibold">Ship faster</h1>
</Fireworks>Fireworks is a container: give it a size, put your content inside, and the show runs behind it. The canvas is transparent, so it sits on whatever background you give the container. It follows your theme: deep colors painted on a light page, so the sparks read on paper, and bright light added on a dark one, where crossing sparks glow brighter. For a background behind the whole page, pass className="fixed inset-0 -z-10" and no children.
Demos
Night sky
On a bg-slate-950 section with interval={400}, rockets go up more often. The section adds the dark class, so it gets the bright night palette on a light page too. Click the sky to launch your own; at most three bursts go off a second, clicks included.
Colors
colors takes up to six CSS colors, and each burst picks one; here two golds. interactive={false} turns off click-to-launch, so the card stays a plain card.
Accessibility
The show is decoration: it's hidden from assistive tech and never takes focus. Clicks on your links, buttons and form fields are left alone; only a click on empty space launches a rocket. At most three bursts go off a second, however often rockets are launched or clicked, and no burst covers much of the screen. With reduced motion nothing launches and nothing moves: three bursts stay as a still picture, and clicks do nothing. Sparks are thin and pass quickly, so copy in text-foreground (or a light color on a dark background) stays readable over them; it keeps above 4.5:1 in both color schemes.
FAQ
How do the sparks move?
Each burst throws count sparks (80 by default) in random directions at random speeds. Drag slows them, gravity pulls them down into drooping curves, and each fades out over one to two seconds. Rockets are launched just fast enough to stop at their target height, and burst there.
Can visitors launch their own?
Yes. A click on empty space launches a rocket from below toward the pointer; clicks on links, buttons and form fields are left alone. It's on by default, as on shadcn.io; interactive={false} turns it off.
How do I change how often they launch?
interval is the mean time between automatic launches in milliseconds (600 by default; each wait is between half and one and a half times it). 0 launches only on click. Whatever the interval, no more than three bursts go off a second.
Can I use my brand colors?
Pass colors, up to six CSS colors, or set --fireworks-color-1 to --fireworks-color-6 on the component. The defaults are six party colors in two tunings: deeper on a light page, brighter on a dark one.
API Reference
Fireworks
<div> data-slot="fireworks"
colors?string[]
Up to six CSS colors; each burst picks one. By default six party colors, deeper on a light page so the sparks read on paper.
count?number
Sparks per burst, at most 300. @default 80.
- Default
80
interactive?boolean
Whether a click on empty space (not on a link or a button) launches a rocket toward it. @default true.
- Default
true
interval?number
The mean time between automatic launches, in milliseconds; 0 launches only on click. @default 600.
- Default
600
speed?number
Multiplies the speed of the rockets and sparks. @default 1.
- 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.
--fireworks-color-1string
The first burst color (red); -2 to -6: gold, green, blue, magenta, cyan.
Related
- Pro


Confetti Background
ParticlesCelebration bursts of paper
- Pro


Supernova Background
SpaceThe glowing remnant long after the explosion
- Pro


Sparkles Background
ParticlesTwinkling points without the physics
- Pro


Meteors Background
SpaceStreaks with tapered tails
- Pro


Light that bursts on impact


Particles
ParticlesA canvas particle field with pointer interaction