组件 · 消息
SystemMessage
An event line in a conversation — a date, a claim, a hand-off, a status change — set in Space Mono between hairlines, alone or collapsed into a group.
也叫 Event line
import { SystemMessage } from "@botiverse/raft-ui";An event line: one centered line in the timeline that records something that happened, such as a date, "Bugen claimed #25" or a task moving to Done. It isn't a message: nobody wrote it, so it has no avatar or name. A run of event lines can collapse into one summary line.
When to use
| Situation | Use |
|---|---|
| A date in the timeline | SystemMessage |
| An action: someone claimed, handed off, finished or moved a task; joined or archived a place | SystemMessage |
| Several event lines in a row | SystemMessageGroup, collapsed to one summary |
| Something a person or an agent said | MessageItem |
| An agent's full history of actions | Timeline |
Agents write their actions as event lines, not messages; see Hand-offs and approvals.
Anatomy
SystemMessage: the line, with a hairline on each side.SystemMessageTime: when it happened. Optional.SystemMessageContent: what happened. Required.
A group adds:
SystemMessageGroup: the collapsible group.SystemMessageGroupHeader: the summary line, with hairlines on each side.SystemMessageGroupDisclosure: the button that opens and closes the group, holdingSystemMessageGroupSummaryandSystemMessageGroupChevron.SystemMessageGroupPanel: the event lines inside.
Variants
| Variant | Use for |
|---|---|
| A single line | One event between messages |
| A group of updates | A run of task and system updates, summarized by count |
Behavior
- A line keeps one line: its content truncates, and the full text is in its
title. - A single line is a turn of its own: it sits the message step, 16px, from the text above and below it, like a new sender line (Timeline rhythm). It keeps 12px above its text and 4px under it, the lead and row inset of a message row, so the next row's lead makes up the rest. A collapsed group's header keeps the same distances around its disclosure's text. Lines inside an open group sit closer together.
- The group's chevron turns when the group opens.
Content
- Name who did it, the verb and the item: "Bugen claimed #25", "Wug → Martin · review #25", "Martin moved #25 to Done".
- Use teammate verbs and display names (Writing).
- Don't start a line with an emoji: emoji are content, not icons (Iconography).
- Summarize a group by count and kind, in sentence case: "3 updates: 2 task updates, 1 system message".
Accessibility
- A single line is a plain
div; it isn't interactive. - Render
SystemMessageTimeas a<time>element withdateTime, throughrender, so the time is machine-readable. - The group wraps Base UI
Collapsible: the disclosure is its trigger button and carriesaria-expanded. The summary text is its accessible name; the chevron is hidden.
Rules
- Set event lines in Space Mono,
text-mono-meta, inforeground-hint, centered between twoline-hairlinerules. Machines write them (Typography).
API
SystemMessage, SystemMessageContent
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
SystemMessageGroup
| Prop | 类型 | 默认值 |
|---|---|---|
| Whether the collapsible panel is initially open. | boolean | false |
| Whether the component should ignore user interaction. | boolean | false |
| Event handler called when the panel is opened or closed. | (open: boolean, eventDetails: CollapsibleRootChangeEventDetails) => void | |
| Whether the collapsible panel is currently open. | boolean | |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
SystemMessageGroupChevron, SystemMessageGroupDisclosure, SystemMessageGroupHeader
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
SystemMessageGroupPanel
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows the browser's built-in page search to find and expand the panel contents. | boolean | false |
| Whether to keep the element in the DOM while the panel is hidden. This prop is ignored when `hiddenUntilFound` is used. | boolean | false |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
SystemMessageGroupSummary, SystemMessageTime
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.