Reaction Picker

A tray of reactions grows out, and your pick arcs back onto the button.

Preview

"use client";

import { ReactionPicker } from "@/components/motion/reaction-picker";

export function ReactionPickerUsage() {
  return (
    <div className="pt-12">
      <ReactionPicker count={24} />
    </div>
  );
}

Install

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

$ bunx --bun shadcn add @beui/reaction-picker

API Reference

reactions?
Reaction[]

The choices, in order. Defaults to like, love, haha, fire and party.

Default—
value?
string | null

The viewer's reaction id, or null for none.

Default—
defaultValue?
string | null

The initial reaction id when uncontrolled. Default: null

Defaultnull
onValueChange?
((value: string | null) => void)

Called with the picked reaction id, or null when the same one is picked again.

Default—
count?
number

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

Default0
labels?
Partial<{ react: string; reacted: string; reactions: string; like: string; love: string; haha: string; fire: string; party: string; }>

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

Default—
sound?
boolean

Play open and close swishes for the tray and a select on a pick. Off by default; a `SoundProvider` can mute it app-wide.

Defaultfalse
className?
string

Classes merged onto the root element.

Default—

Updated