Confetti
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/button-confettiAbout this component
On click, 22 grayscale rectangular particles are spawned from the click point inside a relatively-positioned wrapper. Each particle flies outward in an evenly distributed radial spread with slight randomness, rotating and fading over 500–900ms via CSS custom properties (--tx, --ty, --rot, --dur) and a single @keyframes rule. Particles are removed from the DOM after animation. No dependencies.
Triggers
- Click
Techniques
- Keyframes
- CSS variables
Difficulty
Intermediate
Accessibility
Reduced motion
Particles set to opacity 0 immediately under prefers-reduced-motion.
Use it in anything you build, commercial and client work included. Licence