Confetti
Confetti exposes an imperative fire method and a manualstart option.
Practical React example
Celebrate an operation only after the application confirms it succeeded.
Before you copy and paste
Match the imported component’s client or server rendering boundary before using the example. Copy components/magicui/confetti.tsx and its returned support files from the Code tab; preserve the project-relative paths. Install the listed primitives: pnpm dlx shadcn@latest add button.
Listed package dependencies: @types/canvas-confetti, canvas-confetti.
Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.
Celebrate an operation only after the application confirms it succeeded
// Usage adapted from Magic UI's pinned MIT source.
// Copyright (c) Magic UI. See ./LICENSES.md.
'use client';
import { useRef } from "react"
import { Confetti, type ConfettiRef } from "@/components/magicui/confetti"
export function ConfettiDemo() {
const confettiRef = useRef<ConfettiRef>(null)
return (
<div>
<Confetti ref={confettiRef} manualstart />
<button onClick={() => confettiRef.current?.fire()}>
Trigger Confetti
</button>
</div>
)
}
Usage example adapted from Magic UI's pinned MIT source. Retain the source licence notices when copying.
Use manualstart and trigger fire from the confirmed operation result, not from a speculative click. Keep the canvas layer clear of interactive controls.
Customization
- manualstart / ref
- manualstart prevents the automatic mount burst. A ConfettiRef exposes fire(options) for an intentional event-triggered burst.
- options / globalOptions
- Use the canvas-confetti option shapes supported by the installed version. Keep canvas positioning and cleanup aligned with the page layout.
Integration notes
- Respect reduced motion and avoid repeatedly firing the effect on rerenders.
- The animation does not prove an account, payment or save operation succeeded.
Component source: Magic UI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.
Give your agent taste.
The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.
All components are free. Sign up only to connect MCP.