Skip to content

Comment row

Pro

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).

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.

Props

By name or description, across the 14 props below

CommentRow 14 props

  • avatartype ReactNodeRequired

    The avatar, usually Avatar at size="sm", decorative (the name is in the bubble).

  • bubbletype ReactNodeRequired

    The name line and the words.

  • actionstype ReactNodeRequired

    The 48dp row of actions: when, Like, Reply, a menu. It spaces one comment from the next. Actions that don't fit wrap onto another line.

  • belowtype ReactNode

    Under the bubble: a photo, a note. Keeps 4dp off the bubble.

  • varianttype "filled" | "outlined"default "filled"

    outlined: a dashed bubble, for a removed comment only its writer sees.

  • pendingtype booleandefault false

    Being sent: a quieter bubble, two surface steps down (the words keep full contrast), and aria-busy.

  • astype "div" | "article" | "li"default "div"

    The root element: article named by the app ("Comment by Ada"), li in a list.

  • reftype Ref<HTMLElement>

    The root element (as). Its other props (id, aria-*, data-*) go to it too.

  • hreftype string

    Makes the bubble a link to this address.

Events

  • onPresstype (() => void)

    Makes the bubble a button, e.g. opening the conversation.

Text

  • aria-labeltype string

    The root's accessible name, for as="article".

Also accepts the root element's HTML attributes (id, data-*, event handlers).

Spec status

Not part of Material Design 3: a Windmorph Pro component, built on M3's colour roles, type scale, shapes and motion. Its variants and configurations each link to a live example.

  • Filled bubble (variant="filled")

    Built

    Variant · Thread

  • Dashed bubble for a removed comment (variant="outlined")

    Built

    Variant · States

  • Being sent (pending)

    Built

    Configuration · Thread

  • Content below the bubble (below)

    Built

    Configuration · States

  • A named comment (as="article")

    Built

    Configuration · States

  • A thread in a list (as="li"), with reactions

    Built

    Use case · Thread

Theming & tokens

Set the tokens below on a row or any ancestor. Style the parts with classNames (root, avatar, bubble, below, actions).

Comment row tokens
VariableDefaultPaints
--wm-comment-row-bubble-containervar(--md-sys-color-surface-container-highest)The bubble’s background (`filled`).
--wm-comment-row-bubble-outlinevar(--md-sys-color-outline)The bubble’s dashed outline (`outlined`, a removed comment).
--wm-comment-row-bubble-cornervar(--md-sys-shape-corner-large)The bubble’s corners.
--wm-comment-row-bubble-padding-inline12pxInside the bubble, at its sides.
--wm-comment-row-bubble-padding-block8pxInside the bubble, above and below.
--wm-comment-row-avatar-gap8pxBetween the avatar and the bubble.
--wm-comment-row-below-gap4pxBetween the bubble and what goes under it (a photo, a note).
--wm-comment-row-actions-height48pxThe actions row, which also spaces one comment from the next.
--wm-comment-row-actions-gap4pxBetween the actions.
--wm-comment-row-bubble-container-pendingvar(--md-sys-color-surface-container)The bubble’s background while it’s being sent (`pending`): two surface steps quieter, an opaque role, so the words keep full contrast in both modes.