Comment row
ProOne 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).
import { CommentRow } 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.
Keyboard
| Key | Action | Where |
|---|---|---|
| Tab | Moves focus to a pressable bubble, then to the actions in the actions row. A static bubble is skipped. | |
| Enter or Space | Presses a bubble with onPress.With onPress | With onPress |
| Enter | Follows a bubble with href.With href | With href |
The actions in the actions row are your own components and keep their own keys.
Screen reader
- Role
- The root is a
div, anarticleor anli(as). A pressable bubble is abuttonwithonPress, or alinkwithhref; otherwise it is plain content. - Accessible name
- An
articletakes its name fromaria-label("Comment by Ada"). A pressable bubble is named by its content: the name line and the words. - States announced
- Busy (
aria-busy) whilepending.
The avatar is read as whatever you pass. Pass it decorative, since the name is in the bubble.
Focus
A pressable bubble is in the Tab order and shows M3's focus indicator on keyboard focus: a 3px secondary outline 2px outside the bubble. Pointer presses show no ring.
Touch target
- A pressable bubble is as large as its content plus 8px above and below and 12px at the sides; it has no added touch target.
- The actions row is at least 48px tall (
actions-height), room for actions with 48px targets.
Motion
The filled bubble fades between its pending colour (surface-container) and its sent colour on the effects spring; a colour fade isn't movement, so it still fades under reduced motion. A pressable bubble's hover and focus state layers fade too, and under reduced motion its press ripple appears at full size without growing.
What you need to do
- With
as="article", give each row anaria-labelsuch as "Comment by Alex". Useas="li"inside a list. - Pass the avatar decorative (no name of its own), since the name is in the bubble.
- Don't put buttons or links inside a pressable bubble: put actions in
actions. - Give every action in the row a visible label or an accessible name, and a touch target of 48px.
- In forced-colours mode the bubble keeps a border; keep
classNamesoverrides from removing it.