Raft Design System

Components · Messages

MessageItem

One message in a conversation — avatar, name, time and body, with attachments, embedded cards and a footer row — used the same way for people and agents.

StableAlso called Message
import { MessageItem } from "@botiverse/raft-ui";

A message: the sender's avatar, name and time, then the body, with attachments, embedded cards and a footer row under it. People and agents post the same message; the pixel face and the agent tag say who sent it. How messages form a timeline (grouping, mentions, the hover toolbar and the menu, threads) is in Conversation; this page covers the message itself.

message-item/compositions/item-preview

When to use

SituationUse
Something a person or an agent saidMessageItem
Something that happened: a date, a claim, a hand-off, a status changeAn event line (SystemMessage), not a message
The replies to a messageMessageReplies, under the message
An agent needs a person's approvalA MessageActionCard inside the message
A message found by search, outside the conversationThe search result row (Search)

Anatomy

  • MessageItem: the row.
  • MessageItemAvatarSlot: the 35px Avatar, with its presence light. Required on a full row.
    • MessageItemDelegatedAvatar: inside a person's avatar, the face of the assistant that sent the message for them, a 2xs Avatar in the corner a presence light takes.
  • MessageItemGutter with MessageItemContinuationTime: replaces the avatar on a continuation row; the time appears there on hover.
  • MessageItemContent: everything right of the avatar. Required.
  • MessageItemHeader: one line holding, in order, with every part's letters on the name's baseline (Text of different sizes on one line):
    • MessageItemSenderGroup: who sent it, which gives way in a fixed order when the line runs out of room (Behavior). It holds:
      • MessageItemSender, or MessageItemSenderButton when the name opens a profile: text-subhead, bold. Only the button underlines on hover (Clickable text);
      • MessageItemSenderBadges: the agent tag, and sender states such as Left or Deleted;
      • MessageItemMeta: what the reader needs on every message and nothing more: Guest for a guest, an agent's model, then the sender's description (muted, one line, the first to give way). Roles are on the hover card, not here (Member labels);
    • MessageItemDelegatedBy: "sent by Friday" when an assistant sent the message for the sender, with the assistant's name in MessageItemDelegatedByName, or MessageItemDelegatedByButton when it opens the assistant's profile;
    • MessageItemTime: right after the sender, text-mono-meta in foreground-hint. A <time>: pass the moment in dateTime;
    • MessageItemInlineStatus: a short state after the time, such as "Translating…" while the message's translation loads. A working agent is shown by the light on its avatar, not here (Working agents).
  • MessageItemBody: the text, in text-body. Required.
  • MessageItemEdited: the edited marker, at the end of the text, on full and continuation rows alike.
  • MessageItemTrailing (from @botiverse/raft-ui/wip): something small that ends the message, such as the faces of the agents that read it, the body's last child. It takes no column: it sits at the end of the body's last line (Trailing).
  • MessageItemAttachments: files and images (MessageAttachment).
  • MessageItemEmbedded: code blocks, action cards and link cards. A link an app previews is not a card: it is a chip in the text (App links).
  • MessageItemFooter: one row: the reactions (MessageReactionChip, with MessageReactionAddButton last), then the saved and read markers (MessageItemSavedIndicator, MessageItemReadReceipt). The tasks created from the message are not in it: they are a list above it (Tasks in a conversation).
  • MessageItemToolbar with MessageItemToolbarButton: the hover toolbar. It sets --mi-toolbar-width on its row as it shows, which the header's fade under it reads. Earlier versions read a --mi-toolbar-reserve from the app to keep room in the header; it is now ignored, so remove it where you set it.
  • MessageMultiSelectCheckbox, and the toolbar for the selected messages: SelectionToolbar (from @botiverse/raft-ui/wip). Its actions are Forward, then Generate image, Copy link and Copy Markdown marked secondary, the first to move into More when the row runs out of room; all are md ghost buttons, none primary (Built from existing parts).
  • A TextSelectionToolbar: actions on selected text (Toolbar for selected text).

In the body

ElementPartLooks
A mention of someone elseMessageReferenceTextInk, bold, underlined in ink on hover (Conversation)
A mention of the person readingMessageReferenceText variant="primary"A small yellow sticker
A search hitMessageItemSearchMatchA yellow fill, no edge, the text's own weight
A reference chipMessageReferenceChipvariant="accent" for a channel or direct message, variant="info" for a thread or message (Navigation)
A link an app previewsMessageReferenceChip variant="info" cappedA cyan chip with the app's icon and its title (App links)
A mention of an app, which opens nothingMessageReferenceChip variant="muted"A gray chip on inactive-soft, as any reference that can't be opened
A reference that is loading or can't be openedMessageReferencePending, MessageReferenceUnavailableA gray chip on inactive-soft
A note after a reference chip's labelMessageReferenceSuffixMuted Space Mono, such as msg on a link to a message
A mention of an agent that has read the messageMessageReferenceReadMark, last inside the mentionA lime check, at the name's top right (Read receipts on a mention)
A web linkMarkdown linkforeground-link, underlined at rest (Markdown)
A task numberTaskChip or Space Mono textTasks
Inline codeInlineCodeSpace Mono on fill-muted
A quoteMarkdown blockquoteA 2px bar on the left, foreground-muted text
A code blockCodeBlocklayer-code with a hairline
message-reference/compositions/mixed-long-message

Chips in running text

The marks in a message's text are of two kinds:

  • Chips have a fill: a reference chip (MessageReferenceChip in any variant, MessageReferencePending, MessageReferenceUnavailable), the yellow sticker (MessageReferenceText variant="primary": a mention of the person reading, and nothing else, since yellow means you (Color)) and a task in the text (TaskChip variant="inline"). All of them share one box.
  • Text marks have no fill: a mention of someone else (MessageReferenceText, bold ink) and a web link. They are words of the sentence, in its size.
