Skip to content

Reaction summary

Pro

The 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

  • items are 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.
  • onPress makes it a button that opens the list of who reacted; without it, it's plain text.
  • size: sm for comments and messages, md for posts. It sets the icons' size, a stacked count's type (label-large, label-medium at sm) and a pressable stacked summary's height and padding (40px and 12px, 32px and 8px at sm): 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 chip variant is an M3 chip: the core's AssistChip when pressable, and the assist chip's look when static (32px tall, 8px corners, an outline-variant border). 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.