Skip to main content

Installation

npx shadcn@latest add @kokonutui/particle-button

Usage

import ParticleButton from "@/components/kokonutui/particle-button";

export default function Example() {
  return (
    <ParticleButton 
      successDuration={1000}
      onSuccess={() => console.log("Success!")}
    >
      Click me!
    </ParticleButton>
  );
}

Props

The ParticleButton component extends all standard HTML button props and includes:
PropTypeDefaultDescription
onSuccess() => voidundefinedCallback function triggered on successful click
successDurationnumber1000Duration in milliseconds for the particle animation
childrenReactNode-Button content
classNamestring-Additional CSS classes

Dependencies

  • motion/react (Framer Motion) - For particle animations
  • lucide-react - For the MousePointerClick icon
  • @/components/ui/button - Base button component
  • @/lib/utils - Utility functions (cn)

Features

  • Particle explosion animation on click
  • Customizable animation duration
  • Success callback support
  • Scale animation on interaction
  • Dark mode support

Build docs developers (and LLMs) love