Raft 设计系统

组件 · 消息

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.

稳定也叫 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: the sender's role, such as Product & Brand;
    • 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 "Converting…" while a message becomes a task. 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.
  • MessageItemAttachments: files and images (MessageAttachment).
  • MessageItemEmbedded: code blocks, action cards and link cards.
  • MessageItemFooter: one row: the task marker, then the reactions (MessageReactionChip, with MessageReactionAddButton last), then the saved and read markers (MessageItemSavedIndicator, MessageItemReadReceipt).
  • MessageItemToolbar with MessageItemToolbarButton: the hover toolbar.
  • MessageMultiSelectCheckbox and MessageMultiSelectToolbar, with its actions in MessageMultiSelectToolbarActions (28px buttons 4px apart; on a touch screen each takes a 44px tap, and reaches only half the gap toward its neighbour, so a tap between two lands on the nearer): selecting several messages (Built from existing parts).
  • MessageTextSelectionToolbar with MessageTextSelectionToolbarButton and MessageTextSelectionToolbarSeparator: actions on selected text (Toolbar for selected text); createMessageTextSelectionAnchor places it.

In the body

ElementPartLooks
A mention of someone elseMessageReferenceTextInk, bold, underlined in ink on hover (Conversation)
A mention of the person reading; a search hitMessageReferenceText variant="primary"; MessageItemSearchMatchA small yellow sticker
A reference chipMessageReferenceChipvariant="accent" for a channel or direct message, variant="info" for a thread or message (Navigation)
A reference that is loading or can't be openedMessageReferencePending, MessageReferenceUnavailableA gray chip on inactive-soft
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

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
Jumped toThe whole row on info-soft. raft-ui applies it when the row 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
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
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

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

  • 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 jumped-to, search-hit or selected message keeps info-soft on hover.
  • 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.
  • Hover only adds; it never takes information away. Hovering a message is the moment someone wants to know about it, so the toolbar appears in empty space instead of covering what was there.
  • 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, and stays there on hover. The top right corner belongs to the toolbar alone.
  • With a mouse, the header ends where the toolbar begins, so the toolbar covers nothing on the sender line however long it is. The space is set by --mi-toolbar-reserve, sized for three buttons; a product whose toolbar has more sets it on the message list. On a touch screen there is no hover toolbar, and the header keeps its full width.
  • 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, with room for the toolbar), 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, clear of the toolbar. 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: 28px buttons with 16px icons, 4px from the frame and 4px apart, with its hairline drawn inside that height. It rides the top edge of the highlight and reaches 18px above it, half its height; on a group's first row the transparent 8px border takes part of that, so it reaches only 10px beyond the row. 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 (Inside a frame).
  • Leave at least 18px 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.
  • The task marker opens the task. Status changes in the task, not from the marker.
message-item/compositions/toolbar
message-item/compositions/long-header
message-item/compositions/reactions

Toolbar for selected text

MessageTextSelectionToolbar floats over text the person selects in a message, with actions such as Quote and Copy. It looks exactly like the hover toolbar, so the two read as one kind of thing:

  • It is 36px high: radius-container with its hairline drawn inside (ring-inset), around 28px buttons with radius-chip, 4px from the frame and 4px apart.
  • Its buttons have text labels after 16px icons in foreground-muted. On hover they take the medium tier, fill-medium, not the brand-soft of a menu row: a toolbar's actions are buttons, not menu rows (States).
  • MessageTextSelectionToolbarSeparator is 20px high, with the toolbar's 4px on each side.
  • Write labels in Title Case. They never wrap: Chinese text can break between any two characters, so a toolbar squeezed at the edge of the window broke a two-character label onto two lines.
  • It anchors to the line where the selection's focus end is, where the person let go, not to the whole range: a whole-line or multi-paragraph selection spans the row, and the middle of that is nowhere near the pointer. Build the anchor with createMessageTextSelectionAnchor(selection) and pass it to PopoverContent's anchor.
  • It stays inside the viewport: above the line by default, it flips below when there is no room and shifts along the line near a side edge.

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 the role in MessageItemMeta in sentence case; leave it out when there is none.
  • 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.
  • Give every MessageItemToolbarButton an aria-label in Title Case: Reply in Thread, Add Reaction, Save. The toolbar shows on keyboard focus, so Tab reaches it.
  • 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".
  • MessageTextSelectionToolbar wraps Base UI Toolbar; give it an aria-label.
  • 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.
  • 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.
  • 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.

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 task marker first in the footer, then the reactions, with the add button last.
  • Make the task marker a status chip: the status pixel, the task number and the assignee (Tasks).
  • Show one reaction chip per emoji. Put a reaction the person added on attention-soft.
  • Make a reaction chip 24px tall, with a 44px hit area (Spacing).

