RRiley2h ago
The new pricing page is live. Huge thanks to everyone who reviewed it!
Installation
$ pnpm dlx shadcn@latest add @synccn/reactionsFirst 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.
PropTypeDescription
- 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[]) => voidCalled after every change.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for SmilePlus
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
More inputs
ButtonSeven variants, four sizes and a built-in loading state.InputText field with optional leading icon and invalid state.TextareaMulti-line field that grows with its content and counts characters.CheckboxChecked, unchecked and indeterminate, with label and description.SwitchToggle with a springy thumb in three sizes.Radio GroupPick one option, shown as dots or as selectable cards.