Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

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. Also includes the Motion Kit Spark Reactions variant.

  • Pro
  • Inputs & Controls
  • Spring

Pops when you pick or add a reaction and plays a quieter off when you remove yours. Sound is off on this site until you switch it on.

Emoji Reactions

Spark Reactions

Props

PropTypeDefaultWhat it does
message"Shipped the new onboarding flow"Text in the message bubble. Pass null to show only the reactions.
reactions[🚀 3, 🔥 2]Starting reactions.
emojis["👍", "❤️", "😂", "🎉", "🔥", "🚀", "👀", "🙏"]Emojis offered in the picker.
onChange—Called whenever the reaction list changes.
accent"#5b8def"Ring and tint colour for reactions you've added.
className—Extra classes on the wrapper.
SparkReactions.message"Shipped the new onboarding flow"The message the reactions belong to.
SparkReactions.reactionsDEFAULT_SPARK_REACTIONSStarting row, each { id, count, mine } (rocket 3 and fire 2 by default).
SparkReactions.optionsDEFAULT_SPARK_OPTIONSReactions in the picker, each { id, label, d, color, darkColor? }; also the icons for reactions.
SparkReactions.onChange—Called with the new row after the user adds or removes a reaction.
SparkReactions.autoplayfalseReacts, opens the picker and un-reacts on a loop until someone touches it.
SparkReactions.className—Extra classes for the root.
enableSoundtruePlays interface sounds on interaction. They follow the sound switch (setSoundsEnabled, on by default) and stay silent on hover. Autoplay makes the same sounds once the visitor has used the page. Pass false to silence this component.

Add it to your project

  1. 1

    Set up your project once

    You need a Next.js project with Tailwind CSS and the @/ import alias. In its root folder, run this once. It creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 2

    Connect the registry with your API key

    Emoji Reactions is a Pro item, so the CLI has to send your API key. Do this once per project:

    1. Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with nxs_ and is shown only once.
    2. In your project root, next to package.json, create a file named .env.local with this line, using your own key:
      NEXUS_API_KEY=nxs_your_key_here
    3. Open components.json and add this entry inside the outermost braces, next to "aliases". Leave {name} and ${NEXUS_API_KEY} exactly as written; the CLI fills them in:
      "registries": {
        "@nexus-labs": {
          "url": "https://www.nexus-ui.com/api/registry/{name}",
          "headers": {
            "Authorization": "Bearer ${NEXUS_API_KEY}"
          }
        }
      }

How Emoji Reactions works

Message reactions. Tap a pill to add or remove yours: the count rolls and slides into the row and the others make room.

The source, the install command and the build prompt come with Pro.

Emoji Reactions questions

How do I install Emoji Reactions?

Run `npx shadcn@latest add @nexus-labs/emoji-reactions`. It installs framer-motion and lucide-react, and the same install includes the `SparkReactions` variant. It is a Pro component, so it needs a Pro plan and an API key; key setup is on the CLI docs page (/docs/cli).

How do I set the starting reactions and the picker emojis?

Pass `reactions` as `{ emoji, count, reacted? }[]` for the starting row (default is rocket 3 and fire 2), and `emojis` for the picker options. `message` sets the bubble text, or pass `null` to show only the reactions, and `onChange` receives the updated list.

How do the counts animate when someone reacts?

Each chip pops when you add a reaction and its count rolls digit by digit, built with Framer Motion, with a layout animation when a new chip joins the row. Clicking a chip toggles your own reaction, and `accent` (default `#5b8def`) colors the ring on reactions you added.

Is the picker keyboard accessible?

Yes. The add button opens the picker with Enter, Space or ArrowDown and moves focus to the first emoji, Escape closes it and returns focus to the button, and chips use `aria-pressed` with a label that includes the count. With reduced motion on, the picker fades instead of scaling in and the digits fade instead of rolling.

Does it make sound, and how do I turn it off?

Pops when you pick or add a reaction and plays a quieter off when you remove yours. Sounds are synthesised with the Web Audio API, so there are no audio files, and they only play after a click or key press. Pass `enableSound={false}` to silence this component, or call `setSoundsEnabled(false)` from `@/lib/ui-sounds` to switch every sound off at once. The CLI installs `@/lib/ui-sounds` with the component.

Guides