Calm motion: animations on this site only fade, with no movement
Reactions
Emoji reactions with counts under a post
Lets readers react to a post or a message with an emoji. Each reaction shows its count. A click adds or removes the reaction of the reader, and a button opens the emoji picker for a new one.
Basic
Episode 41 is out: we recorded it in a wardrobe, and it sounds better than the studio.
Add a reaction
Smileys
People
Animals and nature
Food and drink
Activities
Travel and places
Objects
Symbols
v-modelis a list of reactions. Each reaction has anemojiand acount. If the reader is one of the people who reacted, setactiveto true. It is theBlessReactiontype of the chat bubble.- A click on a reaction adds the reader to it or removes the reader from it, and changes
countandactive. A reaction with a count of zero goes away. Each click emitstogglewith the emoji and the new state. Send it to your server. - The last button opens the emoji picker. A picked emoji adds a new reaction, or joins the reaction that has it.
:addable="false"hides this button. maxsets how many reactions one reader can add (default 0, no limit). At the limit, the other buttons are disabled.- The reaction of the reader has the accent border and a bold count. Each button is a toggle with
aria-pressed, and its name says the emoji and the count. Change the words withlabelsor a label pack:add,group, andreaction(a function of the emoji and the count).
Usage
ts
import { BlessReactions } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
addable | boolean | true | show the button that opens the emoji picker; false hides it |
max | number | 0 | reactions a reader can add at most, counting their own; 0 has no limit |
labels | Partial<{ add: string; group: string; reaction: (emoji: string, count: number) => string; }> | — | |
modelValue | BlessReaction[] | [] | the reactions, with the same type as in `BlessBubble`; a click changes `count` and `active` |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: BlessReaction[]] | |
toggle | [emoji: string, on: boolean] |