Confetti
Deterministic confetti burst for Remotion — seeded particles with gravity, spin, and flutter
$ pnpm dlx shadcn@latest add @remocn/confettiUsage
Confetti is an overlay — render it on top of any scene and set startFrame to the frame the burst should fire:
// src/Root.tsx
import { Composition } from "remotion";
import { Confetti } from "@/components/remocn/confetti";
const ConfettiScene = () => (
<Confetti
startFrame={0}
originX={0.5}
originY={0.5}
particleCount={160}
seed={1}
/>
);
export const RemotionRoot = () => (
<Composition
id="Confetti"
component={ConfettiScene}
durationInFrames={90}
fps={30}
width={1280}
height={720}
/>
);Every piece is generated from a seeded PRNG, so a given seed renders an identical burst on every machine — required for deterministic Remotion output and headless MP4 export. Particles launch radially from the origin, fall under gravity, and flutter as they spin.
Props10
| Prop | Type | Default |
|---|---|---|
| particleCount | number140 Number of confetti pieces | |
| colors | string[]6 brand colors Palette each piece is drawn from | |
| originX | number0.5 Burst origin X as a 0..1 fraction of the canvas | |
| originY | number0.5 Burst origin Y as a 0..1 fraction of the canvas | |
| startFrame | number0 Frame the burst fires on | |
| lifetime | number90 How long the burst lives, in frames | |
| power | number17 Initial launch speed (px/frame at the 720px reference height) | |
| gravity | number0.45 Downward acceleration (px/frame² at the 720px reference height) | |
| size | number13 Base piece size in reference px | |
| seed | number1 PRNG seed — the same seed renders an identical burst every time | |
- particleCountnumber
Number of confetti pieces
Default
140 - colorsstring[]
Palette each piece is drawn from
Default
6 brand colors - originXnumber
Burst origin X as a 0..1 fraction of the canvas
Default
0.5 - originYnumber
Burst origin Y as a 0..1 fraction of the canvas
Default
0.5 - startFramenumber
Frame the burst fires on
Default
0 - lifetimenumber
How long the burst lives, in frames
Default
90 - powernumber
Initial launch speed (px/frame at the 720px reference height)
Default
17 - gravitynumber
Downward acceleration (px/frame² at the 720px reference height)
Default
0.45 - sizenumber
Base piece size in reference px
Default
13 - seednumber
PRNG seed — the same seed renders an identical burst every time
Default
1
Notes
- Deterministic: Particles come from a
mulberry32seeded PRNG, neverMath.random(), so renders are frame-stable and reproducible. - Overlay: The component is a transparent,
pointer-events: noneAbsoluteFill— layer it over any composition. - Used by:
x-followers-overviewfires this on the follower-count reveal.