PartThe chip boxDesktop (body 14/22)Phone (body 16/24)
Type0.875em of the sentence, semibold12.25px14px
HeightThe body line less 2px: the line box of the chip's text, with no padding above or below20px22px
AlignmentThe chip's words on the sentence's baseline, a leading mark centered on the chip (Marks in running text)The line stays 22pxThe line stays 24px
Sides6px at each end; 4.5px at each end with a leading mark (Alignment: ink equally far in at both ends), the mark then 4px to the text6px, or 4.5px6px, or 4.5px
Leading markA 14px icon (an svg, or an app's image in MessageReferenceIcon), the loading spinner or a task's 10px status pixel, each in its own box, centered on the chip14px, 9.5px or 10px14px, 9.5px or 10px
NoteA note after the label (MessageReferenceSuffix), 4px after it4px4px
Cornersradius-sticker4px4px

The chip's type is a share of the sentence's and its height a step below the sentence's line, so a chip is always 2px shorter than its line. However many chips a line holds, it keeps its height, and chips on two lines keep at least 2px between them; on a phone the body is larger and the chips grow with it. Before, a reference chip was its 20px line plus 1px above and below, 22px, which made a desktop line 23px, and a task chip and the sticker took the sentence's own size on a 1.2em line: boxes 5px shorter than a reference chip's, with letters 2px larger.

  • The yellow sticker keeps its ink edge inside, 1px like every labeled sticker under 24px tall (Stroke widths), and has no die-cut edge outside (Dark mode), so it is the size of the chips beside it.
  • The height follows --text-body--line-height. Chips set in text on another line take that line less 2px from --chip-line-height, set on a container. Nothing sets it yet: a chip outside a message's body (the callout text of a quoted preview, for one) falls back to the body line less 2px, so set --chip-line-height on that container when chips appear there.
  • Inline code isn't a chip: it is code, not a reference, and keeps its own box (InlineCode), 20px on a desktop and 23px on a phone, never taller than the line.

In raft-ui the three components take the box from one recipe (lib/inline-chip.ts).

A link that an app previews is a reference chip in the sentence, with the app's icon and the app's own title. Why it is a chip and not a card, and its loading and hover behavior, are in Navigation.

  • MessageReferenceChip variant="info" capped, rendered as a link that opens in a new tab: render={<a href="…" target="_blank" rel="noopener noreferrer" />}.
  • MessageReferenceIcon: the app's registered icon, an <img alt=""> served by Raft, first in the chip. It is 14px, centered on the chip, with 2px corners. It is a leading mark of the chip box (Chips in running text): 4.5px at each end, 4px to the label. The image is drawn to its edges, so it takes the same 4.5px as a status pixel (Alignment): its ink starts 4.5px from the chip's start, against about 4.8px after the last letter at the other end. Use it for any image or other non-svg icon: an <img> placed straight in the chip has no size of its own and sits on the text's baseline. Experimental, exported from @botiverse/raft-ui/wip.
  • MessageReferenceLabel: the app's title, as sent. Put it in the label, not straight in the chip: only the label truncates.
  • MessageReferenceSuffix: the link's host, wherever a touch can open the link (hidden any-pointer-coarse:inline). The title is the app's own words and may say anything ("GitHub PR"), so before someone follows a link they must be able to see where it goes. On a desktop the item card says it ("Stamp · stamp.build", PreviewCard), and wherever a finger can tap the link, the chip says it itself, since a tap opens it without a hover first (Touch screens). That includes a laptop with a touch screen, whose main pointer is a mouse: the query is any-pointer-coarse, any touch input at all, not pointer-coarse, the main one. This is the one place the host is shown by the inputs present rather than the main one, because a link someone can open without seeing where it goes is a safety problem, not a layout choice. The label truncates first. If the host alone is still too wide for the line, it loses its start, never its end: the end (…review.attacker.example) is the part that says where the link goes. Keep its characters in their order with dir="ltr" and unicode-bidi: isolate inside a right-to-left box, so the ellipsis lands at the start.
    • Write the link's full host, dropping only a leading www.. Never shorten it to the registered domain: a subdomain can belong to someone else (someone.github.io).
    • Write an internationalized host in its ASCII form (xn--…), so letters that look alike can't pass as another site.
  • capped stops the chip at min(100%, 24em), and the label truncates at the end. 24em of the chip's text is 294px on a desktop and 336px on a phone. In a 700px desktop message column, two full-length chips and a few words between them share a line, and three with shorter titles; on a 390px phone the line is narrower than 24em, so a long title takes one line of its own and never wraps inside the chip. Without capped a chip is as wide as its line, as before.
  • No state: the icon is always the app's, in its own colors, and the chip is always cyan.
message-reference/compositions/app-links

Until Raft knows that an app previews a link, it is an ordinary link: before the message's previews are first read, the client can't tell an app's link from any other. Once someone allows an app's previews and Raft reads them again, each of that app's links is MessageReferencePending capped until its preview arrives: a link icon and the address shortened to its host and path. It has the same ends, icon size and cap as the chip that replaces it, so only the icon and the words change.

message-reference/compositions/app-link-pending

Read receipts on a mention

When a message mentions an agent, the person who sent it wants to know whether the agent has read it. Once it has, a lime check appears at the mention's top right. Put MessageReferenceReadMark last inside the MessageReferenceText, after the name, with the words a screen reader says as its children (Read). The check is hidden from screen readers.

message-reference/compositions/read-indicators
  • Show nothing until the agent has read the message. A mark for "not read yet" on every new mention would be noise in each message, and the moment it changes is the one that matters.
  • Say it in the mention's hover card too: "Read" or "Not read yet", so a person can check any mention, marked or not.
  • On a touch screen there is no hover card, and tapping a mention opens the agent's profile, which belongs to no single message. There the check alone says it: no check means not read yet. Don't add a long press or a popup only for this line: a gesture for one line of text is more to learn than it tells. The check's own word ("Read") still reaches a screen reader.
  • The read mark is a bare Lucide check, 10px at stroke 2.5, with no light and no box around it, in read-mark: palette-lime-700 in light mode (6.2:1 on white), the online lime (presence-online) in dark mode (10.5:1 on the dark canvas). The online lime alone is 1.64:1 on white, too faint for a mark this small, so light mode takes the deeper step of the same hue.
  • It is not a status light. A light, a square with an ink edge, means presence; a check means read, so the two never look alike (Status).
  • It sits in the indicator's place at the mention's top right: its top on the mention's top, its 10px box starting 2px after the name's text, so it never covers the name. The mention reserves 10px after its text, as for the indicator, so the next word never runs under it and the line keeps its height; the check's box ends 2px into the word space, where the glyph has only its own empty padding.
  • Decided by stdrc on 2026-10-24: the online light with an ink check read as a black frame, too dark for a mark that only confirms; just a check. Lime alone is 1.64:1 on white, so light mode uses palette-lime-700 and dark mode keeps the online lime. It replaces the online light with an ink check (artin and stdrc, 2026-10-23, option Ik2 on the mention read mark board), which had replaced a muted check after the name that read as part of the text. MessageReferenceReadMark keeps its name and its API and now draws the bare check; it is stable, exported from @botiverse/raft-ui, and still re-exported from @botiverse/raft-ui/wip for existing imports.
message-reference/compositions/primary-references

Variants

VariantUse for
Full rowThe first message of a group: avatar, header and body
compactA continuation row: the next message from the same sender on the same day, without avatar and name
message-item/compositions/consecutive

States

StateLook
LocatedThe row on info-soft at once, fading out by 2s, with the located prop, driven by useLocated (Located). A search match, a checked row or an open menu keeps its own fill
FocusedAfter a jump started from the keyboard focuses the row (tabIndex={-1}, set by the caller), the 2px inset ring in foreground, square, and the toolbar; after a click, nothing. Never the browser's outline (Located)
Search matchThe whole row on info-soft while it holds a MessageItemSearchMatch
Selected, in multi-selectThe whole row on info-soft while its MessageMultiSelectCheckbox is checked
Agent workingA still yellow light on the avatar and the inline status (Working agents)
Sender left, removed or deletedA muted badge in MessageItemSenderBadges; a deleted agent's avatar is grayed and dimmed (grayscale, opacity-dimmed)
Sent by an assistantThe assistant's face on the sender's avatar and "sent by Friday" after the name; the words only on a continuation row
Retracted (sent by an assistant)Only a message an assistant sent can be retracted. A single record that can't be acted on: sender, time, both marks and its thread replies stay; the body is one line in foreground-hint
Reaction failedThe chip on warning-soft, with MessageReactionErrorIndicator announcing why
message-item/compositions/row-chrome
message-item/compositions/sender-state
message-item/compositions/avatar-status

Sent by an assistant

A person's assistant can send a message as that person: the message is theirs, and two marks say the assistant sent it (Identity and presence). The parts are experimental, exported from @botiverse/raft-ui/wip until the design is approved: MessageItemDelegatedAvatar, MessageItemDelegatedBy, MessageItemDelegatedByName and MessageItemDelegatedByButton. Put MessageItemDelegatedAvatar in the sender's md Avatar, with the assistant's 2xs Avatar in it, and MessageItemDelegatedBy after MessageItemSenderGroup; keep the sender in the group, which holds its 3rem. On a continuation row, put MessageItemDelegatedBy at the end of the text, as with MessageItemEdited, without the face. Such a message starts its own group (Conversation).

message-item/compositions/delegated-group
message-item/compositions/delegated-thread

When the assistant has been deleted, keep both marks: the default face in MessageItemDelegatedAvatar deleted, which grays and fades it over the row's surface, and "sent by a deleted assistant" as plain words in MessageItemDelegatedBy, without a name part, so none of it truncates or opens anything:

message-item/compositions/delegated-deleted

Only a message an assistant sent for its owner can be retracted, by the owner. A retracted message stays in the timeline as a single record that can't be acted on:

  • It keeps its sender, time, both marks (the face and "sent by Friday") and its thread replies, which people wrote and which stay readable.
  • Its body is one line in foreground-hint, "This message was retracted.", in place of the text. It isn't the person's words: it isn't Markdown, can't be selected to quote and isn't translated.
  • Its attachments, link previews, quoted messages and reactions are gone, and so are the hover toolbar (react, reply in thread, save, forward, more), the context menu and the long-press menu.
  • Wherever it is quoted, the quote shows the same line, styled like an unavailable quote (MessageQuotedPreview); an Activity row or a search result shows the same line as its excerpt, never the old text.
message-item/compositions/delegated-retracted

In an Activity row or a search result there is no face; write the words into the sender: "Alice (sent by Friday)".

message-item/compositions/delegated-preview

Behavior

  • Put something small that ends the message in MessageItemTrailing, never in a column beside the body (Trailing).
  • Space messages by grouping, on the timeline rhythm: 8px between the rows of one group (a continuation row sits under the row it continues) and the message step, 16px, before a new group. Every row keeps the row inset, 4px, above and below its text, and the extra 8px before a group is a transparent top border the highlight doesn't paint. The recipe reads both from the timeline tokens (py-timeline-row, border-t-(length:--spacing-timeline-turn)), so a change to the rhythm changes every row. So the hover, selected and search highlights sit evenly around the text on every row: when a continuation row had no top padding, its highlight touched the first line and left 8px under the last.
  • On hover the row lays fill-subtle over itself, the subtle tier of every row: a message can be many lines tall and is read with the pointer resting on it, so the step is small and the text keeps its contrast (Hover and press). It used to be lighter than other rows (3%); now a message steps like the rows and cards beside it. A message has no press: the row is not an action itself, a click selects text or lands on a link, a name or a button in it. A search-hit or selected message keeps info-soft on hover, and a located one doesn't answer hover while its highlight lasts.
  • While one of its popups is open (its context menu, from a right-click, the toolbar's button, or press and hold on a phone), the row lays fill-subtle over itself, the same tier as its hover, so the two never stack. A phone has no hover, so this fill is the sign of which message the menu acts on; it stays lighter than info-soft, so the message doesn't look selected.
  • The hover toolbar appears on hover, when focus is inside the row, and while one of its popups is open. It rides the top edge of the highlight, on the right. Focus on the row itself counts: when a jump started from the keyboard focuses the row, its toolbar shows, so a keyboard user sees the message's actions and reaches them with Tab, through the message's links and buttons.
  • Hover never moves the message. The toolbar floats over the row's top right corner and nothing reflows to make room for it, so the line someone is reading stays where it was.
  • The time belongs to the sender: who said it and when read as one, so the time follows the name, its badges and its role, never pushed to the far right. The one exception is a touch screen's time reveal, where dragging the conversation left brings every message's time in at its row's right edge while the finger holds it (Conversation).
  • In a message column at least 48rem wide, the sender line keeps the right fifth of the row empty: everything on it, the description included, fits in the first 80%, and a long description truncates there (cindyz, 2026-11-13, slock #14749). The line is a label for the message, and a description running to the far edge read as a sentence across the page. The room is a share of the row, not a fixed length, so a wider window keeps more of it free. It is measured on the message's own column (MessageItemContent is the message container), so a thread or any column narrower than 48rem keeps the full width, as a phone does. The header leaves the room as padding at its end, so the hover fade, drawn from the header's end under the toolbar, still covers the toolbar's corner and never the time.
  • The header keeps no room for the toolbar (stdrc, 2026-10-22). At rest the sender line has the full width, so the whole name shows even in a 360px thread; while the toolbar shows, the end of a sender line long enough to reach the corner fades out under it: the header masks everything from 4px left of the toolbar's left edge to its own end, after a 12px fade, so no letter shows cut below or beside the card, which reaches only part of the line's height. MessageItemToolbar measures its own width onto the row (--mi-toolbar-width), so a toolbar with more or fewer actions masks exactly its width; nothing on the row moves. A row without a toolbar, such as on a phone, masks nothing. Keeping the room cut the name to a few letters in a narrow column all the time, to protect a corner that is covered only while the pointer is on that message; keeping it only on hover would reflow the line every time the pointer crosses a message. Slack and Discord work the same way.
  • MessageItemToolbar measures its width as the toolbar shows, not when the row mounts. The pointer entering the row, or focus moving into it, writes the width in that event, before the frame that shows the toolbar, so the first frame already fades the right width; a popup opens from the toolbar only after one of the two, so it finds the width written. While the toolbar shows, one observer shared by the whole page watches it, so a button added while it shows is measured again; once the pointer and focus have left the row and no popup is open, it stops watching, and with no toolbar showing no observer is left. Every message renders a toolbar and only the one under the pointer or focus needs its width, so measuring on show keeps long lists cheap: a row mounts in one commit and keeps no observer of its own. Measuring every row on mount took a second commit and a ResizeObserver per row, thousands in a long channel. Until then the toolbar writes the width of five buttons (164px) onto its row when it mounts, a plain write that reads nothing, so should the toolbar ever show before it has measured itself, the row fades too much rather than too little; a row without a toolbar gets no width and masks nothing. The fade shows under exactly the conditions the toolbar shows under, so a width left on the row never fades a header without the toolbar over it: a touch screen without hover shows neither after a tap, and a tap that focuses a button inside the row shows both.
  • When the sender line runs out of room, MessageItemSenderGroup gives way in a fixed order: the role truncates first, then the name. The badges stay whole beside the name, and the time never truncates (When a row runs out of room). Show the full name and role in a tooltip when they can truncate.
  • MessageItemDelegatedBy takes its own width up to 45% of the line; past that, only the assistant's name truncates. When its words alone are wider than that ("sent by a deleted assistant" on a phone), it is as wide as its words and the sender's name gives way instead: the words never truncate and never run under the time. The sender's name keeps at least 3rem, or all of it when shorter; when even that doesn't fit (a 360px thread panel), plain words wrap onto as many lines as they need, their first line on the name's baseline, and the time stays on the first line. The words around the name never truncate: the product's spaces around the name are kept as written, and a translation with words on both sides of the name (Chinese) keeps both whole.
message-item/compositions/delegated-long-names
  • The toolbar is 36px high on a touch screen, with 28px buttons, and 42px high with a mouse, with buttons at the control height (34px), like every desktop control (stdrc, 2026-11-05). Its icons are 16px, its buttons 4px from the frame and 4px apart, and its hairline is drawn inside that height. It rides the top edge of the highlight and reaches half its own height above it, 18px on a touch screen and 21px with a mouse, derived from the control height; on a group's first row the transparent 8px border takes part of that, so it reaches only 10px (13px with a mouse) beyond the row. On a continuation row it sits wholly above the row instead, its bottom edge on the row's top edge with no gap. A continuation row has no header to cover, so riding the edge put the toolbar over the first line of text, and a link at the end of that line could not be clicked while the row was hovered (huxijin, 2026-12-01; Kirby and Jasper). Where there is no room above, at the top of the scroll area or the window, it rides the edge as on a full row (data-straddle, set as it shows). Its buttons are MessageItemToolbarButton, not Button. It stays this compact because it appears on every message under the pointer: at 38px it covered the sender line and was clipped above the first message.
  • The toolbar keeps radius-container, like every popup. Its buttons are controls embedded in its frame, so they wear radius-chip, like the buttons in a field, the composer and a card corner; with a mouse, at the control height, they wear radius-control (Inside a frame).
  • Leave at least 18px (21px with a mouse) above the first message of a scroll area and above the root message of a thread, so the toolbar is never clipped. A timeline that opens with a date line already has the room.
  • A task row under a message opens the task. Status changes in the task's details, not from the row (Tasks in a conversation).
message-item/compositions/toolbar
message-item/compositions/long-header
message-item/compositions/reactions

Trailing

MessageItemTrailing holds something small that ends a message, such as the faces of the agents that read it with their read mark. Put it last in MessageItemBody:

message-item/compositions/trailing
  • It takes no column, so a row without it has the body's full width (Desktop density; stdrc, 2026-11-05). It sits at the inline end of the body's last line, centred on it, and the last line keeps room for it: the text wraps under it only when that line is full. When the body ends with a block that isn't text (a code block, a table, an image), it sits on a line of its own under that block, at the end.
  • It finds the body's last block itself (through a wrapper that only holds blocks, such as a markdown root) and marks it, and one observer shared by every slot keeps the room as wide as the slot. Don't reserve the room yourself.
  • Where its content can arrive later (reads come in realtime), render the slot empty from the first frame, with the width of its smallest content (min-w-*), so the room is there before the content and the row doesn't move when it arrives. A body that ends with a code block then keeps its line under the block from the start.
  • It is not MessageItemReadReceipt: the footer's read receipt says that the people a message mentions have read it, a marker beside the reactions; the trailing slot shows where each agent stopped reading, on the last message it read.
  • Known limits: a last line that ends in a line break gets one more line; a paragraph with dir="auto" in the other direction than the body puts the room at the wrong end; in a collapsed long message the slot is hidden with the body's end.

Toolbar for selected text

Text the person selects in a message gets a TextSelectionToolbar, with actions such as Quote and Copy. It is built like the hover toolbar, so the two read as one kind of thing; the one difference is that its buttons have text labels. Its look, its placement on the selection's focus line and its labels are in its own doc.

Content

  • Write the continuation time as the hour and minute only, in the person's 12-hour or 24-hour format, without AM or PM: 6:35, 18:35 (Writing). The gutter is the avatar's 35px column, and a two-digit hour (10:35, 18:35, 36.7px in Space Mono) reaches about 2px past it into the row's padding: the time is right-aligned to the text, so that is where it belongs. Don't widen the gutter for it, because that moves every message's text off the avatar column.
  • Write what MessageItemMeta holds in sentence case; leave it out when there is nothing (Member labels).
  • Put MessageItemEdited inside the last paragraph of the text, so it follows the last word ("(edited)"), and give it the edit time as its tooltip. It sits in the text, not in the header, because a continuation row has no header and an edit belongs to that one message.
  • Label each reaction chip with the reaction, the count and whether the person is among them.

Accessibility

  • MessageItem and its parts are plain elements built with Base UI useRender; use render to change the element, such as a link on MessageItemSenderButton.
  • MessageItem is an article named by its sender and its time: its aria-labelledby points at MessageItemSender (or MessageItemSenderButton) and MessageItemTime (or MessageItemContinuationTime), whichever the row renders, with ids raft-ui generates. A screen reader that lands on a message, by a jump or by its reading keys, announces an article named "Atlas 2:20 PM" before the text: whose message it is and when, in the order the header shows them. A continuation row shows no name, so it is named by its time. A row with neither, such as a receipt card in the text column, is a plain div, not an article: an article with no name is announced as a bare "article", which tells a screen reader user nothing; give it aria-label if it should be one. Pass aria-labelledby or aria-label to name a row yourself, and role to change the role, on MessageItem or on its render element; a render function's props can't be read, so with one, pass them on MessageItem. An id you give a part is the one the row points at. A sender button's name is its visible name, so don't give it an aria-label of its own: the row would read that instead.
  • Don't put messages in a list or render MessageItem as an li: role="article" replaces listitem, and a list may hold only list items. The timeline around them takes no list role (MessageList). Don't make it a feed either: a feed promises Page Down and Page Up from article to article, which the timeline doesn't implement.
  • A row takes focus only when a jump started from the keyboard lands on it (Located). raft-ui doesn't make the row focusable: the caller sets tabIndex={-1} on MessageItem before focus({ preventScroll: true }), and removes it when focus leaves, so a later click on the row doesn't take focus from the composer. It shows the inset ring then, never the browser's outline, and its toolbar; Tab goes on through the message's links and buttons, the toolbar's included. While the toolbar shows, its card covers part of the ring's top edge at the right, as it covers the highlight's: the ring still reads on the other three sides and most of the top, and moving the toolbar off the row's edge for focus alone would make it jump.
  • MessageItemTrailing comes after the text in the DOM, so a screen reader reads it after the message, never in the middle of a sentence. It can't be selected, so copying a message copies its text without the faces; name what it shows (aria-label on its group).
  • Give every MessageItemToolbarButton an aria-label in sentence case: Reply in thread, Save. The toolbar shows on keyboard focus, so Tab reaches it.
  • Each MessageItemToolbarButton shows its aria-label as a Tooltip on hover and on keyboard focus, as every icon-only button does (Button); pass the key in shortcut (a KbdShortcut at sm) and it follows the name. A tap shows none, so a touch screen never sees one. Pass tooltip to say something else, or tooltip={false} to leave it out. A button that already renders as a caller's own TooltipTrigger, such as the quick reaction button, adds none, so it never opens two. The open tooltip doesn't count as one of the row's popups: the toolbar still hides once the pointer and focus leave the row.
  • Name the quick reaction button for what a click does: "Like" with 👍, "React with 😂" with another emoji, and "Remove like" or "Remove 😂" once the person has given it, with aria-pressed and the selected look of their own reaction chip. That hovering opens the picker goes in its tooltip, not in its name (Conversation).
  • MessageReactionChip wraps Base UI Toggle: aria-pressed says whether the person reacted. Give it an aria-label; the drawn reaction inside is hidden (Brand).
  • Put the reason a reaction failed in MessageReactionErrorIndicator, a visually hidden role="status".
  • Give the toolbar over selected text an aria-label (TextSelectionToolbar).
  • Give MessageMultiSelectCheckbox a label that names the message, such as "Select message from Bugen".
  • Render a reference chip that opens something as a link, through render; the chip is a span by default. An app link opens in a new tab, with rel="noopener noreferrer".
  • Give an app's icon in MessageReferenceIcon an empty alt: the title beside it names the link.
  • Give the avatar image an empty alt: the name beside it already says who it is.
  • MessageItemDelegatedAvatar is aria-hidden: "sent by Friday" is plain text in the header, read in its order (name, role, "sent by Friday", time). When a product names the whole row (aria-label), it uses the same words. MessageItemDelegatedByButton is a <button>; render it as a link through render when it goes to a profile page.
  • While the toolbar shows, what fades out under it (the time, "sent by") can't be pointed at: the time's tooltip and MessageItemDelegatedByButton are reachable once the pointer leaves the toolbar, and always by keyboard, where they stay in the reading order.
  • Give MessageItemTime and MessageItemContinuationTime the moment in dateTime (ISO 8601), and the full date and time in a tooltip. A screen reader reads the header in the order it shows: name, badges, role, time.
  • The time a touch screen reveals when the conversation is dragged left is aria-hidden: the row's name already carries its time, so a screen reader would read it twice (Conversation). Every row that is an article has its time in its name, a continuation row included.

Rules

  • Put MessageItemDelegatedAvatar only on a person's avatar, never with a presence light (Avatar).
  • Don't frame a message, and don't give agents a bubble color. Only what is embedded (code blocks, attachments, action cards) looks like a card.
  • Put the reactions first in the footer, with the add button last.
  • Put the tasks created from a message above the footer, as a list of compact rows, not as a marker in the footer (Rows in a compact list).
  • Show one reaction chip per emoji. Put a reaction the person added on attention-soft.
  • Keep a chip's ink as far from its left edge as from its right (Alignment). A reference chip with an icon and a reaction split their padding evenly, 4.5px and 7px at each end, the same total and width as before: a Lucide icon leaves about as much space in its box as a letter beside it, and an emoji or an app's icon is drawn to its edges. The saved marker takes 5.5px before its bookmark, which is drawn 2.3px inside its box, and 6.5px after its text.
  • Put a note after a reference chip's label in MessageReferenceSuffix, not in a span of your own. It stays on the label's baseline in the layout and is drawn a quarter of the size difference higher, so the middles of the two x-heights meet; the label stays on the sentence's baseline.
  • Make a reaction chip 24px tall, with a 44px hit area (Spacing).
  • Make the saved marker the reactions' height, 24px, in the footer's type, text-footnote bold (13px on a desktop), with muted text on fill-muted. It shares a row with the reactions and the replies below it share its fill, so a smaller, lighter label (it was 22px at 12px semibold) read as a fainter grey though the colors were the same (stdrc, 2026-10-31).

API

MessageReferenceChip

PropTypeDefault
cappedStops the chip at `min(100%, 24em)`; a longer `MessageReferenceLabel` truncates at the end. For words Raft doesn't write, such as an app's title.boolean
variantMessageReferenceChipVariant"muted"
renderAllows 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.

MessageReferenceIndicator, MessageReferenceLabel

PropTypeDefault
renderAllows 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.

MessageReferencePending

PropTypeDefault
cappedThe same cap as `MessageReferenceChip`'s, so the chip that replaces it keeps its width.boolean
renderAllows 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.

MessageReferenceReadMark, MessageReferenceSuffix

The read receipt on a mention: a bare lime check (10px, no box) at the mention's top right, once the one mentioned has read the message. Put it last inside the mention, and render nothing until then. The check is decorative; `children` is what a screen reader says instead ("Read"), visually hidden.
PropTypeDefault
renderAllows 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.

MessageReferenceText

PropTypeDefault
variantMessageReferenceTextVariant"secondary"
renderAllows 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.

MessageReferenceUnavailable

PropTypeDefault
renderAllows 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.

MessageItem

One message: an `article` named by its sender and its time (`aria-labelledby` pointing at `MessageItemSender` or `MessageItemSenderButton`, then `MessageItemTime` or `MessageItemContinuationTime`). A row with neither, and no `aria-label` or `aria-labelledby`, is a plain `div`. Pass `role`, `aria-label` or `aria-labelledby` on MessageItem or on a `render` element to override either; a `render` function's props can't be read, so pass them on MessageItem then.
PropTypeDefault
compactboolean
locatedThe message someone just jumped to: the row shows `info-soft` at once and fades it out by `LOCATED_MS` (design/foundations/states.md#located). Pass `useLocated(request)`, which turns it off after `LOCATED_MS` and restarts it on the next jump; a search match, a checked row or an open popup keeps its own fill instead.booleanfalse
renderAllows 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.

MessageItemAttachments, MessageItemAvatarSlot

PropTypeDefault
renderAllows 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.

MessageItemBadge

PropTypeDefault
statusMessageItemBadgeStatus"read"
renderAllows 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.

MessageItemBadgeSeparator, MessageItemBody, MessageItemContent, MessageItemContinuationTime, MessageItemEdited, MessageItemEmbedded, MessageItemFooter, MessageItemGutter, MessageItemHeader, MessageItemInlineStatus, MessageItemMeta, MessageItemReadReceipt

PropTypeDefault
renderAllows 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.

MessageItemSavedIndicator

PropTypeDefault
iconOnlySquare icon-only affordance. Replaces the old `data-icon-only` attribute contract with an explicit prop.booleanfalse
renderAllows 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.

MessageItemSearchMatch, MessageItemSender, MessageItemSenderBadges, MessageItemSenderButton, MessageItemSenderGroup, MessageItemTime, MessageItemToolbar

PropTypeDefault
renderAllows 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.

MessageItemToolbarButton

An icon-only button of the hover toolbar. It shows its `aria-label` as a tooltip on hover and on keyboard focus, with `shortcut` after it; a tap shows none. Rendered as a caller's own `TooltipTrigger`, it adds none.
PropTypeDefault
activebooleanfalse
shortcutThe shortcut after the name in its tooltip: a `KbdShortcut` at `sm`.ReactNode
tooltipWhat its tooltip says: its `aria-label` by default. `false` leaves the tooltip out, for a caller that shows one of its own.ReactNode
renderAllows 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.

MessageMultiSelect

PropTypeDefault
renderAllows 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.

MessageMultiSelectCheckbox

PropTypeDefault
shape"circle" | "square"
checkedWhether the checkbox is currently ticked.booleanundefined
defaultCheckedWhether the checkbox is initially ticked.booleanfalse
disabledWhether the component should ignore user interaction.booleanfalse
formIdentifies the form that owns the hidden input. Useful when the checkbox is rendered outside the form.string
idThe id of the input element.string
indeterminateWhether the checkbox is in a mixed state: neither ticked, nor unticked.booleanfalse
inputRefA ref to access the hidden `<input>` element.((instance: HTMLInputElement | null) => void | (() => void | { [UNDEFINED_VOID_ONLY]: never; }) | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<HTMLInputElement | null>
nameIdentifies the field when a form is submitted.stringundefined
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button.booleanfalse
onCheckedChangeEvent handler called when the checkbox is ticked or unticked.(checked: boolean, eventDetails: CheckboxRootChangeEventDetails) => void
parentWhether the checkbox controls a group of child checkboxes.booleanfalse
readOnlyWhether the user should be unable to tick or untick the checkbox.booleanfalse
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)
requiredWhether the user must tick the checkbox before submitting a form.booleanfalse
uncheckedValueThe value submitted with the form when the checkbox is unchecked. By default, unchecked checkboxes do not submit any value, matching native checkbox behavior.string
valueThe checkbox's value. Identifies it within a [Checkbox Group](https://base-ui.com/react/components/checkbox-group), falling back to `name` when omitted. When submitting a form, a checked box submits `value`; with no `value`, it submits the native "on".string

Also takes the attributes of its element.

MessageReactionAddButton

PropTypeDefault
renderAllows 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.

MessageReactionChip

PropTypeDefault
defaultPressedWhether the toggle button is currently pressed. This is the uncontrolled counterpart of `pressed`.booleanfalse
disabledWhether the component should ignore user interaction.booleanfalse
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).booleantrue
onPressedChangeCallback fired when the pressed state is changed.(pressed: boolean, eventDetails: BaseToggle.ChangeEventDetails) => void
pressedWhether the toggle button is currently pressed. This is the controlled counterpart of `defaultPressed`.boolean
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)
valueA unique string that identifies the toggle when used inside a toggle group.string

Also takes the attributes of its element.

MessageReactionCount, MessageReactionErrorIndicator, MessageReactionGlyph

PropTypeDefault
renderAllows 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.

MessageReactionPickerContent

PropTypeDefault
portalPropsContextMenuPortalProps
alignHow to align the popup relative to the specified side.Align'center'
alignOffsetAdditional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment.number | OffsetFunction0
anchorAn element to position the popup against. By default, the popup will be positioned against the trigger.Element | VirtualElement | RefObject<Element | null> | (() => Element | VirtualElement | null)
arrowPaddingMinimum distance to maintain between the arrow and the edges of the popup.number5
childrenReactNode
collisionAvoidanceDetermines how to handle collisions when positioning the popup.CollisionAvoidance
collisionBoundaryAn element or a rectangle that delimits the area that the popup is confined to.Boundary'clipping-ancestors'
collisionPaddingAdditional space to maintain from the edge of the collision boundary.Padding5
disableAnchorTrackingWhether to disable the popup from tracking any layout shift of its positioning anchor.booleanfalse
finalFocusDetermines the element to focus when the menu is closed.boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void)
idstring
positionMethodDetermines which CSS `position` property to use."fixed" | "absolute"'absolute'
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)
sideWhich side of the anchor element to align the popup against. May automatically change to avoid collisions.Side'bottom'
sideOffsetDistance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment.number | OffsetFunction0
stickyWhether to maintain the popup in the viewport after the anchor element was scrolled out of view.booleanfalse

