NK

Search

Search pages, posts, and components

All components

Fireworks

Background Effects

Auto-launching firework bursts painted on a canvas.

Installation

Add it with the shadcn CLI:

$pnpm dlx shadcn@latest add https://nawalkattel.com.np/r/fireworks.json
Or install manually
  1. 1. Install dependencies

    pnpm add clsx tailwind-merge
  2. 2. Copy the component source into components/library/fireworks.tsx

Props

PropTypeDefaultDescription
classNamestring - Classes applied to the canvas.

Accessibility

  • Decorative canvas with no semantic content, so nothing is missed.
  • Trail is drawn with a translucent fill rather than clearing each frame.
  • Cancels its animation frame and ResizeObserver on unmount.
  • Fixed dark background - the effect relies on additive-looking sparks.

Dependencies

clsxtailwind-merge