Confetti

A fun confetti animation component with multiple presets for celebrations.

Installation

npm install fuyukaki-ui

Usage

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

OptionTypeDefault
preset'basic' | 'fireworks' | 'snow' | 'burst'-
particleCountnumber50
spreadnumber70
colorsstring[]fuyukaki colors
origin{ x: number, y: number }{ x: 0.5, y: 0.6 }
onComplete() => void-