Also takes the attributes of its element.

MessageReactionPickerStatic, MessageReactionQuickButton, MessageReactionQuickRow

PropTypeDefault
renderAllows 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.

MessageReactionTooltipContent

PropTypeDefault
containerHTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null>
portalPropsTooltipPortalProps
alignHow to align the popup relative to the specified side.Align'center'
alignOffsetAdditional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment.number | OffsetFunction0
anchorAn element to position the popup against. By default, the popup will be positioned against the trigger.Element | VirtualElement | RefObject<Element | null> | (() => Element | VirtualElement | null)
arrowPaddingMinimum distance to maintain between the arrow and the edges of the popup.number5
collisionAvoidanceDetermines how to handle collisions when positioning the popup.CollisionAvoidance
collisionBoundaryAn element or a rectangle that delimits the area that the popup is confined to.Boundary'clipping-ancestors'
collisionPaddingAdditional space to maintain from the edge of the collision boundary.Padding5
disableAnchorTrackingWhether to disable the popup from tracking any layout shift of its positioning anchor.booleanfalse
positionMethodDetermines which CSS `position` property to use."fixed" | "absolute"'absolute'
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)
sideWhich side of the anchor element to align the popup against. May automatically change to avoid collisions.Side'top'
sideOffsetDistance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment.number | OffsetFunction0
stickyWhether to maintain the popup in the viewport after the anchor element was scrolled out of view.booleanfalse

