SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

MessageGroup

A run of messages one person sent in a row, laid out flat the way a team chat reads.

MO
Mira Okafor

Store screenshots are final, light and dark.

View code
tsx
<MessageGroup>
	<MessageGroup.Item id="m-1">
		<MessageGroup.Avatar>
			<Avatar>
				<Avatar.Fallback>MO</Avatar.Fallback>
			</Avatar>
		</MessageGroup.Avatar>
		<MessageGroup.Header>
			<span>Mira Okafor</span>
			<time dateTime="2026-11-18T10:42">10:42</time>
		</MessageGroup.Header>
		<MessageGroup.Content>
			<p>Store screenshots are final, light and dark.</p>
		</MessageGroup.Content>
		<MessageGroup.Actions aria-label="Message actions">
			<Button variant="ghost" color="neutral" size="sm" aria-label="Reply in thread">
				<MessageSquareTextIcon size={16} />
			</Button>
			<Button variant="ghost" color="neutral" size="sm" aria-label="More actions">
				<EllipsisIcon size={16} />
			</Button>
		</MessageGroup.Actions>
	</MessageGroup.Item>
	<MessageGroup.Item id="m-2" mentioned>
		<MessageGroup.Time dateTime="2026-11-18T10:43">10:43</MessageGroup.Time>
		<MessageGroup.Content>
			<p>
				@Sam can you check the dark one? <MessageGroup.Edited>(edited)</MessageGroup.Edited>
			</p>
			<MessageGroup.Thread href="#thread" avatars={<Avatar size="sm"><Avatar.Fallback>T</Avatar.Fallback></Avatar>}>
				<strong>3 replies</strong> Last reply 10:58
			</MessageGroup.Thread>
		</MessageGroup.Content>
	</MessageGroup.Item>
</MessageGroup>

Installation

An ordinary dependency: install it, import the theme once, and import the component where it is used.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
import { MessageGroup } from "@sdxc/ui/chat";

Renders the run's host. Lines inside share one gutter width, so the text column stays straight from the first line to the last.

Composition

The parts the component publishes, each a static property of the host.

  • MessageGroup
  • MessageGroup.ItemRenders one message as a two-column line: the gutter (the avatar on the first line, the hover time on later ones) and the content column under its header.
  • MessageGroup.AvatarRenders the first line's avatar at the top of the gutter.
  • MessageGroup.HeaderRenders the first line's name, time and any role chip on one baseline.
  • MessageGroup.TimeRenders a later line's time in the gutter, hidden until the line is hovered or focused, so a long run reads as one block while every time stays one glance away.
  • MessageGroup.ContentRenders the message's body column: its text, files, reactions and thread summary stacked.
  • MessageGroup.EditedRenders the quiet mark after a message's text that says it was changed after sending.
  • MessageGroup.ActionsRenders the line's action bar, floated over its top-end corner and shown while the line is hovered or holds focus, so keyboard users reach every action by tabbing into the message.
  • MessageGroup.ThreadRenders the link under a message that opens its thread: the repliers' faces, the reply count in the accent colour and when the last reply came, boxed on hover.

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

PropTypeRequiredDescription
childrenRemixNodeYesOne MessageGroup.Item per message, oldest first.

Also accepts everything in TagProps<"div">.

MessageGroup.Item

PropTypeRequiredDescription
mentionedbooleanNoMarks a message that names the reader, drawn with an accent edge and a warm tint so it stands out in a busy log.
currentbooleanNoMarks the message the address or a thread panel points at.
childrenRemixNodeYes

Also accepts everything in TagProps<"article">.

MessageGroup.Avatar

PropTypeRequiredDescription
childrenRemixNodeYes

Also accepts everything in TagProps<"div">.

MessageGroup.Header

PropTypeRequiredDescription
childrenRemixNodeYesThe sender's name first, then quieter metadata such as the time or a role.

Also accepts everything in TagProps<"header">.

MessageGroup.Time

PropTypeRequiredDescription
childrenRemixNodeYesThe short time, such as "10:42".

Also accepts everything in TagProps<"time">.

MessageGroup.Content

PropTypeRequiredDescription
childrenRemixNodeYes

Also accepts everything in TagProps<"div">.

MessageGroup.Edited

PropTypeRequiredDescription
childrenRemixNodeYesThe word shown, such as "(edited)".

Also accepts everything in TagProps<"span">.

MessageGroup.Actions

PropTypeRequiredDescription
childrenRemixNodeYesSmall icon buttons; on a touch screen only the last one shows, so put a menu last.

Also accepts everything in TagProps<"div">.

MessageGroup.Thread

PropTypeRequiredDescription
hrefstringYes
avatarsRemixNodeNoSmall avatars of the people who replied, overlapped at the start.
childrenRemixNodeYesThe reply count and when the last one came, such as "3 replies · Last reply 2h ago".

Also accepts everything in Omit<TagProps<"a">, "children" | "href" | "role">.

@sdxc/ui

Can’t find it? Contact us