Components
The two layers of raft-ui (core parts for any app, collaboration parts that carry Raft's product concepts), how to choose a component, and what is built from existing parts.
raft-ui's components come in two layers. Core holds the parts any app needs: buttons, fields, dialogs, tabs, tables, avatars. Collaboration holds the parts that carry Raft's own concepts: messages, threads, tasks, agents, Activity and notifications, search and files. This page says what each layer is for, which component to choose when several look right, and what to assemble from existing parts instead of designing anew. Each component's own doc says how to use it once chosen.
Two layers
Core
Core components are generic. They know nothing about messages, tasks or agents: their API speaks in values, items, slots and states, and they would work unchanged in an app that has none of Raft's concepts. Button, Field, Select, Dialog, Drawer, Tabs, Table, Markdown, Avatar and Status are core.
Core is grouped by what a part does:
Collaboration
Collaboration components embody Raft's collaboration domain. Each one carries a product concept and the rules that come with it: what a message shows under its body, how a thread is summarized under the message it started, which statuses a task moves through and in what order, what an agent's request for approval records once it is handled. They are built from core parts.
Collaboration is grouped by concept:
Why the split
- Core can be reused anywhere. Every Raft product (Raft Chat today; Tasks, Calendar and the others next) and any internal tool can take a core part without taking Raft's data model with it. raft-ui keeps this true in code: a core component never imports a collaboration one, while collaboration components are built on core ones.
- Each rule lives in one place. A rule about color, lines, shape or states belongs to a core part, and every product inherits it. A rule about a product concept (how many reply previews a thread shows, the order of the task statuses) belongs to the collaboration part that carries the concept, so changing the concept changes one component, not every screen that shows it.
- It tells you where to look. When you build something about messages, tasks, agents, Activity or notifications, start in collaboration: the part you need, or most of it, probably exists, and it already follows the product's rules. When you build something generic, stay in core, and don't borrow a collaboration part because it looks right. An InboxItem is the row for something that happened elsewhere; a list of settings uses ListRow, even though both are rows with an icon and a title.
Which layer a new component belongs to
Ask one question: would the part make sense in an app with no messages, tasks, agents, Activity or notifications?
- Yes: it is core. Name it for what it does (
Timelinewould be core if it did not know task statuses), give it no product props, and put it in the category of what it does. - No: its name, its props or its rules mention a Raft concept, so it is collaboration. Build it from core parts and put it in the category of its concept.
A core part that starts to need a product concept has become two parts: keep the generic one in core and build the product one on top of it in collaboration.
How to choose a component
Several components can look right for the same job. These tables pick one per situation, and each section starts with the question that decides it. Use them whenever you put a control, a message, a popup or a row on a screen. Products don't override these choices; a product-specific case goes on the product's page.
Picking something
Two questions decide a picker: when the choice takes effect, and how many values there are. A choice that stands alone applies at once (Switch, SegmentedControl, a Select in a settings row, a menu); a choice that is part of a form, or turns on a feature with fields to fill, waits for its Save (Checkbox, RadioGroup, a Select among fields) (Forms). Radio buttons show every answer, so they fit only a few; a select hides the values behind one field, so it fits more; past that people need to search. That count holds for a field among other fields in a form. When choosing is what a dialog is for (where to move an agent, whom to add), the choices stay open as a list at any count, so people can compare them without opening anything: a radio circle before each row for one choice, a checkbox for several, a filter field above it when people look for something they know by name (a person: always, since typing the name is fastest at any count) or when they choose by comparing and the list is longer than a glance (from 6 choices), and the list scrolls past that.
SegmentedControl and Tabs look alike, and the content decides between them: a segmented control shows the same content another way (Board or List), tabs switch to different content.
Telling people something
The scope of a message decides where it goes, and how long the situation lasts decides how long the message stays. The wider the scope, the further out it sits: an input's error under the input, a panel's problem under the panel header, a server's problem in the notification center (Feedback).
- Never put anything in a toast that would confuse people if they missed it. A toast disappears on its own, so it can only confirm what the person already expects.
Overlays
The more an overlay asks of people, the more of the screen it takes. What only informs opens on hover; a small choice opens next to what was clicked; something people look at for a while slides in with the page still behind it; what they must finish before going on sits in the center over a scrim.
- Put a scrim behind every centered overlay: dialogs, confirmations, search, task details, large forms. How overlays move is in Motion.
Waiting
The more you know about a wait, the more specific its indicator. A known layout is held by a skeleton, so nothing jumps when the content arrives; a known percentage is a progress bar; a wait with neither is the spinner; and a wait a button started stays on the button, where the person is already looking.
- Don't use pink for any of these. They are passive, and pink means something waits for the person.
- A usage limit isn't a wait: show how much of it is used with a Meter, not a progress bar, which turns
successwhen full. Every usage bar fills with what is used, never what is left (stdrc, 2026-10-29).
Rows
A row follows what it stands for, not where it appears: a place looks the same in the sidebar and in a phone list of places, and each other kind of row carries what its subject needs (the attention dot of something to see, the status chip of a task). Rows of the same kind are also the same size across an app's tabs (The same kind, the same size). Every row below except the task card and a ListRow in an inset group (settings, agents and people on a detail page) is a list cell: no dividers, the whole row the target, and its states on one inset rounded shape (Lists).
Scrolling
One question decides it: who renders the element that scrolls. When you do, it is a ScrollArea, never an element with overflow-auto or overflow-y-auto: a native scrollbar differs by platform, and a classic one takes room from the layout when it appears, so a list's inset turns uneven and a row's controls move. When another component renders it, bind that element.
- Keep a native scroller only for the cases ScrollArea lists, such as a
<pre>of code, and say which one in a// raft-ui: native-scroll <reason>comment on the line above: the lint ruleraft-ui/prefer-scroll-areareports every other one (Lint rules).
Built from existing parts
Some things in the product have no design of their own: they are assembled from existing components. Build them as described here, without new colors, shapes or lines. Each new container, color or line is one more thing people have to learn and one more thing the system has to keep consistent across light and dark, phone and desktop; a composite inherits its parts' states, dark mode and accessibility for free.
If what you need isn't here and no component fits, follow the six questions in the README before adding anything.
Task details
A centered Dialog, 960px wide, a workspace overlay outside Dialog's four sizes: a bar with the place and the task number, the title and the description, one row of properties (Status, Assignee, Created by) in a DescriptionList, for a task created from a message its Source, the History in a collapsed Timeline, then the task's discussion and a Composer. Its size and its bar are in Tasks. Opened from the Tasks page, the same parts stand in a column of the page's row instead of a dialog, with Expand in the bar (The open task).
File viewer
Every file someone opens from a message, whether an image, a PDF, text, Markdown, a table, a web page, a video or audio, opens in the same viewer: a Lightbox with a LightboxToolbar on top and the file's own body below. Only the body changes with the type. People learn where a file's actions are once, and it holds for every file.
- The toolbar is the same for every type: the type badge, the file name, then the actions in a fixed order (Comments, Copy, Download, then Close last). An action that doesn't apply to a file is left out; the rest keep their order.
- On a phone the toolbar keeps the file name, one More menu and Close. Comments, Copy and Download move into the menu; when Download is the only action, it stays as its own button. The type badge and the gallery count drop out, because the name needs the room and the thumbnails already show the position.
- Comments on a document the viewer renders sit in a margin beside it, level with their passages; on a narrow viewer, markers beside the passages open them in a bottom sheet (Comments).
- Plain text sits in the CodeBlock frame, but its lines wrap. A file in the viewer is read top to bottom, and find in page has to reach every line. A snippet in a message still scrolls sideways.
- Images keep the stage, previous and next, and the thumbnails below the toolbar.
Link cards, forwarded messages, quoted previews
Cards in a message share one frame, one inset, two widths and one title, from the recipes beside MessageEmbed (Cards in messages): MessageEmbed, MessageForwardedBundle. A file card (MessageAttachment) is a tile with its name, not one of these cards, and a quoted message (MessageQuotedPreview) is a bar beside the text, with the header of a message (MessageItem). A link that an app previews is not one of them: it is a reference chip in the text, with its details in a hover card (App links).
Diagrams and Markdown tables
The same container as a code block (CodeBlock): layer-code, a hairline border, radius-container.
Translation, read and saved markers
One more small chip in the row under the message (Saved), or a short line of text: a translation's status under the original in Space Mono, and "Read" as one status line under the last message of a direct message in text-caption, a sentence (MessageTranslation). Don't add a color for them.
Toolbar for selected items
While items are selected (messages to forward, tasks to change in bulk, a computer's agents to start or stop), one toolbar floats at the bottom of the list or conversation, centered, in one row at any width: SelectionToolbar, in the BatchBar style (Noel; stdrc, 2026-11-10, #wg-task-v2). Messages, tasks and agents share it, so selecting reads the same everywhere. In order: the count ("3 selected"), an optional hint ("1 will be skipped"), the surface's actions, More while some actions are in it, then × to stop selecting. For messages the actions go in the order of why people select messages: Forward first, then Generate image (also a way to share them out), then the two copies, Copy link and Copy Markdown (Noel, stdrc, 2026-11-10). The last three are secondary: they are the first to move into More (cindyz, 2026-10-28, task #173). For tasks: Status, Assignee, Nudge, then Follow and Delete, which are secondary and the first into More when the row is narrow (Noel, 2026-11-10). For a computer's agents on the Computers page: Start, Stop, Restart / reset, then Change model, which is secondary and the first into More (Jasper, 2026-11-14, slock #14940).
In a thread and in the Computers page's agent list, a select-all checkbox comes before the count, and the count says what it shows: partly selected is "−" and "3 selected", none is empty and "0 selected", all is "✓" and "All 169 selected". Clicking it selects all from none, and clears from partly or all, so it never swaps a partial selection for everything by surprise; at 0 the toolbar stays, with the actions disabled, until × ends the selection (cindyz, 2026-11-03, #triage:#175). Only a thread and the Computers page's agent list have it: in a thread people collect a whole discussion, and a computer's agents are a bounded list where "all" has a clear meaning, while a channel is too long for "all" to mean something. The checkbox is read with the count beside it, the words saying the state the box shows, because in a floating bar it has no column of checkboxes under it to explain it, as the select-all box of a list header has. It is one of the toolbar's controls, so the arrow keys reach it. Select message in the message menu starts the selection; each message gets a checkbox (MessageItem).
- It is a floating panel, framed as every floating panel is:
radius-container,layer-popover, aline-seamring andshadow-float(Elevation). It is as tall as a head and keeps a head's air at its ends (header-heightandheader-air): 44px with a mouse on a desktop, 56px on a phone and a touch screen. It takes the place of the composer at the bottom of a column, so it takes a head's measure (Noel). It floats 12px above the bottom of the list or conversation (plus the safe area), as the conversation's other floating controls, above a phone's bottom navigation, and keeps the composer's 20px from the sides, so it is never wider than the composer it replaces (Page structure). - The count leads, in
text-calloutbold with the number in Space Mono, as counts are: it says what the actions act on, and it is announced when it changes. The toolbar's accessible name stays fixed ("Selected message actions"). - With a mouse every button is an
mdghost button with a 16px icon and its label, 4px apart; one that opens a menu adds a 12px chevron, and its menu opens upward. On a phone and a touch screen the buttons are a head's bar buttons, 44px (bar-button-size), side by side, each showing its icon alone at a head's icon size, 22px (control-icon-size), with no chevrons: so a phone fits the count and four buttons with × at 360px (Noel, 2026-11-10). There is no primary button: no action outranks the others while several are selected (stdrc, 2026-11-10). This replaces the earlier rule that Forward was the one primary button. - It never wraps: a second line would cover the messages under it. When its row doesn't fit the width it floats in, measured rather than guessed from a breakpoint, things give way one step at a time, in this order: the hint (still read by screen readers), the secondary actions into More from the end, the labels from the end (the first action's, Forward's, last; each then an icon square with its label as its tooltip), then the other actions into More from the end. The count and × never give way (When a row runs out of room).
- × ends the selection, last, as a floating toolbar's close does; Escape does the same. Cancel is not an action on the items, so it doesn't sit among them. Focus then goes back into the conversation: to the composer, or where there is none, to the item the selection started on (Moving focus).
- While an image of the selected messages renders, Generate image shows a spinner and "Rendering…", and pressing it again stops the render and keeps the selection. The render's progress is the hint after the count, the first thing to give way. × always ends the selection, stopping a render first (Kirby, 2026-11-14, #proj-raft-ui:#256).
- Each copy action, Copy link and Copy Markdown alike, shows a check icon and "Copied" on itself for a moment after it succeeds, in the row or in More, then goes back: the same kind of action gives the same feedback (Kirby, 2026-11-14, #proj-raft-ui:#256).
- The toolbar is one Tab stop: Left and Right move between its controls, the select-all checkbox included (Base UI Toolbar).
- On a list whose long press opens no menu, such as the Tasks list and the board's cards, a long press (500ms, moving no more than 10px, as every long press: States) starts the selection and selects that item. Messages keep their long press for the message menu (Conversation), and their selection starts from its Select message: one gesture does one thing (Noel, 2026-11-10). While selecting, a tap toggles an item. The checkboxes show only while selecting: they don't appear on hover on a touch screen. With a mouse each button's hit area reaches only half the gap toward its neighbour, so a click between two lands on the nearer; by touch each 44px button is its own tap.
- The list or conversation keeps its last item clear of the toolbar while it floats there.
Resizable columns
The seam between two columns is the only line, and the drag handle sits on it (Resizable).
Tables
Prefer a DescriptionList or ListRow rows. When it has to be a table, such as usage or billing (Table):
- Set the header in
text-footnote,foreground-hint. - Divide rows with
line-hairline. - Set numbers in Space Mono, right-aligned.
- Let a column that people would reorder sort the rows from its heading (Table › Sorting).
- Let a table wider than its container scroll sideways in a
TableScroll, never the page (Table › Wide tables).
Picking a date
A column of dates inside the popup of a Select, with the dates in Space Mono.
A row of toggle buttons
A row of filters (ToggleGroup), each one selectable on its own.
Authorization (OAuth)
The structure of a Dialog, with the requested permissions listed in a DescriptionList.
Switching servers
- The trigger is the WorkspaceButton on every surface: the server's avatar, its name and a chevron.
- On desktop, the workspace button at the left of the web top bar opens the list as a menu under it, 256px wide (Popover). The strip of server avatars beside the button switches with one click.
- On a phone, the server tab, the last tab of the tab bar, opens the same list as a popover above the tab bar, 8px from each side, with the server's own pages in one row under its footer, at the very bottom (MobileNav,
MobileNavServerPopoverContent). The workspace button on Home opens the list alone, as a popover anchored under the top bar, 8px from each side (Popover, Navigation). - Make each row the workspace tile, its name and its slug in Space Mono (
/launch). Mark the current server with a check and a bold name; show the unread count of the others as a pink count, or a gray count when the server is muted. - Give each row a drag handle, so people can reorder the list. The strip follows the same order.
- End the list, after a separator, with Join community (until the person has joined it), Switch or create server and Invite human.
Every component
The component index lists every component raft-ui exports, grouped by layer and then by category, with its summary and status. Deprecated components keep their docs but are left out of the navigation. The same list, for agents, is in components.json and llms.txt.
Related
- Feedback: errors by scope.
- Forms: which controls apply at once and which are saved.
- Conversation: where most of the parts built from existing ones appear.
- Authoring: the front matter that puts a component in its layer and category.