Foundations
Accessibility
The rules every Raft product follows so it works with any vision, keyboard, screen reader, touch screen or motion setting — contrast, focus, hit targets, motion, semantics, touch and language — and the components that implement them.
Raft is a workspace people keep open all day, next to agents that never stop working. It has to stay readable on every surface, usable with the keyboard alone, clear to a screen reader, comfortable on a touch screen and still for people who turn motion off. This page gathers the rules that apply to every component. Each component doc's "Accessibility" section adds only what that component provides or needs from you (Writing guide).
Principles
- Meaning never depends on one sense. A color, an icon, a pixel or a movement always comes with a word, either on screen or in the accessible name. A status chip has a pixel and a word; a banner's icon repeats what its text says.
- Every action has a keyboard path and a touch path. Hover, right-click, press and hold, and drag are shortcuts, never the only way.
- Use the platform's behavior. raft-ui builds on native elements and Base UI primitives, which provide roles, focus handling and keys. raft-ui adds the look and the default names. The product adds names that only it knows.
- The guarantees hold with no exceptions to remember. Contrast, the focus ring and hit targets are set by tokens and recipes, so a component that uses them is correct by default.
Contrast
The token values are chosen so that text never has to be checked again surface by surface; see Color.
- Text in
foreground,foreground-mutedandforeground-hintis at least 4.5:1 on every surface, every soft tint and every popup, in light and dark mode. Tertiary text carries times, IDs and counts people need to read, so it gets the same guarantee as body text (Color). - Error text and the border of an invalid input use
danger-strong, which is at least 4.5:1 on paper. The brighterdangeris only for the delete button, where the text is ink (Color). - Ink on a sticker (
sticker-ink) is at least 6.8:1 in both modes. Stickers never carry white type, because white on yellow, lime or cyan fails. - Controls have a 1.5px ink border (
line-strong;line-fieldaround a field), so the edge of every control is clear on any surface. In light modeline-seamis 3.0:1 on white and 2.8:1 on yellow; it separates regions and never marks a control. - Use the three text tiers, never an alpha variant of them (
text-foreground-muted/70): the guarantee holds only for the tier tokens. foreground-disabledis below 4.5:1 on purpose, as allowed for inactive controls. Never use it for text people need to read. When people need to know why an action is unavailable, keep the button focusable withfocusableWhenDisabledand explain in a Tooltip (Button).- When you change a text, surface or tint token in
tokens.json, recheck these ratios for both modes. No automated test checks them yet.
Focus and keyboard
People who use the keyboard must always see where they are and reach everything a pointer can.
- Give every element that can be reached with the keyboard the
focus-ring(shadow-focus) on:focus-visible: a 2px gap in the surface color, then 2px of ink. It is ink, not yellow, so it shows on the yellow frame and on yellow stickers (Elevation). - Show the ring only after keyboard navigation, never after a click, a tap or typing (States). Keyboard users see it every time they move, and it shows whenever the input isn't a pointer raft-ui can see (before any input, a screen reader's browse cursor or synthesized press), so WCAG 2.4.7 holds; people using a pointer aren't shown a ring that tells them what they just clicked.
- Ring the whole group of a compound control (the composer, an input with an addon) when something inside it has keyboard focus, and the box of a checkbox or radio (States).
- Make a composite control one Tab stop and move inside it with the arrow keys: RadioGroup, SegmentedControl, Tabs, ToggleGroup and menus. Base UI provides the keys.
- Trap focus in a modal overlay, close it with Esc, and return focus to its trigger: Dialog and Drawer do this.
- Show on keyboard focus whatever shows on hover: the message toolbar (MessageItem), tooltips, preview cards (PreviewCard), the overlay of an editable avatar (Avatar).
- Don't leave a sentence only in the tooltip of a tag that sits inside a row's button, such as a source tag on a member row. Only the pointer reaches it: the row is the Tab stop, so keyboard focus never lands on the tag; a touch on the tag presses the row; and a screen reader reads the row's name, not the tooltip. Put the sentence in the tag as visually hidden text (
sr-only), so it joins the row's accessible name, hide the tag's short visible label (aria-hidden) when the sentence already says it, and keep the tooltip as an extra for the pointer: "Martin is also a member of Botiverse" (Kirby, 2026-11-04, slock #12853). - Offer every action of a context menu from a visible control as well, such as a ⋯ button: right-click and press and hold can't be done from the keyboard (ContextMenu).
- Give every drag a keyboard path, the same everywhere: Space picks the item up, the arrow keys move it one place at a time, Space drops it and Escape puts it back. Enter never starts a drag, because on an item that also opens, Enter opens it. Task cards, sortable tabs and composer attachments all work this way (Drag and drop, TaskDnd, Tabs).
- Render a row whose only interactive parts are its controls as a
<div>, so Tab goes to the controls and not to a row that does nothing (States). - Show a shortcut with Kbd in the tooltip or menu item of the action. Say it in words in visually hidden text, as
KbdShortcutdoes: Command K. Not witharia-labelon thekbdor aspan, which have no role, so screen readers ignore the name.
Moving focus
Focus is where typing goes. When code moves it without being asked, people type into the wrong place, a screen reader jumps away from what it was reading, and a phone's keyboard covers half the screen. So focus moves when a person asks for it, and code otherwise leaves it alone (artin and Scout, 2026-11-10, #triage:e5eea7eb).
- Don't take focus from where someone is working. When focus is in a text field, or inside an open menu, popover or modal (a dialog, a bottom sheet, a lightbox), a request from anywhere else doesn't move it; a request from inside that same popup still does. Focus inside an open popup means someone is using it right now, and taking focus away would close it under them (Lagoon and Scout, 2026-11-10, #triage:e5eea7eb). A side panel, the thread pane or another window doesn't count: it isn't a popup, so focus goes wherever the person clicks, and the composer next to it can still take focus. The composer that appears when a channel finishes loading is the case that taught this: it took focus from the search box someone had just clicked (slock #13897).
- Only a person's action moves focus to another part of the page. A click, a key or a command they chose may move focus anywhere: switching channels puts focus in that channel's composer. Something mounting or data arriving is only a soft request, which gives way to the rule above.
- A delayed request is cancelled when things change. A request that waits for a frame, a timer or a response is dropped if the person puts focus somewhere else in the meantime, or if a newer request comes. Otherwise it lands late, in a place the person has already left.
- Give focus back only when it was lost. When something closes, return focus to what opened it only if focus fell to the page itself (
<body>) or to an element that is gone. If the person has already moved on, leave it where they are. Leaving a server only lets go of focus: it blurs before the view unmounts and gives nothing back, which also keeps leaving fast (slock #13757, #13777). - Never focus a field when it appears if that would open the on-screen keyboard. The keyboard covers half the screen. On a touch screen a field takes focus only when it is tapped, or when the tap was on a control whose only next step is typing in that field: Reply puts focus in the reply field, Rename in the name field, and tapping Search again on the tab bar in the search box (Navigation). Opening something to read, such as a comment panel, or a dialog where the field is one thing among others, doesn't focus the field: on a touch screen pass
initialFocus={!coarse}(Jasper, 2026-11-10, #triage:#278). Focus that the tap asks for has to move inside the tap's own handler: iOS Safari opens the keyboard only forfocus()called synchronously in a tap, so a field that mounts after the tap is mounted in the same handler (withflushSync, say) and focused there; a focus that waits a frame for it leaves the keyboard closed. A tablet with a hardware keyboard attached opens no on-screen keyboard, so it may focus fields like a desktop does where the app can tell the keyboard is there, as the iOS and Android app can. The web can't tell reliably, so on the web every touch screen counts.
raft-ui does most of this for you. Dialog and Drawer trap focus while they are open, make the page behind them inert, and give focus back to their trigger when they close. Build a modal from them rather than from markup of your own, so these rules hold without anyone writing them again.
Hit targets
Fingers are less precise than a pointer, and a target people miss feels broken.
- Make every touch target at least 44px in both directions (Spacing).
- Reach 44px with the hit area, not the drawing. A 32px Button and a 20px Checkbox extend a transparent
::afterto 44px, so the layout stays compact and the target stays large. A field in a toolbar row, 32px by touch, reaches 44px through its input instead (InputGroup). - Don't extend inline links and reference chips in running text: they follow the line of text.
- Desktop controls used only with a pointer may be smaller: sidebar rows 34px, rail items 36px, a bar's icon buttons 28px (a row's icon-only actions are 28px with every pointer, their hit area 44px), the floating toolbars 42px with 34px buttons (the toolbar for selected items 44px, as a head), and on a desktop (from 768px with a mouse or trackpad) a default control, such as a field, 34px. A touch screen keeps 44px at any width (Spacing), except for the rows of a popup list, which are 36px on a touch screen and 34px with a mouse (Spacing).
- ToggleGroup items are 32px (34px with a mouse) and don't extend their hit area. Don't use a toggle group on a touch screen until they do.
Motion
Raft is watched for hours, and motion can make people dizzy or distract them from what they read. Motion confirms an action or shows where something came from, and nothing depends on seeing it (Motion).
- Turn every animation and transition off under
prefers-reduced-motion: reduce. Components use Tailwind'smotion-reduce:variant or a@media (prefers-reduced-motion: reduce)block; a new animation adds one in the same change. - With reduced motion, the Spinner stops and keeps its first pixel lit, and the Skeleton stops pulsing. Both still say that something is loading.
- Never loop a status. A working agent is a still yellow light, not a pulse.
- Show centered overlays without animation, so nothing slides in for people who didn't ask for it (Motion).
Screen readers
A screen reader announces what the markup says, not what the screen shows. Every control needs a role, a name and a state, and every change people must notice needs to be announced.
Roles and names
- Use the native element or the Base UI primitive for a role. Don't add an ARIA widget role without the focus, keyboard and close behavior it promises.
- Give every icon-only button an
aria-labelin sentence case, the same words as its tooltip: Add reaction (Button). - Start the accessible name of a control that has visible text with that text. People who use voice control say what they see.
- Give every dialog, drawer and bottom sheet a title; it is what is announced when it opens (Dialog).
- Hide decoration from assistive technology (
aria-hidden) when the words are next to it: a status pixel beside its word, a banner's icon, a toast's icon and progress bar (Status). - Name what stands alone without words: a presence light gets
role="img"and its state ("Online"); an attention dot says what waits; an avatar stack says the full count ("5 agents working"), since it shows only "+3" (Avatar). - Include the unread state in the name of a trigger that shows a count or a dot: "Notifications, 2 unread" (NotificationCenter).
- Mark a region that is loading with
aria-busy="true"; skeletons are hidden (Skeleton).
Live regions
Announce a change only as urgently as it deserves. A destructive problem interrupts; everything else waits until the screen reader is idle.
- Make the title of a toast or banner carry the whole meaning: its icon is hidden.
- Never put something people must not miss only in a toast: it disappears (Feedback).
Touch
A touch screen has no hover, no right-click and no keyboard shortcuts, and fingers cover what they press.
- Show hover styles only on devices that can hover. Tailwind's
hover:variant applies only under@media (hover: hover), so use it rather than a bare:hover(Motion). - Don't show the hover toolbar of a message on a touch screen; press and hold opens the message menu (Responsive layout, ContextMenu).
- Don't rely on a tooltip on touch. raft-ui's Tooltip opens there on a press and hold, on a
focusableWhenDisabledbutton too, so a disabled button's reason reaches a phone; but a hold is found only by someone looking for it, so write what everyone must read in the interface (Tooltip). A preview card doesn't open on touch, so make its trigger a real link (PreviewCard). - On a touch screen, start a drag only when the finger has held still for 500ms and then moves, so scrolling a list never moves a card, a row or a server, and holding still opens the menu instead. Every draggable list uses the same hold, task cards included (Dragging on a touch screen, Drag and drop).
- Never make a swipe the only way to close something: drawers and sheets keep ×, Back or a button, and toasts close by themselves and with Esc (Drawer, Toast).
- A known gap, kept on purpose: on a touch screen, a sighted person who can't drag has no way to see a merged message's own time. The conversation shows it only while it is dragged left (Conversation), and the message menu's date line, the other way to it, was removed (artin, 2026-11-04, #triage:530f8c36). The swipe rule above is about actions and closing things; a time is information, not an action, so it doesn't strictly apply, and the group header's time still places the message. A screen reader hears each message's time in its name. Don't fill the gap in as if it had been forgotten: it was left open knowingly, and closing it is a design decision.
- Keep the composer above the on-screen keyboard, and make Return insert a new line on a phone held upright (Composer).
Language and casing
- Never set text in all caps, in CSS or in the string. All caps removes the shape of words, so it is slower to read, and some screen readers read a short all-caps string letter by letter, as an abbreviation (0002, Typography).
- Use sentence case for everything, labels included, so a label reads the same on screen, in a tooltip and in its accessible name (Writing).
- Set
langon the<html>element to the interface language. The screen reader chooses its voice and pronunciation from it. The Raft web app sets it whenever the interface language changes. - Spell out what a symbol means in its accessible name: a shortcut's ⌘, a count's +3, a separator between two facts.
- Write errors and empty states in plain words that say what happened and what to do next (Voice and tone).
Checking a change
Before a change ships, check it the way people will use it:
- Use it with the keyboard alone: Tab reaches everything, focus is always visible while you move with the keyboard, Esc closes what opened.
- Type into a field, then let the change load or open around it: focus stays where you were typing (Moving focus).
- Read the accessibility tree: every control has a role, a name that starts with its visible text, and its state.
- Turn on reduced motion: nothing moves, and loading still reads as loading.
- Try it on a touch screen or in touch emulation: every target is 44px, and nothing needs hover.
- Look at it in dark mode and at 320px wide (Design system).