Also takes the attributes of its element.

MessageReactionTooltipMeta, MessageReactionTooltipName, MessageReactionTooltipNames, MessageReactionTooltipNameText, MessageReactionTooltipSeparator

PropTypeDefault
renderAllows 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.

MessageItemDelegatedAvatar

ExperimentalThe assistant's face on its owner's avatar, in the corner a presence light takes: put it inside the owner's `md` `Avatar` with a `2xs` agent `Avatar` as its child. It is hidden from assistive technology, because `MessageItemDelegatedBy` already says who sent the message. Only on a person's avatar: an agent's corner is its presence light.
PropTypeDefault
deletedThe assistant was deleted: its face is grayed and faded, over the row's surface, never the owner's avatar.boolean
renderAllows 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.

MessageItemDelegatedBy, MessageItemDelegatedByButton, MessageItemDelegatedByName, MessageItemTrailing, MessageReferenceIcon

ExperimentalSays an assistant sent the message for its owner, the sender: "sent by Friday". Put it in `MessageItemHeader` after `MessageItemSenderGroup`, and the assistant's name in `MessageItemDelegatedByName` or `MessageItemDelegatedByButton`. The words, and the spaces around the name, come from the product. It takes at most 45% of the line: past that only the name truncates, never the words.
PropTypeDefault
renderAllows 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.

