Like Button

A heart that pops, throws sparks and rolls its count up.

Preview

"use client";

import { LikeButton } from "@/components/motion/like-button";

export function LikeButtonUsage() {
  return <LikeButton count={128} />;
}

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/like-button

API Reference

liked?
boolean

Whether the viewer has liked it, for controlled use.

Default—
defaultLiked?
boolean

Whether it starts liked when uncontrolled. Default: false

Defaultfalse
onLikedChange?
((liked: boolean) => void)

Called with the new state when the button is pressed.

Default—
count?
number

Likes from everyone else. The viewer's own like is added on top.

Default—
labels?
Partial<{ like: string; }>

Override any built-in string, e.g. for translation.

Default—
sound?
boolean

Play a soft tap on like and unlike. Off by default; a `SoundProvider` can mute it app-wide.

Defaultfalse
className?
string

Classes merged onto the root element.

Default—

Updated