组件 · 消息
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.
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.
When to use
| Situation | Use |
|---|---|
| Something a person or an agent said | MessageItem |
| Something that happened: a date, a claim, a hand-off, a status change | An event line (SystemMessage), not a message |
| The replies to a message | MessageReplies, under the message |
| An agent needs a person's approval | A MessageActionCard inside the message |
| A message found by search, outside the conversation | The 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, a2xsAvatar in the corner a presence light takes.
MessageItemGutterwithMessageItemContinuationTime: 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, orMessageItemSenderButtonwhen the name opens a profile:text-subhead, bold. Only the button underlines on hover (Clickable text);MessageItemSenderBadges: theagenttag, 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 inMessageItemDelegatedByName, orMessageItemDelegatedByButtonwhen it opens the assistant's profile;MessageItemTime: right after the sender,text-mono-metainforeground-hint. A<time>: pass the moment indateTime;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, intext-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, withMessageReactionAddButtonlast), then the saved and read markers (MessageItemSavedIndicator,MessageItemReadReceipt).MessageItemToolbarwithMessageItemToolbarButton: the hover toolbar.MessageMultiSelectCheckboxandMessageMultiSelectToolbar, with its actions inMessageMultiSelectToolbarActions(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).MessageTextSelectionToolbarwithMessageTextSelectionToolbarButtonandMessageTextSelectionToolbarSeparator: actions on selected text (Toolbar for selected text);createMessageTextSelectionAnchorplaces it.
In the body
| Element | Part | Looks |
|---|---|---|
| A mention of someone else | MessageReferenceText | Ink, bold, underlined in ink on hover (Conversation) |
| A mention of the person reading; a search hit | MessageReferenceText variant="primary"; MessageItemSearchMatch | A small yellow sticker |
| A reference chip | MessageReferenceChip | variant="accent" for a channel or direct message, variant="info" for a thread or message (Navigation) |
| A reference that is loading or can't be opened | MessageReferencePending, MessageReferenceUnavailable | A gray chip on inactive-soft |
| A web link | Markdown link | foreground-link, underlined at rest (Markdown) |
| A task number | TaskChip or Space Mono text | Tasks |
| Inline code | InlineCode | Space Mono on fill-muted |
| A quote | Markdown blockquote | A 2px bar on the left, foreground-muted text |
| A code block | CodeBlock | layer-code with a hairline |
Variants
| Variant | Use for |
|---|---|
| Full row | The first message of a group: avatar, header and body |
compact | A continuation row: the next message from the same sender on the same day, without avatar and name |
States
| State | Look |
|---|---|
| Jumped to | The whole row on info-soft. raft-ui applies it when the row holds a MessageItemSearchMatch |
| Selected, in multi-select | The whole row on info-soft while its MessageMultiSelectCheckbox is checked |
| Agent working | A still yellow light on the avatar and the inline status (Working agents) |
| Sender left, removed or deleted | A muted badge in MessageItemSenderBadges; a deleted agent's avatar is grayed |
| Sent by an assistant | The assistant's face on the sender's avatar and "sent by Friday" after the name; the words only on a continuation row |
| Reaction failed | The chip on warning-soft, with MessageReactionErrorIndicator announcing why |
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).
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:
In an Activity row or a search result there is no face; write the words into the sender: "Alice (sent by Friday)".
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-subtleover 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 keepsinfo-softon 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-subtleover 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 thaninfo-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,
MessageItemSenderGroupgives 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. MessageItemDelegatedBytakes 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.
- 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 wearradius-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.
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-containerwith its hairline drawn inside (ring-inset), around 28px buttons withradius-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 thebrand-softof a menu row: a toolbar's actions are buttons, not menu rows (States). MessageTextSelectionToolbarSeparatoris 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 toPopoverContent'sanchor. - 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
MessageItemMetain sentence case; leave it out when there is none. - Put
MessageItemEditedinside 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
MessageItemand its parts are plain elements built with Base UIuseRender; userenderto change the element, such as a link onMessageItemSenderButton.- Give every
MessageItemToolbarButtonanaria-labelin Title Case: Reply in Thread, Add Reaction, Save. The toolbar shows on keyboard focus, so Tab reaches it. MessageReactionChipwraps Base UIToggle:aria-pressedsays whether the person reacted. Give it anaria-label; the drawn reaction inside is hidden (Brand).- Put the reason a reaction failed in
MessageReactionErrorIndicator, a visually hiddenrole="status". MessageTextSelectionToolbarwraps Base UIToolbar; give it anaria-label.- Give
MessageMultiSelectCheckboxa 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 aspanby default. - Give the avatar image an empty
alt: the name beside it already says who it is. MessageItemDelegatedAvatarisaria-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.MessageItemDelegatedByButtonis a<button>; render it as a link throughrenderwhen it goes to a profile page.- Give
MessageItemTimeandMessageItemContinuationTimethe moment indateTime(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
MessageItemDelegatedAvataronly 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 | 类型 | 默认值 |
|---|---|---|
| MessageReferenceChipVariant | "muted" | |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageReferenceIndicator, MessageReferenceLabel, MessageReferencePending
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageReferenceText
| Prop | 类型 | 默认值 |
|---|---|---|
| MessageReferenceTextVariant | "secondary" | |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageReferenceUnavailable
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageItem
| Prop | 类型 | 默认值 |
|---|---|---|
| boolean | ||
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageItemAttachments, MessageItemAvatarSlot
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageItemBadge
| Prop | 类型 | 默认值 |
|---|---|---|
| MessageItemBadgeStatus | "read" | |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageItemBadgeSeparator, MessageItemBody, MessageItemContent, MessageItemContinuationTime, MessageItemEdited, MessageItemEmbedded, MessageItemFooter, MessageItemGutter, MessageItemHeader, MessageItemInlineStatus, MessageItemMeta, MessageItemReadReceipt
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageItemSavedIndicator
| Prop | 类型 | 默认值 |
|---|---|---|
| Square icon-only affordance. Replaces the old `data-icon-only` attribute contract with an explicit prop. | boolean | false |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageItemSearchMatch, MessageItemSender, MessageItemSenderBadges, MessageItemSenderButton, MessageItemSenderGroup, MessageItemTime, MessageItemToolbar
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageItemToolbarButton
| Prop | 类型 | 默认值 |
|---|---|---|
| boolean | false | |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageMultiSelect
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageMultiSelectCheckbox
| Prop | 类型 | 默认值 |
|---|---|---|
| "circle" | "square" | ||
| Whether the checkbox is currently ticked. | boolean | undefined |
| Whether the checkbox is initially ticked. | boolean | false |
| Whether the component should ignore user interaction. | boolean | false |
| Identifies the form that owns the hidden input. Useful when the checkbox is rendered outside the form. | string | |
| The id of the input element. | string | |
| Whether the checkbox is in a mixed state: neither ticked, nor unticked. | boolean | false |
| A 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> | |
| Identifies the field when a form is submitted. | string | undefined |
| Whether 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. | boolean | false |
| Event handler called when the checkbox is ticked or unticked. | (checked: boolean, eventDetails: CheckboxRootChangeEventDetails) => void | |
| Whether the checkbox controls a group of child checkboxes. | boolean | false |
| Whether the user should be unable to tick or untick the checkbox. | boolean | false |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) | |
| Whether the user must tick the checkbox before submitting a form. | boolean | false |
| The value submitted with the form when the checkbox is unchecked. By default, unchecked checkboxes do not submit any value, matching native checkbox behavior. | string | |
| The 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
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageReactionChip
| Prop | 类型 | 默认值 |
|---|---|---|
| Whether the toggle button is currently pressed. This is the uncontrolled counterpart of `pressed`. | boolean | false |
| Whether the component should ignore user interaction. | boolean | false |
| Whether 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>`). | boolean | true |
| Callback fired when the pressed state is changed. | (pressed: boolean, eventDetails: BaseToggle.ChangeEventDetails) => void | |
| Whether the toggle button is currently pressed. This is the controlled counterpart of `defaultPressed`. | boolean | |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) | |
| A unique string that identifies the toggle when used inside a toggle group. | string |
Also takes the attributes of its element.
MessageReactionCount, MessageReactionErrorIndicator, MessageReactionGlyph
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageReactionPickerContent
| Prop | 类型 | 默认值 |
|---|---|---|
| ContextMenuPortalProps | ||
| How to align the popup relative to the specified side. | Align | 'center' |
| Additional 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 | OffsetFunction | 0 |
| An element to position the popup against. By default, the popup will be positioned against the trigger. | Element | VirtualElement | RefObject<Element | null> | (() => Element | VirtualElement | null) | |
| Minimum distance to maintain between the arrow and the edges of the popup. | number | 5 |
| ReactNode | ||
| Determines how to handle collisions when positioning the popup. | CollisionAvoidance | |
| An element or a rectangle that delimits the area that the popup is confined to. | Boundary | 'clipping-ancestors' |
| Additional space to maintain from the edge of the collision boundary. | Padding | 5 |
| Whether to disable the popup from tracking any layout shift of its positioning anchor. | boolean | false |
| Determines the element to focus when the menu is closed. | boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void) | |
| string | ||
| Determines which CSS `position` property to use. | "fixed" | "absolute" | 'absolute' |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) | |
| Which side of the anchor element to align the popup against. May automatically change to avoid collisions. | Side | 'bottom' |
| Distance 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 | OffsetFunction | 0 |
| Whether to maintain the popup in the viewport after the anchor element was scrolled out of view. | boolean | false |
Also takes the attributes of its element.
MessageReactionPickerStatic, MessageReactionQuickButton, MessageReactionQuickRow
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageReactionTooltipContent
| Prop | 类型 | 默认值 |
|---|---|---|
| HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | ||
| TooltipPortalProps | ||
| How to align the popup relative to the specified side. | Align | 'center' |
| Additional 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 | OffsetFunction | 0 |
| An element to position the popup against. By default, the popup will be positioned against the trigger. | Element | VirtualElement | RefObject<Element | null> | (() => Element | VirtualElement | null) | |
| Minimum distance to maintain between the arrow and the edges of the popup. | number | 5 |
| Determines how to handle collisions when positioning the popup. | CollisionAvoidance | |
| An element or a rectangle that delimits the area that the popup is confined to. | Boundary | 'clipping-ancestors' |
| Additional space to maintain from the edge of the collision boundary. | Padding | 5 |
| Whether to disable the popup from tracking any layout shift of its positioning anchor. | boolean | false |
| Determines which CSS `position` property to use. | "fixed" | "absolute" | 'absolute' |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) | |
| Which side of the anchor element to align the popup against. May automatically change to avoid collisions. | Side | 'top' |
| Distance 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 | OffsetFunction | 0 |
| Whether to maintain the popup in the viewport after the anchor element was scrolled out of view. | boolean | false |
Also takes the attributes of its element.
MessageReactionTooltipMeta, MessageReactionTooltipName, MessageReactionTooltipNames, MessageReactionTooltipNameText, MessageReactionTooltipSeparator
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageTextSelectionToolbar
| Prop | 类型 | 默认值 |
|---|---|---|
| boolean | ||
| If `true`, using keyboard navigation will wrap focus to the other end of the toolbar once the end is reached. | boolean | true |
| The orientation of the toolbar. | BaseToolbar.Orientation | 'horizontal' |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageTextSelectionToolbarButton
| Prop | 类型 | 默认值 |
|---|---|---|
| When `true` the item is disabled. | boolean | false |
| When `true` the item remains focusable when disabled. | boolean | true |
| Whether 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>`). | boolean | true |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageTextSelectionToolbarSeparator
| Prop | 类型 | 默认值 |
|---|---|---|
| The orientation of the separator. Defaults to the opposite of the toolbar's orientation, so a horizontal toolbar renders vertical separators. | BaseToolbar.Orientation | 'horizontal' |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageItemDelegatedAvatar
| Prop | 类型 | 默认值 |
|---|---|---|
| The assistant was deleted: its face is grayed and faded, over the row's surface, never the owner's avatar. | boolean | |
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
MessageItemDelegatedBy, MessageItemDelegatedByButton, MessageItemDelegatedByName
| Prop | 类型 | 默认值 |
|---|---|---|
| Allows you to replace the component's HTML element with a different tag, or compose it with another component. | ReactElement | ((props, state) => ReactElement) |
Also takes the attributes of its element.
相关组件
改动
- 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(withdeleted) andMessageQuotedPreviewAuthorDelegatedBy. - 0.12.0 · Fixed
MessageItemSenderGroup: the gap before a role squeezed to nothing collapses with it. - 0.10.3 · Added
MessageItemSenderGroupwraps 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 · Added
MessageItemEdited: an inline "(edited)" marker at the end of the message text, on every row. - 0.10.3 · Changed
MessageItemTimesits 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 whereverMessageItemTimeis used, also withoutMessageItemSenderGroup; wrap the name, badges and role in it to get the give-way order. - 0.10.3 · Changed
MessageItemTimeandMessageItemContinuationTimerender a<time>element and takedateTime. - 0.10.3 · FixedA long name no longer pushes the time out of the header (it was cut to "14:3"):
MessageItemSender/MessageItemSenderButtoncan shrink now.