Components · Overlays
DropdownMenu
A list of actions on one thing, opened from a button, that can also hold a setting-style choice with a check mark on the current value.
import { DropdownMenu } from "@botiverse/raft-ui";A dropdown menu is a list of actions on one thing (a message, a channel, a task, an agent), opened from a More button (⋮ for one thing's menu, ⋯ at the end of a row of actions; Iconography). It can also hold a setting-style choice, such as sort order or status, with a check mark on the current value. Right-click on desktop and press and hold on a phone open the same menu as a ContextMenu.
When to use
Which overlay fits which job is in Choosing a component.
Anatomy
DropdownMenu: the root. Owns the open state. Required.DropdownMenuTrigger: the button that opens the menu. Renders an outline Button unless you passrender. Required.DropdownMenuContent: the menu, portaled and positioned next to the trigger, at least 240px wide and as wide as its longest item, never wider than the window (Width). Its items scroll inside it when they don't fit (Long menus).classNameis the popup's, for a minimum width; the items stack in a column inside its scroller. Required.DropdownMenuItem: one action. A 16px icon, then the label. Wrap the label inDropdownMenuItemLabelto truncate it.DropdownMenuShortcut: the keyboard shortcut at the end of an item, intext-mono-metaandforeground-hint.DropdownMenuItemCount: a count at the end of an item.DropdownMenuRadioGroupandDropdownMenuRadioItem: a set of values with one current value, marked with a check mark.DropdownMenuLinkItem(experimental, from@botiverse/raft-ui/wip): a choice that is another page, such as the same page in another language. It is a link, so it opens in a new tab and can be copied;currentmarks the page being shown with the same check mark and bold text as a radio item.DropdownMenuCheckboxItem: an option that is on or off by itself.DropdownMenuLabel: a heading over a group of items. Not interactive.DropdownMenuSeparator: the line between sections.DropdownMenuSubmenuandDropdownMenuSubmenuTrigger: a nested menu, opened from an item with a chevron.DropdownMenuFooter: a line of quiet text at the bottom, such as a count. It scrolls with the items.DropdownMenuPinnedFooter(experimental, from@botiverse/raft-ui/wip): items kept below a long menu's scrolling items, after a separator: an action on the whole list, such as New section or Show all (Long menus). Write it as the menu's last child.DropdownMenuPortalandDropdownMenuPopup: lower-level parts.DropdownMenuPopupis the menu surface without positioning.
States
Hover, keyboard highlight, the current value and disabled items follow States. In a menu:
- Keep the highlight and the current value apart. The
brand-softhighlight shows where the pointer or keyboard is; the check mark and bold text show which value is chosen. Never use the highlight to mark the current value. - Show a disabled item with
foreground-disabledtext and icon, and nothing else. The one exception is an item an app has disabled in an item card's More menu: it shows the app's reason as a second line, because a menu item has no tooltip and the app's reason is the only way to learn why (PreviewCard).
Behavior
- The menu opens below its trigger, aligned to the trigger's start edge, and moves or flips when it meets the window edge (Elevation). It is a list popup: it stays on its side and scrolls as long as five items fit there (Long menus).
- A submenu opens beside its item, to the end side, its first item level with it. Where it doesn't fit there it flips to the other side of the item, and where it fits on neither side it slides along the window's edge, still level with its item, over the menu. It never drops above or below its item: there it would no longer read as coming out of it.
- The menu keeps clear of the frame insets: where a shell keeps part of the window for itself (
--raft-frame-inset-top,--raft-frame-inset-start,--raft-frame-inset-end), it stops 8px from that part, not from the window's edge. The start and end insets are the corners of the top band, so they count only when its trigger is in the band; under it, it keeps its own padding from the window's edge (Page structure). The web sets none. - Choosing an action or a radio item closes the menu. A radio item is one value of a set, so one pick completes the choice, and the open menu would only cover what it changed. Its check mark shows the current value the next time the menu opens. Keep the menu open after a radio pick (
closeOnClick={false}) only when the menu itself shows the result, such as a warning that appears under the new value. - Choosing a checkbox item leaves the menu open: each item turns one thing on or off, and people often change several at once.
- Esc and a click outside close the menu. A click into an embedded frame (an
<iframe>, cross-origin too) outside the menu counts as a click outside. - A menu longer than the room it has scrolls inside it, and the arrow keys keep the highlighted item in view (Long menus).
- An item is as tall as its content: one line is 36px, and a second line, such as a description under the label, adds only its own height, with the same space above and below the text (Forms). This holds for radio and checkbox items too.
Content
- Write item labels in sentence case: Copy link, Reply in thread (Writing).
- Make the label of an item that opens a dialog the dialog's action. In an item's own menu, leave the item out: Rename opens Rename Artifact, whose title names it (Writing).
Label length
Keep a label short; don't widen the menu or let the label wrap to make room for it. Width is the fallback for a window too narrow for a short label, not room for long copy (cindyz, 2026-11-26, #triage:efc6587c).
- Make a label a short verb phrase: 3 words or fewer in English, 6 characters or fewer in Chinese. The limit is 4 words, 8 characters: rewrite a label past it.
- Count a placeholder (
{name},{count}) as one word or one character, and a Latin word in Chinese (Agent, App, MCP) as one character. Punctuation doesn't count. Check each language on its own: when a translation runs over, shorten the translation, not the English. - Put what explains an item (what it affects, why it is off, who it reaches) in a description line under the label (Forms), not in the label.
- To shorten a label, first drop the words the menu already says: the item itself (Writing), the group heading, or the trigger. Then drop the state that a check mark or the description line already shows. "Close tabs to the right" in a tab's own menu is Close to the right; "Drafts didn't load · Retry" is Reload drafts, with "Drafts didn't load" as its description line.
- The limit leaves out user content in
DropdownMenuItemLabel(titles and names, which truncate), a menu's empty state, and a disabled item's reason line. - Why these numbers: of the 254 menu item labels in the web app on 2026-11-26, 218 fit 3 words and 6 characters. A limit of 3 and 6 would turn away clear labels such as Mark all as read, Open in new window and its 7-character Chinese translation; 4 and 8 lets them pass and still catches the 7 that are too long, such as Open in the comment list and the 9-character Chinese for Show joined channels only.
Accessibility
- DropdownMenu wraps the Base UI Menu. It provides the
menurole, the item roles, arrow-key movement, typeahead, Esc, and focus return to the trigger. - Name the menu after the thing it acts on: put
aria-labelonDropdownMenuContent("Message from Wug"). - Give an icon-only trigger, such as More, an
aria-label("More actions"). - Make every row in the menu a menu item, so arrow keys reach it. This includes each quick reaction: give it an
aria-label("React with thumbs up") and hide the drawing from assistive technology. - Leave item icons decorative; the label names the action.
Rules
- Don't color destructive items such as Delete or Stop. They open a confirmation, a Dialog at
size="sm", whose orange or red button carries the consequence (Feedback). The warning comes once, where the person decides, and the menu stays one quiet list. iOS, Material and many web apps color such an item red instead, and macOS doesn't; Raft keeps it uncolored (stdrc, 2026-11-12, #proj-raft-ui:95c3f384). - Use the same separator between every two sections of a menu.
- Don't put a control that submits a form value in a menu; use a Select.
Width
Menu items stay on one line; the menu grows to fit its longest item, capped by the window. Wrap or truncate only when the window can't fit it. Don't give a command menu a fixed width (a minimum is fine); fix a width only to truncate user content such as titles (Scout and Kirby, 2026-11-26, #triage:#651).
- The menu is at least 240px wide and as wide as its longest item, up to the room the positioner leaves it across the window (
--available-width, inside the same padding from the window's edge or a frame inset as its height). A submenu is capped the same way. - An item longer than that room breaks only where it must: a plain label wraps onto another line inside its item, and a label in
DropdownMenuItemLabelis cut with an ellipsis. Put user content (a title, a name) inDropdownMenuItemLabel, and leave an action's words plain, so they wrap and stay whole. - A minimum width on
className(min-w-72) is fine: it keeps a menu from changing width as its items change. A fixed width (w-72) on a menu of commands wraps a label that would fit the window on one line. Fix a width only for a menu of user content that should truncate, such as a list of titles. - Why: the menu had a minimum width and no maximum, so an item longer than the window made the menu as wide as the item, and it ran past the window's right edge. In a 320px window, a 320px menu sat at x=5 with 310px of room.
Long menus
A menu whose items come from data (sections, servers, agents, tabs, versions) can be longer than the window. It scrolls inside the room it has, never past it (Artea, #triage:#644, slock #16999 and #17004: More's list of Apps ran off the window and its last items could not be reached).
- The menu is as tall as its items, up to the room the positioner leaves it between its trigger and the window's edge (
--available-height, less 8px from the edge or a frame inset). Past that, the items scroll inside the menu with the wheel, a trackpad, touch and the thumb of the overlay scrollbar, which takes no room from the items (ScrollArea). The menu doesn't grow past the window or move to make room. - The menu stays on the side it opens on and shrinks to the room there, as long as that room holds five items (
--popup-list-min-height, 178px with a mouse). Only with less does it flip to the other side, and it opens beside its trigger only when neither side holds five items (Elevation). A menu with 300px under its trigger used to flip above it because its whole list fit there; it now stays under the trigger and scrolls.collisionAvoidancereplaces the default (LIST_POPUP_COLLISION_AVOIDANCE). - The highlighted item stays in view. The arrow keys, Home, End and typeahead scroll it in, and it stops 24px inside the cut edge, clear of the fade, so the item being chosen is never the faded one.
- The cut edges fade: the items fade out over up to 24px toward an edge with more past it, and an edge with nothing past it doesn't (Edges fade). The fade says there is more without a hard line across an item; the menu's padding and its rounded edge stay as they are.
- An action on the whole list, such as New section under a list of sections, Show all under the recent ones, or Edit under the places that don't fit, stays visible: put it in
DropdownMenuPinnedFooter, which keeps it below the scrolling items after a separator. Scrolled to its end, a long menu would otherwise hide the one item that doesn't depend on its length. Pin only that: an action on one item, or a section of the menu, scrolls with the others. - The arrow keys go from the last scrolling item to the pinned footer, and loop from there to the first item.
- A short menu looks as it always has: it fits, so nothing scrolls, fades or moves.
- Scrolling keeps a long menu usable; it doesn't make a long menu the right control. When people look for an item they know by name rather than scan for it (a person, an agent), give them a list they can type into, a Combobox (Choosing a component).
Sections and their order
A menu is read from the top, and the first items are the easiest to reach. Its sections answer two different questions: which actions go together (sections), and which section comes first (order). The object decides the sections; where the menu opens decides the order (cindyz, 2026-11-22, #proj-raft-ui:edecc8c7).
Sections. Put the actions on one object together, and the object the person opened the menu on first: a message, its thread, the column it shows in. Within one object, split the actions by what they change:
- Use it: open, look, reply, react, move it on (Mark as Done, Create task from message). The person stays with the thing.
- Take its content out: Quote, Copy link, Copy Markdown, Forward, Download, Open in browser. The thing doesn't change. Who can see goes here too, right after Copy link: people change who can see something to share it.
- Only for me: what others don't see, in two runs: how it reaches me (Follow, Mark as unread, Notifications, Mute) and where it sits for me (Pin, Move to section, Move left and right).
- Its settings: what everyone sees change: Rename, Edit, Settle, Start and Stop.
- End it: Leave, Close chat, Archive, Sign out, Delete.
- Tell Raft: Report abuse, View context.
When one object has only two or three actions, keep them one section rather than splitting them by what they change: Reply in thread, Follow thread and Mark thread as unread are one section of the message menu. A menu of three items needs at most one separator, under the item used most.
Order. Ask what the thing is where this menu opens, and put the section that serves that first. The same thing plays different parts in different places, so the same sections come in a different order:
Then put the other sections of 1 to 3 by how close they are to that part, and correct it with usage data where there is some. Sections 4, 5 and 6 always come last, in that order: they are used least and cost the most, so no menu moves them up. An action that already has a button where the menu opens, such as Reply with the composer below or a section's +, doesn't need to lead its menu.
- Put a new action at the end of its section, and move it up when usage data shows it is used more than the items above it.
- Give the same thing the same order wherever its menu opens (a header's ⋯, right-click, a long press), even when some of them show fewer items. A thing that plays a different part (a message in a conversation, a message in Saved) can take a different order.
- Give a pair of toggles one place: Follow and Unfollow swap in place.
- Give every item in a menu an icon, and no two items of one menu icons that look alike: people scan a menu by its icons (Iconography).
The message menu
The message menu starts with the quick reactions (Conversation; sizes in Brand).
- The 8 quick reactions at 22px, each a
MessageReactionQuickButtonthat is a menu item, so the arrow keys reach it. End the row with asmile-plusicon button that opens every emoji. That is 9 buttons of 36px, so the menu is as wide as the row (348px), wider than its 240px minimum and still inside a 360px screen; the actions take the same width. - Line the reactions up with the actions:
MessageReactionQuickRowkeeps 3px at each side, so the first drawing starts where the items' icons do (10px in), and the column the eye follows down the menu doesn't step out by 3px at the top. - Put one separator between the reactions and the first action, then the sections (Sections and their order; stdrc 2026-10-20, revised by cindyz 2026-11-22):
- Its thread: Reply in thread; Follow thread or Unfollow thread; Mark thread as unread. Inside a thread there is no Reply, and Follow and Mark as unread act on that thread.
- Its task: Create task from message, or Mark as Done and Reopen task on a task's message. A task's discussion lives in its thread, so it comes right after.
- Its content: Quote, Copy Markdown, Copy link, Forward, Select text (touch only), Select message. Nothing changes here. Copy Markdown keeps the message's formatting, which selecting the text and copying loses; it is the menu's most used item.
- Just for me: Save message or Remove from Saved, and Translate. Nobody else sees these.
- Tell Raft: View context, on an agent's message.
- Leave Mark channel as unread out of the message menu: it acts on the conversation, and the conversation's own menu has it.
- Leave out a section with nothing in it, and its separator with it.
API
DropdownMenu
DropdownMenuCheckboxItem
Also takes the attributes of its element.
DropdownMenuCheckboxItemIndicator
Also takes the attributes of its element.
DropdownMenuContent
Also takes the attributes of its element.
DropdownMenuFooter
Takes the attributes of its element.
DropdownMenuItem
Also takes the attributes of its element.
DropdownMenuItemCount
Also takes the attributes of its element.
DropdownMenuItemLabel, DropdownMenuLabel, DropdownMenuPopup
Takes the attributes of its element.
DropdownMenuPortal
Also takes the attributes of its element.
DropdownMenuRadioGroup
Also takes the attributes of its element.
DropdownMenuRadioItem
Also takes the attributes of its element.
DropdownMenuRadioItemIndicator
Also takes the attributes of its element.
DropdownMenuSeparator
Also takes the attributes of its element.
DropdownMenuShortcut
Takes the attributes of its element.
DropdownMenuSubmenu
DropdownMenuSubmenuTrigger
Also takes the attributes of its element.
DropdownMenuTrigger
Also takes the attributes of its element.
DropdownMenuLinkItem
Also takes the attributes of its element.
DropdownMenuPinnedFooter
Takes the attributes of its element.
Related
Changes
- 0.106.2 · ChangedList popups shrink and scroll on their side before flipping; the side axis is the last resort ([Elevation › Popups](https://raft-design.botiverse.build/foundations/elevation/#popups), [DropdownMenu › Long menus](https://raft-design.botiverse.build/components/dropdown-menu/#long-menus), [Popover › A long popover](https://raft-design.botiverse.build/components/popover/#a-long-popover)):
DropdownMenuContent,SelectContent,ComboboxContent, ComboboxSelect on a desktop and aPopoverContentwith aPopoverBodystay on the side they open on and shrink to the room there, scrolling their list, as long as it holds five rows (--popup-list-min-height: 178px with a mouse, 188px on a touch screen). With less they flip to the other side, and they open beside the trigger only when neither side holds five rows. - 0.106.2 · FixedA submenu opens beside its item ([DropdownMenu › Behavior](https://raft-design.botiverse.build/components/dropdown-menu/#behavior)): a
DropdownMenuContentinside aDropdownMenuSubmenuopens to the end side of its item, its first item level with it. Where it doesn't fit it flips to the other side, and where it fits on neither side it slides along the window's edge, still level with its item; it never drops above or below it. - 0.106.0 · Design SystemLong menus and popovers scroll inside the room they have ([DropdownMenu › Long menus](https://raft-design.botiverse.build/components/dropdown-menu/#long-menus), [Popover › A long popover](https://raft-design.botiverse.build/components/popover/#a-long-popover), [Elevation › Popups](https://raft-design.botiverse.build/foundations/elevation/#popups)): a popup is capped at the space left between its trigger and the window's edge, and what doesn't fit scrolls inside it, never clipped. The highlighted item of a menu stays in view and clear of the fade; the cut edges fade over up to 24px; an action on the whole list stays below the items (
DropdownMenuPinnedFooter); a popover keeps its header and buttons and scrolls its body. Changed in this release:DropdownMenuContent,ContextMenuContent,PopoverContent,PopoverBody,PreviewCardContent,PreviewCardBody. - 0.106.0 · Added
DropdownMenuPinnedFooterandContextMenuPinnedFooter(work in progress, from@botiverse/raft-ui/wip): items kept below a long menu's scrolling items, after a separator, at any scroll. Write it as the menu's last child; the arrow keys reach it after the last item. - 0.103.4 · FixedFrame insets (
Popover,DropdownMenu,ContextMenu,Select,Combobox,ComboboxSelect,Tooltip,PreviewCard,CoachMark,NotificationCenter,MobileNavServerPopover,ToastPositioner,ComposerSuggestionList):--raft-frame-inset-startand--raft-frame-inset-endare the corners of the window's top band (--raft-frame-inset-top), not columns down its sides. A popup anchored under the band keeps its own padding from the window's edge; only one anchored in the band (a title-bar control, or a context menu opened in the bar) keeps 8px clear of a corner. - 0.103.3 · FixedFrame insets (
useFrameInsets,frameCollisionBoundary): opening a positioned popup (Popover,DropdownMenu,Select,Combobox,ComboboxSelect,ContextMenu,Tooltip,PreviewCard,NotificationCenter,MobileNavServerPopover,ComposerSuggestionList) no longer stalls the main thread when--raft-frame-inset-*holds acalc()orenv(titlebar-area-*)expression on an overlay title bar. - 0.0.20 · AddedAdded
ContextMenuItemLabel,ContextMenuFooter,DropdownMenuItemLabel, andDropdownMenuFooterfor truncatable menu labels and structured footer content.