Reaction Bar

Overview

A Slack-style emoji reaction bar with animated chips and rolling counts.

This feedback component is intended for interfaces that need a Slack-style emoji reaction bar with animated chips and rolling counts, form workflows, and support tools. Its implementation is provided as editable source so the final behavior and styling stay inside your project.

Technologies

React
TypeScript
Tailwind CSS
Motion

Detected package dependencies: framer-motion, lucide-react.

@spectrumui/reaction-bar
AK
Aisha Khan2:14 PM

Just shipped the new onboarding flow — would love your feedback before Friday!

Installation

Login to view commandCreate a free account to access the install command

Usage

import { ReactionBar } from "@/components/spectrumui/reaction-bar"
<ReactionBar
  defaultReactions={[
    { emoji: "👍", count: 3, reacted: true },
    { emoji: "🎉", count: 1 },
  ]}
  onReactionsChange={(reactions) => console.log(reactions)}
/>

API Reference

ReactionBar

Renders a row of reaction chips, each a button with aria-pressed reflecting whether you have reacted. Reactions use the exported Reaction type: { emoji: string; count: number; reacted?: boolean }. Pass reactions to control the list from outside, or defaultReactions to let it manage its own state. Toggling a chip adjusts its count by one, and a chip whose count reaches zero is removed.

PropTypeDefaultDescription
reactionsReaction[]-Controlled reactions. Leave undefined for uncontrolled usage
defaultReactionsReaction[][]Initial reactions when uncontrolled
onReactionsChange(reactions: Reaction[]) => void-Fires with the next reactions array on every change
availableEmojisstring[]["👍", "❤️", "😂", "🎉", "😮", "🚀"]Emojis offered in the add popover
addablebooleantrueShow the plus button that opens the emoji popover
size"sm" | "md""md"Visual size of the chips
classNamestring-Additional classes merged with the default container styles

Examples

Controlled and read-only

Controlled — 15 total reactions

Small size with the add button disabled

Use cases

  • interfaces that need a Slack-style emoji reaction bar with animated chips and rolling counts
  • form workflows
  • support tools

Features

  • Copy-paste source that remains in your repository
  • TypeScript source included with the component
  • Tailwind CSS classes editable in the component source
  • Animation implemented with Motion
  • Responsive Tailwind variants present in the source
  • Reduced-motion handling present in the source

Accessibility

  • The source includes ARIA attributes or roles; preserve them when customizing the component.
  • The source checks reduced-motion preferences or includes motion-reduce styles.
  • Test focus order, keyboard operation, labels, contrast, and screen-reader output in the final application context.

Customization

  • Edit the Tailwind utility classes in the copied source to match your spacing, color, and typography tokens.
  • Use the documented className surface for local layout adjustments, then edit the source for structural changes.
  • Adjust Motion transitions in the source and keep the reduced-motion behavior aligned with the final interaction.

Topic guides

See how this component fits into broader interface patterns, implementation decisions, and working examples.

Reaction Bar FAQ

Is Reaction Bar free to use in commercial projects?

Yes. The public Reaction Bar source is available under the Apache License 2.0, including for commercial use, subject to the LICENSE terms.

How do I install Reaction Bar?

Run npx shadcn@latest add @spectrumui/reaction-bar. The page also exposes the source for manual installation.

Does Reaction Bar require Motion?

Yes. Motion usage was detected in the documented source or registry dependencies for Reaction Bar.

Does Reaction Bar use shadcn/ui or Radix UI?

No shadcn/ui or Radix UI dependency was detected in the documented Reaction Bar source.

Can I use Reaction Bar in Next.js?

The documented React source is used in this Next.js application. Keep its use client directive when copying it into the App Router. Install the detected dependencies and verify any application-specific data or image configuration.

What accessibility checks should I run for Reaction Bar?

The source includes ARIA markup, reduced-motion handling. Test the finished interface with keyboard and screen-reader workflows.