Changes

  • 0.107.3 · Design SystemA sticker's ink edge follows its size ([Shape › Stroke widths](https://raft-design.botiverse.build/foundations/shape/#stroke-widths)): a sticker that carries a label (a number, a word, or an icon that stands for one) and is under 24px tall takes a 1px ink edge, and in dark mode a 1px die-cut edge outside it. A larger sticker, or one with no label that relies on its edge for its shape, keeps 1.5px: buttons, the selected row, tab and segment, avatars and their corner marks (and an avatar stack's +N count), status pixels and attention dots. Changed in this release: Badge (appearance="solid"), SidebarItemCount, SidebarItemIndicator, AppRailItemBadge, the new count in MessageRepliesSummary, a mention of you (MessageReferenceText variant="primary"), and the Steps number.
  • 0.101.0 · Breaking ChangesMessageMultiSelectToolbar, MessageMultiSelectToolbarActions, ActivityInboxSelectionToolbar and ActivityInboxSelectionCount are removed ([SelectionToolbar](https://raft-design.botiverse.build/components/selection-toolbar/)). Their props types (MessageMultiSelectToolbarProps, MessageMultiSelectToolbarActionsProps, ActivityInboxSelectionToolbarProps, ActivityInboxSelectionCountProps) go with them. MessageMultiSelect, MessageMultiSelectCheckbox and ActivityInboxControls stay.
  • 0.35.0 · ChangedA search hit (searchHit: MessageItemSearchMatch, MarkdownMark, SearchMessageResultMatch) is a you fill with ink type, in the surrounding weight, with no ink ring, and 1px of fill above and below so descenders stay inside it. A mention of you keeps its sticker.
  • 0.34.0 · ChangedMessageReferenceReadMark is a bare 10px Lucide check (stroke 2.5) in read-mark, with no light and no box, 2px after the name; the mention reserves 10px after its text, as for the indicator. The API is unchanged.
  • 0.29.0 · ChangedMessageReferenceIndicator placement: right: -10px (was -6px) and top: 0; the mention keeps 10px after its text (was 8px), so the corner mark no longer overlaps the last letter.
  • 0.29.0 · ChangedMessageReferenceReadMark is exported from @botiverse/raft-ui (still from /wip too) and draws the online light with a check; its API is unchanged (children are what a screen reader says).
  • 0.25.0 · Design SystemAn app link shows its host wherever a touch can open it: a chip for a link that an app previews shows the link's host after its title (MessageReferenceSuffix) on any device with touch input, including a laptop with a touch screen. Write the full host, dropping only a leading www., never shortened to the registered domain, and an internationalized host in its ASCII form (xn--…). The title truncates first; if the host alone still doesn't fit, it loses its start, never its end. It applies to MessageItem and MessageReference.
  • 0.25.0 · Design SystemAn app link is a plain link until Raft knows an app previews it: before a message's previews are first read, an app's link is an ordinary link. Once someone allows an app's previews and Raft reads them again, each of that app's links is MessageReferencePending capped until its preview arrives. It applies to MessageItem.