Components · Navigation
Sidebar
The desktop column next to the rail that lists what the selected destination contains, with rows that mark where you are, what is unread and what mentions you.
import { Sidebar } from "@botiverse/raft-ui";The sidebar is the desktop column between the rail and the main area. It lists what the destination selected on the AppRail contains: channels, agents and people, for example. Its header names the destination, and its rows show where you are, what is unread and what mentions you.
When to use
Which destinations have a sidebar, and what each one lists, is the product's choice (Raft Chat). A destination without a sidebar puts its content next to the rail (Page structure).
Anatomy
SidebarRoot: the column, onlayer-sidebar, with aline-seamalong its right edge.SidebarHeader: the header (56px on a phone, 44px on a desktop), with aSidebarHeaderTitleand, on its right, the working summary when someone is working.SidebarBodyandSidebarContent: the scrolling list. On desktopSidebarContentis a ScrollArea whose thin scrollbar shows only while the list scrolls; below 768px it scrolls natively.SidebarSection: a group of rows.SidebarSectionHeader: holds aSidebarSectionDisclosure(the button that collapses the group, withSidebarSectionChevron,SidebarSectionTitleandSidebarSectionCount) and, inSidebarSectionTrailingorSidebarSectionControls,SidebarSectionControlbuttons such as New.SidebarSectionAttentionis the group's pink pixel.SidebarSectionEndChevron: the section's chevron as the last of its controls, with a mouse on a desktop. It is a second trigger of the section, so it toggles it and turns with it. Put it last inSidebarSectionControlsand give the headerchevronAtEnd, which only hides the chevron before the title with a mouse; on a touch screen that one shows as before and the end one is gone.SidebarList: the rows.SidebarSectionEmptyreplaces them when the group is empty.
SidebarMenu, withSidebarMenuIcon,SidebarMenuTitle,SidebarMenuAsideandSidebarMenuCount: a single destination in a section header, such as Saved.SidebarGroupLabel: a plain group heading that doesn't collapse.SidebarItem: one row.- First, a
SidebarItemChannelIcon, aSidebarItemIconor a 19px Avatar. SidebarItemContent: theSidebarItemTitle(the name) and an optionalSidebarItemSubtitle(a description).SidebarItemAside: what follows:SidebarItemMeta,SidebarItemMetaIcon,SidebarItemStatus, the unreadSidebarItemCount(withSidebarItemThreadCountandSidebarItemCountSeparator), or the mention markerSidebarItemIndicator.
- First, a
States
Behavior
- The sidebar is 240px wide and can be dragged between 200px and 400px; it keeps one width on every page that has it (Spacing).
- A name stays on one line and ends with an ellipsis. A description after it gives up its room first; the name truncates only once the description is gone.
- A row whose content is 2 lines (a computer's name and whether it runs agents) uses
wrapwithSidebarItemContent stacked: it grows from the row height, and its icon lines up with the first line. Its text stays (row height − 20px) / 2 from the row's top and bottom: 7px on a desktop, 9px on a touch screen. The shape is as tall as the row, so that is the same inside the shape. The name still stays on one line. - A group shows how many rows it holds in
SidebarSectionCount, right after its title, open or collapsed. - A row out of view isn't laid out or painted (
content-visibility: auto); it keeps its place at the row height, or at the height it last had when it wraps. A server with hundreds of channels relaid every row whenever the window's width changed, about 115ms each time at 300 channels (InNOut, 2026-11-09, #proj-frontend:57f32c96). The row allows 2px of painting past its box, so the selected row's outer sticker edge still shows; a browser withoutoverflow-clip-marginlays every row out as before. - While an agent works, what it is doing replaces its runtime (Working agents), in
text-footnoteandforeground-muted, and takes at most 58% of the row.
Content
- Title the header with the destination's name.
- Mark a channel with a bare
#icon, a private channel with the private lock (riconsPrivateIcon), and agents and people with their 19px avatar. - Write an agent's runtime in Space Mono after its name.
- Set a row's meta (a count of messages, a time, "12 · 2") on the name's baseline: it is a second size and face on the name's line (Text of different sizes on one line).
SidebarItemMetadoes it in a one-line row, inSidebarItemAsidetoo; the icon, avatar, count and @ sticker stay centered on the row. Centered with them, the 12px meta stood 1px above a phone's 16px name. The drop is worked out from the name's size (text-subhead,text-bodybelowmd): give the name another size and change the drop with it, or the meta moves off the line without anything failing but the browser test.
Accessibility
SidebarRootrenders adiv. Render it as anasideor anavand name it after the destination:aria-label="Chat".SidebarItemrenders the Base UI Button. For a row that navigates, render a link (render={<a href="…" />}) and setaria-current="page"on theactiverow:activeonly changes how it looks.- Give the unread count a name that says what it counts ("2 unread"), and give an icon-only
SidebarItemMetaIcona name ("Muted"). SidebarSectionDisclosureis a Base UI Collapsible trigger, which setsaria-expanded.- On a display-only row, focus lands only on the controls inside it.
Rules
- Keep an empty section whose rows people put there themselves, and show its
SidebarSectionEmptyline: Pinned stays with "Drag channels or DMs here to pin", because the empty section is where they drop. Don't draw a section whose rows only arrive from elsewhere while it is empty, not even its header: External fills when a channel gets an outside member, so an empty External says nothing, and its create action stays in the sidebar's context menu. Hide it through the same check as every other empty section, so it still shows while it loads and while a drag that started in it is under way: unmounting the drag's source cuts the drag off. - Draw a row the same way in every group: original, pinned or custom. A group never changes a row (no wrapping, no hidden description in one group), because the same conversation would look like two different things.
- Don't use
wrapto let a name run onto more lines, including in a pinned group. Use it only for a row whose content is 2 lines. - Keep everything a row draws within 2px of its box. A row clips its painting there and is the containing block of its absolute and fixed children (
content-visibility: auto, Behavior): a badge or ring that hangs further out is cut, so put it inside the row, or portal it out as popovers, tooltips and the drag lift already are. - Draw no line between rows. A row is a list cell (Lists): it runs the sidebar's full width, and its hover, press, menu-open fill, the yellow sticker and the focus ring are drawn on one rounded shape as tall as the row and inset 8px from each side.
SidebarListis a column with a 2px gap and 8px at its top and bottom, so two filled rows show 2px between them and the first shape sits 8px under the section header, whose words have no padding below them; put the rows of a section in it.SidebarContenthas no side padding for this reason; on a phone and a touch screen its group labels, section headers and a section's empty line start 20px in, where the rows' content starts.SidebarRootsets the column's margin to 20px at every width on a touch screen (16px with a mouse), soSidebarHeaderstarts there too on a phone (Lists). - Pad the row's content from its shape: 12px inside it at the start and at the end, 20px from the sidebar's edges, on a phone and a touch screen (Lists).
- With a mouse on a desktop the sidebar has two axes (stdrc, 2026-11-05, option B; Desktop density). A row's glyph (its icon,
#or avatar) starts on the glyph axis, 16px from the sidebar's edge (--sidebar-glyph-axis: the shape 8px in, the content 8px inside it), and its text on the text axis, 40px (--sidebar-text-axis). A section's or group's title starts on the glyph axis, outdented from the rows' text, so it reads as the frame of the rows under it; a section's empty line starts on the text axis. A section's chevron is its last control, at the end of its header, and the header's control icons and the rows' trailing counts end 16px from the right edge. Rows are the row height, 34px. The icon or avatar starts at the shape's inner start; the time, a count, the @ sticker and any trailing mark end at its inner end, so none touches the shape or the selected sticker's ink edge (a count's or the @ sticker's own 1px outer edge leaves 11px). This is the web sidebar row the design review set as the reference: the shape 8px from the sidebar's sides, the trailing count 12px inside it (it was 11.5px when the review named it). Don't add side padding to the scroller or the row: either one moves the shape or the content off the rule. - Keyboard focus is the 2px inset ring on the shape. On the
activerow it sits inside the sticker's ink edge. - Make every row the row height (
row-height: 34px with a mouse, 38px on a touch screen from 768px), its shape as tall, intext-subhead, on a desktop. Belowmdthe row grows on its own to at least 44px intext-bodyat 600: there it is a phone list of places (Home, Members, the Settings list), which a finger has to hit. Don't add phone sizes at the callsite. The Settings list sat at 36px on phones because the size lived in one product class that only Home's rows were given. - Make a section's controls (
SidebarSectionControl, such as Sort and New) 24px with a 14px icon, overhanging the 16px header line. The title beside them is 12px bold in the hint color, a label for the group, not a toolbar: a 28px button with an 18px icon outweighed it, and the header read as a row of buttons (stdrc, 2026-10-31; it was 24px before 2026-10-18). On a touch screen, where the controls show at rest, they stand 4px apart as with a mouse; a 20px gap read as two separate buttons rather than one pair (stdrc, 2026-11-01). Each one's hit area reaches 44px high and 10px past the row's ends through a transparent::after, and between two controls it stops in the middle of the gap, so the areas meet without overlapping and a tap there belongs to one of them (about 36px wide each). The header keeps 6px more under its line so the hit area stays off the first row. - Draw a section header as the group's label: the chevron first, then the title, then the count, with the controls at its end. With a mouse on a desktop the chevron is the last of those controls instead, at the end of the header, always shown, and the title starts on the glyph axis (
SidebarSectionEndChevron,chevronAtEnd); on a touch screen it stays before the title, where a thumb reaches the title and its chevron as one target. The title is the section's one toggle for the keyboard and a screen reader at every input: the end chevron is a second pointer target for the same thing, so it stays out of the tab order and the accessibility tree (tabIndex={-1},aria-hidden), and pressing it leaves focus where it was. Two toggles would be read twice and tabbed through twice for one action. The count belongs to the label ("Channels 6"), so it follows the title in the hint color and Space Mono and is always shown, open or collapsed. At the end of the row it would read as an unread count, the place a row keeps one, and a control appearing on hover would land on it. - Rest a section's controls in the title's hint color. Only the control under the pointer, in keyboard focus or with its menu open turns body color on the ghost fill. In body color at rest they were darker than the label they serve, and the header read as two weights fighting; in the hint color the header reads as one label, and the color change says which control you are about to use.
- Show a section's controls at all times, with a mouse as on a touch screen. They are what the header can do; showing them only on hover (2026-10-31) hid them from anyone who hadn't found them and made a long title's room change as the pointer passed (stdrc, 2026-11-02). They hold their place at the end of the row, so a long title truncates before them and keeps its count. A collapsed section's attention mark sits before them in the row, and hides only while the section is open.
- Put the controls in
SidebarSectionControlsinsideSidebarSectionTrailing; don't wrap them in adivof your own. The part spaces them for touch and pulls the last one out to the header's line, also while its menu is open: an open menu's trigger gets Base UI's focus guards and its portal's hiddenaria-ownsspan beside it, and a plain:last-childlost the pull and moved the trigger 5px left (stdrc, 2026-11-02); a wrapper of your own does none of that. - End the last control's icon box on the header's line, 20px in on a touch screen and 16px with a mouse, as the chevron starts on it (The ends of a header): the 24px control's 14px icon sits 5px inside its edge, so
SidebarSectionControlspulls its last control out by 5px and the empty part of the button hangs past the line. Placed by its button, the icon sat 5px further in than the chevron on the other end. - Keep the controls still when a classic scrollbar appears. A scroller that shows one publishes its width as
--scrollbar-size(useScrollbarSize); the rows give that much back from their end inset, andSidebarSectionHeadergives back the same from its right padding, so its controls end on the rows' content edge with or without a scrollbar (20px from the sidebar's outer edge on a touch screen, 16px with a mouse, with a scrollbar up to 8px wide). With a fixed 20px of padding the controls moved 8px left whenever the scrollbar appeared. - Don't put the server switcher in the sidebar header. It is in the web top bar, or at the top of the rail when there is no top bar.
- Don't put a live bar at the bottom of the sidebar. Working agents appear in the header's working summary and in their own rows instead (Working agents).
API
SidebarBody, SidebarContent, SidebarGroupLabel, SidebarHeader, SidebarHeaderTitle, SidebarItemAside, SidebarItemCount, SidebarItemCountSeparator, SidebarItemChannelIcon
Also takes the attributes of its element.
SidebarItem
Also takes the attributes of its element.
SidebarItemIcon, SidebarItemIndicator
Also takes the attributes of its element.
SidebarItemContent
Also takes the attributes of its element.
SidebarItemMeta, SidebarItemMetaIcon, SidebarItemStatus, SidebarItemSubtitle
Also takes the attributes of its element.
SidebarItemThreadCount
Also takes the attributes of its element.
SidebarItemTitle
Also takes the attributes of its element.
SidebarList
Also takes the attributes of its element.
SidebarMenu, SidebarMenuAside, SidebarMenuCount, SidebarMenuIcon, SidebarMenuTitle, SidebarRoot
Also takes the attributes of its element.
SidebarControl
Also takes the attributes of its element.
SidebarSection
Also takes the attributes of its element.
SidebarSectionEmpty
Also takes the attributes of its element.
SidebarSectionControl
Also takes the attributes of its element.
SidebarSectionControls, SidebarSectionDisclosure, SidebarSectionChevron, SidebarSectionCount
Also takes the attributes of its element.
SidebarSectionEndChevron
Also takes the attributes of its element.
SidebarSectionHeader
Also takes the attributes of its element.
SidebarSectionAttention
Also takes the attributes of its element.
SidebarSectionTitle, SidebarSectionTrailing
Also takes the attributes of its element.
Related
Changes
- 0.109.2 · FixedSidebar: a row's meta (a count, a time, "12 · 2") stands on the name's baseline, in
SidebarItemMetaand insideSidebarItemAside; the icon, avatar, count and @ sticker stay centered on the row, and a wrapping row is unchanged. The meta's own line ("12 · 2") is no longer 2px too tall. - 0.107.3 · Design SystemA sticker's ink edge follows its size ([Shape › Stroke widths](https://raft-design.botiverse.build/foundations/shape/#stroke-widths)): a sticker that carries a label (a number, a word, or an icon that stands for one) and is under 24px tall takes a 1px ink edge, and in dark mode a 1px die-cut edge outside it. A larger sticker, or one with no label that relies on its edge for its shape, keeps 1.5px: buttons, the selected row, tab and segment, avatars and their corner marks (and an avatar stack's +N count), status pixels and attention dots. Changed in this release:
Badge(appearance="solid"),SidebarItemCount,SidebarItemIndicator,AppRailItemBadge, the new count inMessageRepliesSummary, a mention of you (MessageReferenceText variant="primary"), and theStepsnumber. - 0.87.0 · AddedListRow
tone="warning"andtone="danger": an action's risk ([An action's risk](https://raft-design.botiverse.build/components/list-row/#an-actions-risk)). An action row in a danger zone, such as Archive, Leave or Delete at the end of a channel's details, colors its title and its leadingListRowIconwarning-strong(it interrupts but can be undone) ordanger-strong(it cannot be undone), with Button's names and meanings. Nothing else changes: the description, the value, the chevron and the hover and press fills stay as on any row. Only an interactive row takes it (a display-only row ignores it: only an action has a risk), and a disabled row greys everything as for every tone. The row still carriesdata-tone. The newRiskTonetype ("warning" | "danger") is exported besideRowTone;SidebarItemkeepsRowTone. - 0.79.0 · ChangedA sidebar row out of view isn't laid out or painted:
SidebarItemsetscontent-visibility: auto, with one line (1lh) as its content height until it has been laid out (the last laid-out height after that, for a row that wraps) and a 2pxoverflow-clip-margin. - 0.49.0 · ChangedSidebarItem, InboxItem, SearchEntity/SearchHit rows: list cells, no dividers; their lists (
SidebarList,SearchResultsList,ActivityInboxViewport,InboxItemSkeletonList,DialogNav) space rows withgap-0.5 py-2. An app that drew its own row padding or right inset on these rows should remove it. - 0.8.1 · FixedBelow
md, aSidebarItemrow is at least 44px high in the 16px title type, so a phone sidebar row can be tapped without help from the app. - 0.6.1 · Added
SidebarItemtakestone(RowTone, shared with ListRow) andinteractive={false}for a display-only row whose own buttons are the targets. - 0.6.0 · Breaking ChangesProps that no longer change anything are removed:
Badgeuppercase;Checkboxsize,variant,color;Statuspulse,attention(status never animates);Switch/SwitchThumbsize;SidebarItemvariant;SidebarItemCount/SidebarItemIndicatorvariantandappearance(the count is always the pink sticker, the indicator the yellow @);NotificationCenterActionButtonvariant;DrawerContentwidth(one-go forms use the wideDialog);AppRailItemIndicatorattention;AppRailItemAttentionchildren;Stepssize,track,renderIndicator,renderTraveler;FilePreviewBadgetype,color. Remove them at call sites.