Components · Agents
MessageActionCard
A card an agent attaches to its message with an action already filled in, for a person to confirm; afterwards it records who did it and when.
import { MessageActionCard } from "@botiverse/raft-ui";An action card is how an agent asks for something it may not do alone: create a channel, add people, merge, publish, spend money. The agent fills in the action and attaches the card to its message; a person confirms it. Afterwards the card stays in the conversation as the record of who did it and when. A request waiting for someone is also listed in Activity (Hand-offs and approvals).
When to use
Anatomy
MessageActionCard: the card, inside the body of the agent's message: an item card, at most 400px wide and the message's width on a phone (Cards in messages). Required.MessageActionCardHeader: the top row. Required.MessageActionCardHeaderIcon: the kind of action, in a neutral tile like ansmIconTile.MessageActionCardHeaderTitle: what will be done.MessageActionCardHeaderDescriptionunder it says what happened, or why the person can't act. It takes only aHelperText(helperText(content, { why, about }), rendered withdata-whyanddata-about): who acted isaudience, "Nothing was changed" isconsequence, "Join this channel to act" isrecovery(Writing › Helper text).MessageActionCardHeaderMeta: the time the card records, in Space Mono at the hint tier. At the end of the description, inside itsHelperText's content, it closes that line ("Approved by Martin · 10:51"); directly in the title, alone, it is a line of its own under the title. It stays in view while the card is folded.MessageActionCardStatus: where the card stands, as a pixel and a word: what it waits for (Waiting, Members changing) or how it ended (Done). Whom it waits on is not in the header but in the action row (Waiting on someone).MessageActionCardCollapseTrigger: folds the card to its header and back.
MessageActionCardContent: everything under the header; it folds.MessageActionCardNotice: a standing note from Raft about consequences or permissions. At most one.MessageActionCardProperties,MessageActionCardProperty,MessageActionCardPropertyLabel,MessageActionCardPropertyValue: the values the person checks, as a description list (DescriptionList): the label beside its value, and above it only when a value doesn't fit beside its label, at any width, as in a DescriptionList (Labels go above only when a value doesn't fit).MessageActionCardHintLabel,MessageActionCardHint: the agent's own note, such as its reason or what it filled in.MessageActionCardHinttakes only aHelperText(helperText(content, { why, about }), rendered withdata-whyanddata-about).MessageActionCardScopeList,MessageActionCardScopeListLabel,MessageActionCardScopeListViewport,MessageActionCardScope,MessageActionCardScopeName,MessageActionCardScopeDescription: the permissions an app asks for.MessageActionCardScopeDescriptiontakes only aHelperText(helperText(content, { why, about }), rendered withdata-whyanddata-about): what the permission lets the app see or do isaudience.MessageActionCardActions: the buttons, withMessageActionCardActionsNote(aHelperText(helperText(content, { why, about }), rendered withdata-whyanddata-about)) before them, on a line of its own above them: beside two buttons in a 400px card a note had about 150px and pushed the confirm button onto a line of its own. For a person who can't act, the row holds only the note, which says whom the card waits on (Waiting on someone).MessageActionCardCompletion: the record of who did it and when.
Waiting on someone
A person who can't act on the card sees no buttons, so the action row is where it says who can: MessageActionCardActions with only a MessageActionCardActionsNote, "Waiting on Martin to answer" (helperText(..., { why: "audience", about: "request" })), and the header's status is the one neutral word Waiting (MessageActionCardStatus variant="muted"). The name is the person's display name in full, a MessageReferenceText variant="secondary" that opens the person, as names do everywhere else; a role (Waiting on an admin to answer) is plain text. Every card says "to answer", a confirmation as much as a question: to the reader, each is waiting on that person's reply, and one verb keeps each kind of card from finding its own. The note starts at the content's start edge and wraps around a long name; the row keeps no room for buttons. The person the card waits on sees the buttons and no status.
Whom it waits on is not in the status: in a 390px card the status takes the width it needs, and a long name there left the title about 92px wide. In the action row, empty for this reader, the name has the card's width and the title keeps its own (#proj-raft-ui:#338, 2026-11-30).
States
Each state's words, tone and record line are in Cards in messages. There is no View only: a card the person can't act on stays open and says whom it waits on, in its action row.
- When the action fails, show a toast and leave the card as it was, so the person can try again (Toast).
Behavior
- The card is open by default. Fold a settled card with
defaultOpen={false}; a card waiting on someone else stays open; the collapse trigger opens it again. - A long list of permissions scrolls inside its own area, at most 136px tall, so the card doesn't grow with it. The cap cuts through a line of text, so the cut reads as more below: through the third permission's name when the descriptions take one line, through the last line of the second when they take two. A cap that ends between two rows, or under the last pixels of a line, reads as the end of the list.
Content
- Title the card with a verb and its object, in sentence case: Create channel #launch-week, Merge #26 into main.
- Name people and agents by display name, without @: Approve Linear for Lumen, Created by Ada → Release Bot. The @ handle is for mentions, which notify; a card that names someone notifies no one, and a display name is what the person sees everywhere else (#proj-apps:#41, 2026-11-06).
- Make the confirm button repeat the verb and the object of the title, in sentence case: Create channel. Unlike a dialog's button, it keeps the object, because it appears away from a dialog title and has to say on its own which action it approves (Writing).
- List only the properties the person needs to check.
- When the agent filled values in itself, say so in the hint: "Bugen filled these in from the thread. You can change them before it's created."
- Record the result with the person and the time: Approved by Martin · 10:51. Put the time in
MessageActionCardHeaderMeta, not as text of the description: it is data, a note like a message's time (Color tiers), and the description is for the words.
Accessibility
MessageActionCard wraps Base UI's Collapsible: the collapse trigger and the folding content follow it.
- Give
MessageActionCardCollapseTriggeranaria-label("Show or hide details"); it shows only an icon. - Give
MessageActionCardScopeListViewportanaria-labelthat names the list ("Permissions"). It is a Tab stop only while it overflows, so keyboard users can scroll it. - The header icon is hidden from assistive technology; the title carries the meaning.
Rules
- Make the confirm button the small ink-bordered button (
Buttonat the defaultsize="md"), not pink: the screen's one pink button is the composer's send button. - Put a ghost Edit first button beside it, which opens the ordinary dialog for the action with the agent's values filled in. Don't edit fields on the card: the card is a summary.
- Run the action as the person who confirmed it.
- Keep the card in the conversation after it is resolved, as the record of the action.
- Show no buttons to someone without the permission to act. Say whom the card waits on instead, in the action row, and keep the header's status to Waiting.
- Keep a notice neutral, never in a warning color.
API
MessageActionCard
Also takes the attributes of its element.
MessageActionCardActions
Also takes the attributes of its element.
MessageActionCardActionsNote
Also takes the attributes of its element.
MessageActionCardCollapseTrigger
Also takes the attributes of its element.
MessageActionCardCompletion, MessageActionCardContent, MessageActionCardProperty, MessageActionCardPropertyLabel, MessageActionCardProperties, MessageActionCardPropertyValue, MessageActionCardHeader
Also takes the attributes of its element.
MessageActionCardHeaderDescription
Also takes the attributes of its element.
MessageActionCardHeaderIcon, MessageActionCardHeaderMeta, MessageActionCardHeaderStatus, MessageActionCardHeaderTitle
Also takes the attributes of its element.
MessageActionCardHint
Also takes the attributes of its element.
MessageActionCardHintLabel
Also takes the attributes of its element.
MessageActionCardNotice
Also takes the attributes of its element.
MessageActionCardScope
Also takes the attributes of its element.
MessageActionCardScopeDescription
Also takes the attributes of its element.
MessageActionCardScopeList, MessageActionCardScopeListLabel
Also takes the attributes of its element.
MessageActionCardScopeListViewport
Also takes the attributes of its element.
MessageActionCardScopeName
Also takes the attributes of its element.
MessageActionCardStatus
Also takes the attributes of its element.
Related
Changes
- 0.103.0 · Breaking ChangesExplanation slots take only a
HelperText:FieldDescription,FormSection'sdescription, aChoiceListitem'sdescription,SelectItemDescription,DialogDescription,AlertDialogDescription,DrawerDescription,PopoverDescription,EmptyStateDescription,CardDescription,CardFooter,BannerDescription,DialogFooterNote(work in progress),MessageActionCardHint,MessageActionCardHeaderDescription,MessageActionCardScopeDescriptionandMessageActionCardActionsNote. AHelperTextis made only byhelperText(content, { why, about }):contentis anyReactNode(a string, a formatted message, aTextLinkinside a sentence),whyis"consequence","audience"or"recovery", andaboutnames the thing the line is about. Each slot renders the content withdata-whyanddata-about, and in development warns once when it is given anything else, which it still renders.ToastDescription,NotificationCenterItemBody,EmptyStateTitle,ListRowDescriptionand the status and data parts are unchanged. - 0.95.3 · FixedA label/value list that switches layout on a resize no longer raises a ResizeObserver loop error ([DescriptionList › Labels go above only when a value doesn't fit](https://raft-design.botiverse.build/components/description-list/#labels-go-above-only-when-a-value-doesnt-fit)). A horizontal
DescriptionListandMessageActionCard's properties decide whether their labels go above their values (useLabelValueFit) in the next animation frame after a resize, instead of inside the ResizeObserver's callback; several resizes before that frame share one decision. The first frame, a label or value changing and a web font arriving are still decided before the paint. - 0.73.0 · ChangedEvery region that scrolls is a ScrollArea:
PanelScrollViewport,ActivityInboxViewport,SearchShellViewport,NotificationCenterScroller,FilesViewport,TasksPanelViewport, ChoiceList's scroller,MobileNavServerPopoverList,ComposerSuggestionList,AnnouncementDialogBody,MessageActionCardScopeListViewportandDialogNavshow ScrollArea's overlay scrollbar instead of the platform's. Native scrolling stays only in the places scroll-area.md lists, each with its reason, and a test fails on any other. - 0.10.7 · FixedIn
MessageActionCardProperties, a label lines up with the first line of its value instead of the middle of a value that wraps. - 0.5.63 · Added
MessageActionCardHeaderDescription: a line under the title, placed insideMessageActionCardHeaderTitle, for what happened on a Done or Declined card or why you cannot act on a View only one. It stays visible while the card is folded. - 0.5.63 · Changed
MessageActionCardHeaderaligns to the top: icon, status and collapse toggle line up with the title's first line when the title wraps or carries a description. - 0.5.63 · Changed
MessageActionCardNoticeis a tinted block (Elegant: soft fill, rounded; Brutal: inset fill, hairline border) meant to open the content, above the properties; it now carries a bottom margin instead of a top one. - 0.5.63 · Changed
MessageActionCardHintLabelandMessageActionCardScopeListLabelmatch the property label style in Elegant;MessageActionCardActionsNotereads in the foreground colour; the notice icon is centred on the first line.