Celebrate button
ProA button that bursts confetti from its own edges on success while the label morphs to done.
Live · keyboard ready
- Completing a milestone: publish, launch, finish setup, send the first invoice.
- Onboarding steps where a small reward encourages the next one.
- Marketing demos where the moment of success is the story.
- Use button with a loading state for routine saves and form submits.
- Use hold-to-confirm for destructive actions.
- Avoid it in dense toolbars and tables.
Installation
Pro source and install commands unlock with a Pro plan.
example.tsx
import { CelebrateButton } from "@/components/arc/celebrate-button/celebrate-button"; export function PublishAction() { return ( <CelebrateButton onAction={() => publishSite()} pendingLabel="Publishing" successLabel="Published"> Publish site </CelebrateButton> );}CelebrateButton
A button that bursts confetti from its own edges when its action succeeds, while the label morphs to a done state and the width springs to fit.
PropTypeDefaultDescription
childrenRequiredReactNode–The resting label.onAction() => void | Promise<unknown>–Runs on press. A promise shows the pending state; a rejection shows the error label without a burst.status"idle" | "pending" | "success" | "error"–Controlled status. Moving to success plays the burst.onStatusChange(status: CelebrateStatus) => void–Called on every status change, including the reset to idle.successLabelReactNode"Done"Label after success, shown with a check.pendingLabelReactNode–Label while the action runs, shown with a spinner. Defaults to the resting label.errorLabelReactNode"Try again"Label after a failure.resetAfternumber2400Milliseconds before returning to rest. 0 stays done.cooldownnumber1200Shortest time in ms between two bursts.colorsstring[]–Confetti colours. Defaults to the accent in three tones, a sunny yellow, and a little ink, resolved from the theme at burst time.particlesnumber44Pieces per burst.classNamestring–Extra class on the wrapper....restButtonHTMLAttributes–Other button attributes, such as disabled, name, or aria attributes.- EnterorSpace
- Runs the action. Presses during pending or done are ignored.
- It is a native button; aria-busy is set while pending.
- A polite live region announces the success or error label.
- The confetti canvas is aria-hidden and ignores the pointer.
- Success is shown by a check and a label, never by colour or confetti alone.
- Confetti leaves from points on the button's rounded outline, moving outward and up, then falls under light gravity with air drag and a sideways flutter.
- Ribbons and squares tumble by squashing one axis with the flip angle; circles stay round; every piece fades before it lands.
- The button kicks to 1.07 as the burst leaves, the label rises out of a blur, and the width springs to the new label.
- Bursts are rate limited by cooldown and capped at 180 live pieces.
- Reduced motion skips the particles and kick and crossfades the label to the check.
- The button fills with the accent, and the confetti is mostly the accent in three tones with a supporting yellow and a little ink, so it follows the accent and theme settings.
- The confetti canvas reaches 150px beside and 190px above the button; leave room or let it overflow the container.
- Touch presses get the same press scale and burst as a mouse.
- Particles run on one canvas that only exists during a burst and stops when the last piece fades.
- The canvas is capped at 2x device pixel ratio.
Notes for AI
Give your coding assistant the Markdown reference instead of screenshots.
- Save it for moments worth celebrating: publishing, finishing onboarding, a first payment. Everyday saves should use a plain button.
- Return the real promise from onAction so the pending and error states are honest.
- Use the controlled status when the action is triggered elsewhere, such as a form submit.
- Keep one celebrate button per view so the burst stays special.
The full library index for assistants is at /llms.txt.