Confetti
Dependency-free confetti burst, fired from anywhere.
- 1.6 KB gzipped
- Zero dependencies
- Reduced-motion safe
- Base UI & Radix compatible
Preview
Installation
pnpm dlx shadcn@latest add https://paulkeys.org/r/confetti.jsonAdds components/velora/confetti.tsx.
Props
| Prop | Type | Default |
|---|---|---|
celebrate | boolean | true |
children* | React.ReactNode | — |
Also accepts every <button> attribute, forwarded to the root element.
Accessibility
- Reduced motion
- confettiBurst does nothing, so clicking shows no burst; the button's own onClick still runs.
- Keyboard
- Native <button>: reachable with Tab, Enter or Space fires it (the burst starts from the button's centre), and focus-visible shows a 2px outline in the ring colour.
- Screen readers
- Named by its children; the temporary burst canvas is decorative and not exposed.