API

MessageReferenceChip

Prop类型默认值
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, MessageReferencePending

Prop类型默认值
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

Prop类型默认值
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

Prop类型默认值
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

Prop类型默认值
compactboolean
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

Prop类型默认值
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

Prop类型默认值
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

Prop类型默认值
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

Prop类型默认值
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

Prop类型默认值
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

Prop类型默认值
activebooleanfalse
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

Prop类型默认值
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

Prop类型默认值
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.

MessageMultiSelectToolbar, MessageMultiSelectToolbarActions, MessageReactionAddButton

Shared select-mode toolbar shell. Consumers compose the count and actions as children.
Prop类型默认值
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

Prop类型默认值
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

Prop类型默认值
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

Prop类型默认值
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

Prop类型默认值
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

Prop类型默认值
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

Prop类型默认值
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.

MessageTextSelectionToolbar

Prop类型默认值
disabledboolean
loopFocusIf `true`, using keyboard navigation will wrap focus to the other end of the toolbar once the end is reached.booleantrue
orientationThe orientation of the toolbar.BaseToolbar.Orientation'horizontal'
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.

MessageTextSelectionToolbarButton

Prop类型默认值
disabledWhen `true` the item is disabled.booleanfalse
focusableWhenDisabledWhen `true` the item remains focusable when disabled.booleantrue
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
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.

MessageTextSelectionToolbarSeparator

Prop类型默认值
orientationThe orientation of the separator. Defaults to the opposite of the toolbar's orientation, so a horizontal toolbar renders vertical separators.BaseToolbar.Orientation'horizontal'
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

实验性The 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.
Prop类型默认值
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

实验性Says 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.
Prop类型默认值
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.

改动

  • 0.20.0 · Breaking ChangesMessageMultiSelectToolbar: 36px tall (was 48) with 28px buttons (was 32) 4px from the frame; on a touch screen each button takes a 44px tap. The buttons go in the new MessageMultiSelectToolbarActions.
  • 0.12.0 · AddedA message an assistant sent for its owner, from @botiverse/raft-ui/wip: MessageItemDelegatedBy, MessageItemDelegatedByName, MessageItemDelegatedByButton, MessageItemDelegatedAvatar (with deleted) and MessageQuotedPreviewAuthorDelegatedBy.
  • 0.12.0 · FixedMessageItemSenderGroup: the gap before a role squeezed to nothing collapses with it.
  • 0.10.3 · AddedMessageItemSenderGroup wraps the name, badges and role and sets the order they give way in when the header is too narrow: the role truncates first, then the name; badges keep their width and the time never truncates. Existing headers without it keep working.
  • 0.10.3 · AddedMessageItemEdited: an inline "(edited)" marker at the end of the message text, on every row.
  • 0.10.3 · ChangedMessageItemTime sits right after the sender (name, badges, role) instead of at the far right, and no longer fades out under the hover toolbar: hover only adds, it never hides who said it or when. With a mouse the header keeps the toolbar's width free (--mi-toolbar-reserve, default 6.5rem for three buttons; set it on the list when the toolbar has more). This is visible wherever MessageItemTime is used, also without MessageItemSenderGroup; wrap the name, badges and role in it to get the give-way order.
  • 0.10.3 · ChangedMessageItemTime and MessageItemContinuationTime render a <time> element and take dateTime.
  • 0.10.3 · FixedA long name no longer pushes the time out of the header (it was cut to "14:3"): MessageItemSender / MessageItemSenderButton can shrink now.