Skip to content
synccn

Reactions

New

Emoji reactions with counts and a picker.

RRiley2h ago

The new pricing page is live. Huge thanks to everyone who reviewed it!

Installation

$ pnpm dlx shadcn@latest add @synccn/reactions

First time in this project? Connect synccn with one command.

Usage

import { Reactions } from "@/components/ui/reactions";<Reactions defaultValue={{ "🎉": 12 }} />

API reference

Generated from the component's TypeScript types, so it always matches the code.

Reactions

Emoji reactions with counts, your own reaction highlighted, and a picker to add more.

  • defaultValue
    Record<string, number>

    Default {}

    Starting counts keyed by emoji.

  • defaultMine
    string[]

    Default []

    Emoji the current user has already used.

  • onChange
    (counts: Record<string, number>, mine: string[]) => void

    Called after every change.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA roles: menu, menuitem
  • ARIA attributes: aria-expanded, aria-label, aria-pressed
  • Closes when you click or tap outside