❤️ Support our project - Your donation helps us continue developing awesome tools!


Docs
Confetti

Confetti

Confetti animations are best used to delight your users when something special happens

Confetti

Installation

npx nyxb@latest add confetti

Examples

Basic

Random Direction

Fireworks

Side Cannons

Stars

Custom Shapes

Emoji

Props

Confetti

PropTypeDescriptionDefault
particleCountIntegerThe number of confetti particles to launch50
angleNumberThe angle in degrees at which to launch confetti90
spreadNumberThe spread in degrees of the confetti45
startVelocityNumberThe initial velocity of the confetti45
decayNumberThe rate at which confetti slows down0.9
gravityNumberThe gravity applied to confetti particles1
driftNumberThe horizontal drift applied to particles0
flatBooleanWhether confetti particles are flatfalse
ticksNumberThe number of frames confetti lasts200
originObjectThe origin point of the confetti{ x: 0.5, y: 0.5 }
colorsArray of StringsArray of color strings in HEX format['#26ccff', '#a25afd', '#ff5e7e', '#88ff5a', '#fcff42', '#ffa62d', '#ff36ff']
shapesArray of StringsArray of shapes for the confetti['square', 'circle']
zIndexIntegerThe z-index of the confetti100
disableForReducedMotionBooleanDisables confetti for users who prefer no motionfalse
useWorkerBooleanUse Web Worker for better performancetrue
resizeBooleanWhether to resize the canvastrue
canvasHTMLCanvasElement or nullCustom canvas element to draw confettinull
scalarNumberScaling factor for confetti size1

ConfettiButton

PropTypeDescriptionDefault
optionsObjectOptions for the confetti
childrenReact.ReactNodeChildren to render inside the buttonnull

Credits