NK

Search

Search pages, posts, and components

All components

Like Button

Buttons

A heart that pops and bursts particles when liked.

Installation

Add it with the shadcn CLI:

$pnpm dlx shadcn@latest add https://nawalkattel.com.np/r/like-button.json
Or install manually
  1. 1. Install dependencies

    pnpm add motion clsx tailwind-merge lucide-react
  2. 2. Copy the component source into components/library/like-button.tsx

Props

PropTypeDefaultDescription
classNamestring - Classes applied to the button.

Accessibility

  • aria-pressed exposes the liked state to assistive tech.
  • Carries an aria-label, since the control is icon-only.
  • Particles are pointer-events-none and never block clicks.

Dependencies

motionclsxtailwind-mergelucide-react