BT-01Buttons
Particle Button
A status button for async actions, with a spinner, a drawn check and a particle burst on success.
PROPay Button and more like it are in Kokonut UI Pro
Installation
Particle Button is a free, open-source React component in the Kokonut UI Buttons collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/particle-button.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/particle-buttonOr add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/particle-button.tsx.
npm install class-variance-authority lucide-react motionUsage
import ParticleButton from "@/components/kokonutui/particle-button";
export default function Example() {
return <ParticleButton />;
}Props
childrenReactNodeDefault "Save changes"onClick(event: MouseEvent<HTMLButtonElement>) => unknownReturn a promise to show the pending state until it settles. A rejected promise shows the error state. A plain click goes straight to success.
onSuccess() => voidCalled when the action succeeds, alongside the burst.
onError(error: unknown) => voidCalled with the rejection reason when the action fails.
statusParticleButtonStatusControlled status. Without it the button tracks onClick itself.
successDurationnumberDefault 1600How long (ms) the success state shows before going back to idle.
errorDurationnumberDefault 3200How long (ms) the error state shows. Longer than success, so it can be read.
pendingLabelReactNodeDefault "Saving"successLabelReactNodeDefault "Saved"errorLabelReactNodeDefault "Try again"iconReactNodeIcon rendered after the idle label.
particlesbooleanDefault trueFire the particle burst on success.
Also takes every prop of Omit< ComponentProps<"button">, // Motion owns the drag and animation handlers on a motion.button. | "onClick" | "children" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" > and VariantProps<typeof buttonVariants>.
ParticleButtonStatus
type ParticleButtonStatus = "idle" | "pending" | "success" | "error";Dependencies
| Needs | Version | Comes from |
|---|---|---|
class-variance-authority | ^0.7.1 | npm, installed by the CLI |
lucide-react | ^0.556.0 | npm, installed by the CLI |
motion | ^12.23.25 | npm, installed by the CLI |
button | shadcn/ui, added by the CLI | |
cn from lib/utils.ts | shadcn init | |
| React | 19 | Your app |
| Tailwind CSS | 4 | Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.
Button Components
Free animated React buttons: hold to confirm, slide to confirm, magnet, particle, undo and save buttons with real feedback, built with Tailwind CSS and Motion.
V0 Button
Open in v0 button that sends a component registry JSON to v0.dev for instant editing, built with React, the shadcn Button, and Tailwind CSS.

