Confetti
A fun confetti animation component with multiple presets for celebrations.
Installation
npm install fuyukaki-uiUsage
import { useConfetti } from 'fuyukaki-ui'
function App() {
const { fire } = useConfetti()
return (
<button onClick={() => fire()}>
Celebrate!
</button>
)
}Presets
Custom Options
// Custom confetti options
fire({
particleCount: 100,
spread: 180,
colors: ['#ff0000', '#00ff00', '#0000ff'],
})Props
| Option | Type | Default |
|---|---|---|
| preset | 'basic' | 'fireworks' | 'snow' | 'burst' | - |
| particleCount | number | 50 |
| spread | number | 70 |
| colors | string[] | fuyukaki colors |
| origin | { x: number, y: number } | { x: 0.5, y: 0.6 } |
| onComplete | () => void | - |
