Emoji Reactions, animated React component
A message with reaction chips that pop and roll their counts when tapped, plus a spring picker that adds new reactions with a layout animation.
- Free
- Inputs & Controls
- Spring
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Shipped the new onboarding flow
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| message | React.ReactNode | "Shipped the new onboarding flow" | Text in the message bubble. Pass null to show only the reactions. |
| reactions | { emoji: string; count: number; reacted?: boolean }[] | [🚀 3, 🔥 2] | Starting reactions. |
| emojis | string[] | ["👍", "❤️", "😂", "🎉", "🔥", "🚀", "👀", "🙏"] | Emojis offered in the picker. |
| onChange | (reactions: Reaction[]) => void | — | Called whenever the reaction list changes. |
| accent | string | "#5b8def" | Ring and tint colour for reactions you've added. |
| className | string | — | Extra classes on the wrapper. |
Add it to your project
- 1
Prepare your project
You need Tailwind CSS and the
@/import alias. If shadcn isn't set up yet, initialise it once:npx shadcn@latest init
Then add the Nexus registry to your
components.json(theregistrieskey is the part that matters):{ "$schema": "https://ui.shadcn.com/schema.json", "style": "default", "rsc": true, "tsx": true, "tailwind": { "css": "src/app/globals.css", "baseColor": "neutral", "cssVariables": true, "prefix": "" }, "aliases": { "components": "@/components", "utils": "@/lib/utils", "ui": "@/components/ui", "lib": "@/lib", "hooks": "@/hooks" }, "registries": { "@nexus-labs": "https://www.nexus-ui.com/api/registry/{name}" } } - 2
Add the component
Run this from your project root. It adds the component, the utilities it uses and its packages.
npx shadcn@latest add @nexus-labs/emoji-reactions
- 3
Check what was added
With the standard aliases, these files land in your project:
components/emoji-reactions/emoji-reactions.tsxindex.ts - 4
Copying by hand? Install the packages
Skip this if you used the command above.
npm install framer-motion lucide-react
- 5
Use it in a page
Import it and render it. The Code tab above has the full example.
// app/page.tsx import { EmojiReactions, type Reaction } from "@/components/emoji-reactions"; export default function Page() { return ( <main> <EmojiReactions /> </main> ); }