Reaction summary
ProThe reactions so far: the top kinds’ icons and how many, stacked under a post or as a chip in a comment; pressable to see who reacted. Not an M3 component (@windmorph/react-pro).
import { ReactionSummary } from '@windmorph/react-pro';Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.
Purpose
The reactions so far: the top kinds' icons and how many. stacked overlaps the icons in rings, as under a post; chip is a small pill, as at the end of a comment's actions. Pair it with ReactionPicker. It is not an M3 component, so it comes from @windmorph/react-pro.
Behaviour
itemsare the top kinds, most first;max(3) caps them, e.g. to 1 in a narrow row.- The count uses the locale's compact numbers (1.3K). A chip shows it only from 2, as one icon already says one; nothing renders at 0.
onPressmakes it a button that opens the list of who reacted; without it, it's plain text.size:smfor comments and messages,mdfor posts. It sets the icons' size, astackedcount's type (label-large,label-mediumatsm) and a pressablestackedsummary's height and padding (40px and 12px, 32px and 8px atsm):ReactionPicker's at the same size, so a summary beside a picker sits level with it and the row doesn't move as the summary appears.- The
chipvariant is an M3 chip: the core'sAssistChipwhen pressable, and the assist chip's look when static (32px tall, 8px corners, anoutline-variantborder). Emoji take type-scale sizes in px, so 200% text keeps them in their boxes.
When not to use
To react, use the Reaction picker; for an unread count, a Badge.
See also
- Reaction picker: A reaction button that likes on tap, with a floating row of reactions on long press, hover or the keyboard; slide a finger along it to pick. Not an M3 component (@windmorph/react-pro).
- Comment row: One comment or message in a thread: avatar, bubble, what goes under it and a 48dp actions row that spaces the comments. Not an M3 component (@windmorph/react-pro).
- Badge: A small dot or a short count or label, placed on an anchor with BadgedBox.