component
Reactions
The emoji pill that overhangs the bottom edge of a bubble.
Install
npx shadcn@latest add https://whatsapp-components.crafter.run/r/reactions.jsonWrites 5 files into your project, and installs clsx and tailwind-merge.
Preview
ยกEse mismo! Te mando la ficha ๐3
Una sola reacciรณn, sin contador.
demos/reactions.tsx
import { MessageBubble } from "@/registry/whatsapp/message-bubble";
import { MessageMeta } from "@/registry/whatsapp/message-meta";
import { Reactions } from "@/registry/whatsapp/reactions";
export default function Demo() {
return (
<div className="flex flex-col gap-5">
<MessageBubble
direction="out"
className="mb-3.5"
meta={
<MessageMeta timestamp={new Date(2025, 0, 6, 18, 14)} status="read" />
}
>
ยกEse mismo! Te mando la ficha ๐
<Reactions
direction="out"
reactions={[{ emoji: "๐", count: 2 }, { emoji: "๐ฅ" }]}
/>
</MessageBubble>
<MessageBubble direction="in" className="mb-3.5">
Una sola reacciรณn, sin contador.
<Reactions reactions={[{ emoji: "๐", reactedByMe: true }]} />
</MessageBubble>
</div>
);
}Props
Read from ReactionsProps in the component source at build time.
| Prop | Type | Default |
|---|---|---|
reactionsrequired | Reaction[] | โ |
className | string | โ |
directionDirection of the message being reacted to. Picks the side. | MessageDirection | "in" |
onToggle | (emoji: string) => void | โ |
Files
- registry/whatsapp/reactions.tsx
- registry/whatsapp/types.ts
- registry/whatsapp/cn.ts
- registry/whatsapp/whatsapp.css
- LICENSE