Emoji Reaction
betaA reaction button that springs open a bar of emoji; picking one — or holding it, or dragging onto it from the button — floats copies up out of the bar.
- Feedback
- 1 file
- 1 npm package
- Accessibility notes
pnpm dlx @dowel-ui/cli add emoji-reactionnpm packages installed: class-variance-authority.
import { EmojiReaction } from "@/components/ui/emoji-reaction";Default
Sizes
Alignment
Custom Emoji
On AMessage
Close On Pick
<EmojiReaction>
| Prop | Type | Default |
|---|---|---|
alignWhich edge of the bar lines up with the trigger. It still shifts inward near the screen edge. | "start" | "center" | "end" | "center" |
barClassNameClasses for the bar. | string | — |
barLabelThe bar's accessible name. | string | "Reactions" |
defaultOpen | boolean | false |
defaultValueThe initial pick when uncontrolled. | string | null | null |
emojisThe emoji in the bar, as | readonly (string | EmojiReactionItem)[] | DEFAULT_EMOJIS |
labelThe trigger's accessible name; the current pick is added after it. | string | "React" |
labelsAccessible names for bare-string emoji, keyed by the emoji. | Readonly<Record<string, string>> | — |
onOpenChange | (open: boolean) => void | — |
onReactCalled every time an emoji is picked, including each repeat while one is held. | (emoji: string) => void | — |
onValueChangeCalled when the pick changes. | (emoji: string) => void | — |
open | boolean | — |
size | "sm" | "md" | "lg" | "md" |
valueThe last pick, controlled. | string | null | — |
asChildUse your own element — a message, a card, an image — as the trigger. It keeps its own content and name; give it one that says it can be reacted to. | boolean | false |
Plus every attribute of <button> except value, defaultValue.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes