MessageItem
Business-agnostic message row chrome and the body blocks composed inside it.
Controls
Scenario
Row
Footer
import {
Avatar,
MessageItem,
MessageItemAttachments,
MessageItemAvatarSlot,
MessageItemBody,
MessageItemContent,
MessageItemContinuationTime,
MessageItemEmbedded,
MessageItemFooter,
MessageItemGutter,
MessageItemHeader,
MessageItemInlineStatus,
MessageItemMeta,
MessageItemSender,
MessageItemSenderBadges,
MessageItemTime,
MessageItemToolbar,
MessageItemToolbarButton,
} from "raft-ui";
<>
<MessageItem>
<MessageItemAvatarSlot>
<Avatar size="md" type="human" />
</MessageItemAvatarSlot>
<MessageItemContent>
<MessageItemHeader>
<MessageItemSender />
<MessageItemSenderBadges />
<MessageItemMeta />
<MessageItemTime />
<MessageItemInlineStatus />
</MessageItemHeader>
<MessageItemBody />
<MessageItemAttachments />
<MessageItemEmbedded />
<MessageItemFooter />
</MessageItemContent>
<MessageItemToolbar>
<MessageItemToolbarButton />
</MessageItemToolbar>
</MessageItem>
<MessageItem compact>
<MessageItemGutter>
<MessageItemContinuationTime />
</MessageItemGutter>
<MessageItemContent>
<MessageItemBody />
</MessageItemContent>
<MessageItemToolbar>
<MessageItemToolbarButton />
</MessageItemToolbar>
</MessageItem>
</>1 selected
Copy, Forward, and Generate image are disabled in this isolated example because it has no selected-message payload.
Select this sentence to expose the Quote and Copy toolbar, without making text selection a message-row concern.
Select text to inspect the contextual actions.
compactboolean
Compact row layout that hides sender chrome and tightens the vertical rhythm.
...propsuseRender.ComponentProps<"div">
Stable message-row root. Keep the same root while composing transient UI parts.
| Prop | Type | Default | Description |
|---|---|---|---|
compact | boolean | — | Compact row layout that hides sender chrome and tightens the vertical rhythm. |
...props | useRender.ComponentProps<"div"> | — | Stable message-row root. Keep the same root while composing transient UI parts. |
...propsuseRender.ComponentProps<"mark">
Inline matched-text part. Rendering it also applies the reusable search-result surface to its containing MessageItem.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"mark"> | — | Inline matched-text part. Rendering it also applies the reusable search-result surface to its containing MessageItem. |
...propsuseRender.ComponentProps<"div">
Avatar gutter slot. Consumers own avatar interaction behavior and feedback. Keep this slot in select mode beside MessageMultiSelectCheckbox.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Avatar gutter slot. Consumers own avatar interaction behavior and feedback. Keep this slot in select mode beside MessageMultiSelectCheckbox. |
...propsuseRender.ComponentProps<"div">
Compact consecutive-row gutter used when compact hides sender chrome.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Compact consecutive-row gutter used when compact hides sender chrome. |
...propsuseRender.ComponentProps<"span">
Hover timestamp rendered inside MessageItemGutter for a compact row.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Hover timestamp rendered inside MessageItemGutter for a compact row. |
...propsuseRender.ComponentProps<"div">
Main row column.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Main row column. |
...propsuseRender.ComponentProps<"div">
Header layout for sender and row metadata.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Header layout for sender and row metadata. |
...propsuseRender.ComponentProps<"span">
Static sender name.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Static sender name. |
...propsuseRender.ComponentProps<"span">
Inline container for caller-owned Badge elements next to the sender.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Inline container for caller-owned Badge elements next to the sender. |
...propsuseRender.ComponentProps<"span">
Caller-owned header metadata, such as a role or agent type.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Caller-owned header metadata, such as a role or agent type. |
...propsuseRender.ComponentProps<"span">
Timestamp in the message header.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Timestamp in the message header. |
...propsuseRender.ComponentProps<"span">
Caller-owned transient header state, such as Converting.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Caller-owned transient header state, such as Converting. |
...propsuseRender.ComponentProps<"div">
Message content slot. Markdown, mentions, links, and product parsing stay caller-owned.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Message content slot. Markdown, mentions, links, and product parsing stay caller-owned. |
...propsuseRender.ComponentProps<"div">
Dedicated message region for media and files. Its content and workflow stay caller-owned.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Dedicated message region for media and files. Its content and workflow stay caller-owned. |
...propsuseRender.ComponentProps<"div">
Dedicated message region for embedded cards. Its content and workflow stay caller-owned.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Dedicated message region for embedded cards. Its content and workflow stay caller-owned. |
...propsuseRender.ComponentProps<"div">
Action toolbar revealed on row hover or when keyboard focus enters it via focus-within.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Action toolbar revealed on row hover or when keyboard focus enters it via focus-within. |
elevation"none" | "xs" | "sm"
Shadow elevation. Default "none" renders the passive state-marker form (white surface + border, no shadow); "xs"/"sm" opt into shadow-raft-xs/shadow-raft-sm.
iconOnlyboolean
Square icon-only affordance; replaces the old data-icon-only attribute contract with an explicit prop.
...propsuseRender.ComponentProps<"span">
Pinned saved marker shown on the row until the hover toolbar takes over.
| Prop | Type | Default | Description |
|---|---|---|---|
elevation | "none" | "xs" | "sm" | — | Shadow elevation. Default "none" renders the passive state-marker form (white surface + border, no shadow); "xs"/"sm" opt into shadow-raft-xs/shadow-raft-sm. |
iconOnly | boolean | — | Square icon-only affordance; replaces the old data-icon-only attribute contract with an explicit prop. |
...props | useRender.ComponentProps<"span"> | — | Pinned saved marker shown on the row until the hover toolbar takes over. |
...propsuseRender.ComponentProps<"span">
Footer read-receipt chip. Consumers provide the icon and label; visibility stays product-owned.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Footer read-receipt chip. Consumers provide the icon and label; visibility stays product-owned. |
status"read" | "unread"
Read or unread footer badge treatment.
...propsuseRender.ComponentProps<"span">
Footer badge with read and unread treatments. Labels and icons stay caller-owned.
| Prop | Type | Default | Description |
|---|---|---|---|
status | "read" | "unread" | — | Read or unread footer badge treatment. |
...props | useRender.ComponentProps<"span"> | — | Footer badge with read and unread treatments. Labels and icons stay caller-owned. |
...propsuseRender.ComponentProps<"span">
Decorative separator for adjacent footer badges.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Decorative separator for adjacent footer badges. |
variant"primary" | "secondary"
Visual treatment for inline reference text.
...propsuseRender.ComponentProps<"span">
Inline reference text. Source parsing and navigation stay product-owned.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "primary" | "secondary" | — | Visual treatment for inline reference text. |
...props | useRender.ComponentProps<"span"> | — | Inline reference text. Source parsing and navigation stay product-owned. |
variant"accent" | "muted" | "info" | "link"
Visual treatment for the chip-shaped reference surface.
...propsuseRender.ComponentProps<"span">
Chip-shaped inline reference surface. Resolution and navigation stay product-owned.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "accent" | "muted" | "info" | "link" | — | Visual treatment for the chip-shaped reference surface. |
...props | useRender.ComponentProps<"span"> | — | Chip-shaped inline reference surface. Resolution and navigation stay product-owned. |
...propsuseRender.ComponentProps<"span">
Inline reference surface while resolution is pending.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Inline reference surface while resolution is pending. |
...propsuseRender.ComponentProps<"span">
Optional label slot for a chip-style reference.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Optional label slot for a chip-style reference. |
...propsuseRender.ComponentProps<"span">
Optional child slot for caller-owned read-state or other reference-local status content.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Optional child slot for caller-owned read-state or other reference-local status content. |
...propsOmit<StyledProps<Toggle.Props>, "type">
Base UI toggle for adding or removing the caller-owned reaction. Supports controlled and uncontrolled pressed state.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | Omit<StyledProps<Toggle.Props>, "type"> | — | Base UI toggle for adding or removing the caller-owned reaction. Supports controlled and uncontrolled pressed state. |
...propsuseRender.ComponentProps<"span">
Screen-reader status and stable styling slot for caller-owned reaction failure copy.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Screen-reader status and stable styling slot for caller-owned reaction failure copy. |
...propsuseRender.ComponentProps<"span">
Reaction glyph slot for a native emoji or caller-provided icon.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Reaction glyph slot for a native emoji or caller-provided icon. |
...propsuseRender.ComponentProps<"span">
Numeric children bump for 180ms when their value changes, never on mount. Respects reduced motion. Non-numeric children remain static; native props, refs, and render substitution are preserved.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Numeric children bump for 180ms when their value changes, never on mount. Respects reduced motion. Non-numeric children remain static; native props, refs, and render substitution are preserved. |
...propsuseRender.ComponentProps<"div">
Inline layout for quick-reaction controls.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Inline layout for quick-reaction controls. |
...propsuseRender.ComponentProps<"div">
Inline picker layout for docs, fallback, or other non-portal surfaces. Its child buttons may still be caller-wired.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Inline picker layout for docs, fallback, or other non-portal surfaces. Its child buttons may still be caller-wired. |
...propsDropdownMenuContentProps
Base UI dropdown content for an interactive quick reaction overlay.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | DropdownMenuContentProps | — | Base UI dropdown content for an interactive quick reaction overlay. |
...propsTooltipContentProps
Base UI tooltip content for reactors.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | TooltipContentProps | — | Base UI tooltip content for reactors. |
...propsuseRender.ComponentProps<"span">
Container for reactor names in the tooltip.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Container for reactor names in the tooltip. |
...propsuseRender.ComponentProps<"span">
Single reactor-name slot in the tooltip.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Single reactor-name slot in the tooltip. |
...propsuseRender.ComponentProps<"span">
Text slot inside a reactor name.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Text slot inside a reactor name. |
...propsuseRender.ComponentProps<"span">
Decorative separator between tooltip names.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Decorative separator between tooltip names. |
...propsuseRender.ComponentProps<"span">
Tooltip meta slot for overflow information such as +N.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"span"> | — | Tooltip meta slot for overflow information such as +N. |
...propsuseRender.ComponentProps<"div">
Stateless multi-select structure root. Consumers own selection mode, selected IDs, and selection actions.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Stateless multi-select structure root. Consumers own selection mode, selected IDs, and selection actions. |
...propsuseRender.ComponentProps<"div">
Shared select-mode toolbar shell. Pass the selected count and consumer-owned Button or DropdownMenu actions as children.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | useRender.ComponentProps<"div"> | — | Shared select-mode toolbar shell. Pass the selected count and consumer-owned Button or DropdownMenu actions as children. |
checkedboolean
Controlled checked state for the per-row selector.
onCheckedChangeCheckboxProps['onCheckedChange']
Callback fired when the per-row selector is toggled.
...propsCheckboxProps
Styled per-row selector with native Checkbox props. Control it with checked and onCheckedChange.
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | Controlled checked state for the per-row selector. |
onCheckedChange | CheckboxProps['onCheckedChange'] | — | Callback fired when the per-row selector is toggled. |
...props | CheckboxProps | — | Styled per-row selector with native Checkbox props. Control it with checked and onCheckedChange. |
...propsToolbar.Root props
Selection-toolbar surface with Base UI keyboard navigation. Consumers own the Popover, range anchor, and visibility.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | Toolbar.Root props | — | Selection-toolbar surface with Base UI keyboard navigation. Consumers own the Popover, range anchor, and visibility. |
...propsToolbar.Separator props
Semantic separator between selection toolbar commands.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | Toolbar.Separator props | — | Semantic separator between selection toolbar commands. |