chatcn

Reactions

Emoji reaction pills displayed below messages. Reactions show an emoji, a count, and visually highlight when the current user has reacted.

Today
A
Alice

This new API is incredible

Right? The DX is so clean

A
Alice

Shipping it tomorrow

Let's get it reviewed first

A
Alice

Already on it! Tests are passing

Amazing work, this is going to be huge

Basic Usage

Add a reactions array to any ChatMessageData object. Each reaction includes an emoji, the list of user IDs who reacted, and a count.

Today
A
Alice

This new design is incredible!

Current User Highlight

Reactions where userIds includes currentUser.id are rendered with a highlighted style (accent border and background) so the user can quickly see which reactions they have already added.

Today
A
Alice

Ship it!

Adding Reactions

Use the onReactionAdd and onReactionRemove callbacks on ChatProvider to handle toggling reactions. These fire when the current user clicks a reaction pill or picks an emoji from the reaction picker.

Today
A
Alice

Great work!

Thanks! Let's ship it

Reaction Shape

Each item in the reactions array has the following shape:

PropTypeDescription
emojistringThe emoji character (e.g. "🔥", "👍")
userIdsstring[]IDs of users who added this reaction
countnumberTotal number of users who reacted with this emoji