Reaction Bar

Row of emoji reaction pills with counts, where active reactions get an accent border and aria-pressed. Toggle callbacks suit comments and chat threads.

src/registry/ui/reaction-bar.tsx/r/reaction-bar.json

Installation#

bash
npx shadcn@latest add @minidev/reaction-bar

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/reaction-bar.json

Usage#

tsx
import { ReactionBar } from "@/components/ui/reaction-bar"

export function Example() {
  return (
    <ReactionBar reactions={[{ emoji: "👍", count: 3, active: true }, { emoji: "🎉", count: 1 }]} />
  )
}

API reference#

ReactionBar props
PropTypeDefault
reactionsReaction[]SAMPLE_REACTIONS
onToggle(emoji: string) => void-
classNamestring-

Examples#

All alerts, toasts and empty states

Learn more