Skip to content
synccn

Confetti

Canvas confetti burst with no dependencies.

Bursts from the button. Off when reduced motion is on.

Installation

$ pnpm dlx shadcn@latest add @synccn/confetti

First time in this project? Connect synccn with one command.

Usage

import { confetti } from "@/components/ui/confetti";confetti({ x: 0.5, y: 0.6 })

API reference

Generated from the component's TypeScript types, so it always matches the code.

  • x
    number

    Default 0.5

    Origin across the viewport, 0–1.

  • y
    number

    Default 0.6

    Origin down the viewport, 0–1.

  • count
    number

    Default 120

    Number of pieces.

  • spread
    number

    Default 70

    Spread angle in degrees.

  • colors
    string[]

    Piece colours. Defaults to the theme primary plus a few brights.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

    npm packages

    Accessibility

    From the source

    Read from this component's code when the site builds, so it can't drift.

    • Respects the reduced motion setting