# MessageGroup

> A run of messages one person sent in a row, laid out flat the way a team chat reads: the first line carries the avatar, name and time, and each later line sits under it with its time in the gutter on hover.

```ts
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.

## Examples

```tsx
<MessageGroup>
	<MessageGroup.Item id="m-1">
		<MessageGroup.Avatar><Avatar size="md">…</Avatar></MessageGroup.Avatar>
		<MessageGroup.Header><strong>Mira Okafor</strong><time dateTime="…">10:42</time></MessageGroup.Header>
		<MessageGroup.Content>Shipped the new onboarding.</MessageGroup.Content>
	</MessageGroup.Item>
	<MessageGroup.Item id="m-2">
		<MessageGroup.Time dateTime="…">10:43</MessageGroup.Time>
		<MessageGroup.Content>Notes are in the doc.</MessageGroup.Content>
	</MessageGroup.Item>
</MessageGroup>
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `children` | `RemixNode` | One MessageGroup.Item per message, oldest first. |

Also accepts everything in `TagProps<"div">`.


### MessageGroup.Item

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

| Prop | Type | Description |
| --- | --- | --- |
| `mentioned?` | `boolean` | Marks a message that names the reader, drawn with an accent edge and a warm tint so it stands out in a busy log. |
| `current?` | `boolean` | Marks the message the address or a thread panel points at. |
| `children` | `RemixNode` |  |

Also accepts everything in `TagProps<"article">`.


### MessageGroup.Avatar

Renders the first line's avatar at the top of the gutter.

| Prop | Type | Description |
| --- | --- | --- |
| `children` | `RemixNode` |  |

Also accepts everything in `TagProps<"div">`.


### MessageGroup.Header

Renders the first line's name, time and any role chip on one baseline.

| Prop | Type | Description |
| --- | --- | --- |
| `children` | `RemixNode` | The sender's name first, then quieter metadata such as the time or a role. |

Also accepts everything in `TagProps<"header">`.


### MessageGroup.Time

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

| Prop | Type | Description |
| --- | --- | --- |
| `children` | `RemixNode` | The short time, such as "10:42". |

Also accepts everything in `TagProps<"time">`.


### MessageGroup.Content

Renders the message's body column: its text, files, reactions and thread summary stacked.

| Prop | Type | Description |
| --- | --- | --- |
| `children` | `RemixNode` |  |

Also accepts everything in `TagProps<"div">`.


### MessageGroup.Edited

Renders the quiet mark after a message's text that says it was changed after sending.

| Prop | Type | Description |
| --- | --- | --- |
| `children` | `RemixNode` | The word shown, such as "(edited)". |

Also accepts everything in `TagProps<"span">`.


### MessageGroup.Actions

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

| Prop | Type | Description |
| --- | --- | --- |
| `children` | `RemixNode` | Small icon buttons; on a touch screen only the last one shows, so put a menu last. |

Also accepts everything in `TagProps<"div">`.


### MessageGroup.Thread

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

| Prop | Type | Description |
| --- | --- | --- |
| `href` | `string` |  |
| `avatars?` | `RemixNode` | Small avatars of the people who replied, overlapped at the start. |
| `children` | `RemixNode` | The 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">`.

