Raft Design System

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.

StableAlso called Menu
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.

dropdown-menu/compositions/sidebar-section-header-menu

When to use

SituationUse
Act on one thing, from a buttonDropdownMenu
The same actions, on right-click or press and holdContextMenu, with the same items
A setting-style choice that applies at once (sort, status)DropdownMenu with radio items
A value submitted with a formSelect
A little input on click (snooze, rename)Popover
A place to go, on a phoneA bottom sheet (Drawer)

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 pass render. 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). className is 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 in DropdownMenuItemLabel to truncate it.
  • DropdownMenuShortcut: the keyboard shortcut at the end of an item, in text-mono-meta and foreground-hint.
  • DropdownMenuItemCount: a count at the end of an item.
  • DropdownMenuRadioGroup and DropdownMenuRadioItem: 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; current marks 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.
  • DropdownMenuSubmenu and DropdownMenuSubmenuTrigger: 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.
  • DropdownMenuPortal and DropdownMenuPopup: lower-level parts. DropdownMenuPopup is 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-soft highlight 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-disabled text 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 menu role, 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-label on DropdownMenuContent ("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 DropdownMenuItemLabel is cut with an ellipsis. Put user content (a title, a name) in DropdownMenuItemLabel, 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. collisionAvoidance replaces 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).
dropdown-menu/compositions/long-menu

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:

  1. Use it: open, look, reply, react, move it on (Mark as Done, Create task from message). The person stays with the thing.
  2. 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.
  3. 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).
  4. Its settings: what everyone sees change: Rename, Edit, Settle, Start and Stop.
  5. End it: Leave, Close chat, Archive, Sign out, Delete.
  6. 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:

Where the menu opensThe thing isFirst section
A message in a conversationA turn in a conversationIts thread and task
A thread's or task's header, an Artifact's ⋯Work the person followsFollow, then comments and versions
A conversation's row in the sidebarA place to look at or notMark as read, Notifications
A row in ActivityA notification to handleMark as read, Mark as Done, Unfollow
Saved, a public Artifact, a browser tabContent to take awayTake its content out
An agent's or person's profileSomeone to reachDirect message, Call
A computer, a connection, a sidebar sectionSomething to run or arrangeCreate agent, Reauthorize, Sort

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 MessageReactionQuickButton that is a menu item, so the arrow keys reach it. End the row with a smile-plus icon 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: MessageReactionQuickRow keeps 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):
    1. 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.
    2. 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.
    3. 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.
    4. Just for me: Save message or Remove from Saved, and Translate. Nobody else sees these.
    5. 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

PropTypeDefault
actionsRefA ref to imperative actions. - `unmount`: Ends the closing phase of the menu after an externally controlled closing animation finishes. Call `preventUnmountOnClose()` in `onOpenChange` first, otherwise the menu completes closing on its own. Whether it leaves the DOM is decided by `keepMounted` on the portal. - `close`: Closes the menu imperatively when called.RefObject<MenuRootActions | null>
childrenThe content of the menu. This can be a regular React node or a render function that receives the `payload` of the active trigger.ReactNode | PayloadChildRenderFunction<unknown>
closeParentOnEscWhen in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu.booleanfalse
defaultOpenWhether the menu is initially open.booleanfalse
defaultTriggerIdID of the trigger that the menu is associated with. This is useful in conjunction with the `defaultOpen` prop to create an initially open menu.string
disabledWhether the component should ignore user interaction.booleanfalse
handleA handle to associate the menu with a trigger. If specified, allows external triggers to control the menu's open state.BaseMenu.Handle<unknown>
highlightItemOnHoverWhether moving the pointer over items should highlight them. Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state.booleantrue
loopFocusWhether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.booleantrue
modalDetermines if the menu enters a modal state when open. - `true`: user interaction is limited to the menu: document page scroll is locked and pointer interactions on outside elements are disabled. - `false`: user interaction with the rest of the document is allowed.booleantrue
onItemHighlightedCallback fired when an item is highlighted or unhighlighted. Receives the highlighted item element (or `undefined` if no item is highlighted) and details containing the reason for the change, the event, and the item's text label. The `reason` can be: - `'keyboard'`: the highlight changed due to keyboard navigation. - `'pointer'`: the highlight changed due to pointer hovering. The event may be a `MouseEvent` rather than a `PointerEvent`. - `'none'`: the highlight changed for another reason, such as automatic highlighting while filtering, the item list changing, or the popup opening or closing.(highlightedItem: HTMLElement | undefined, eventDetails: BaseMenu.Root.HighlightEventDetails) => void
onOpenChangeEvent handler called when the menu is opened or closed.(open: boolean, eventDetails: BaseMenu.Root.ChangeEventDetails) => void
onOpenChangeCompleteEvent handler called after any animations complete when the menu is opened or closed.(open: boolean) => void
openWhether the menu is currently open.boolean
orientationThe visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys.MenuRootOrientation'vertical'
triggerIdID of the trigger that the menu is associated with. This is useful in conjunction with the `open` prop to create a controlled menu. There's no need to specify this prop when the menu is uncontrolled (that is, when the `open` prop is not set).string
PropTypeDefault
checkedWhether the checkbox item is currently ticked.boolean
closeOnClickWhether to close the menu when the item is clicked.booleanfalse
defaultCheckedWhether the checkbox item is initially ticked.booleanfalse
disabledWhether the component should ignore user interaction.booleanfalse
idstring
labelOverrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided.string
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button.booleanfalse
onCheckedChangeEvent handler called when the checkbox item is ticked or unticked.(checked: boolean, eventDetails: BaseMenu.CheckboxItem.ChangeEventDetails) => void
onClickThe click handler for the menu item.(event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

PropTypeDefault
keepMountedWhether to keep the HTML element in the DOM when the checkbox item is not checked.booleanfalse
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

The menu: its items scroll inside the room the positioner leaves it (`--available-height`), with their edges faded, and a `DropdownMenuPinnedFooter` stays below them. `className` is the popup's (its width); the items are laid out in a column inside the scroller.
PropTypeDefault
portalPropsContextMenuPortalProps
alignHow to align the popup relative to the specified side.Align'center'
alignOffsetAdditional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment.number | OffsetFunction0
anchorAn element to position the popup against. By default, the popup will be positioned against the trigger.Element | VirtualElement | RefObject<Element | null> | (() => Element | VirtualElement | null)
arrowPaddingMinimum distance to maintain between the arrow and the edges of the popup.number5
childrenReactNode
collisionAvoidanceDetermines how to handle collisions when positioning the popup.CollisionAvoidance
collisionBoundaryAn element or a rectangle that delimits the area that the popup is confined to.Boundary'clipping-ancestors'
collisionPaddingAdditional space to maintain from the edge of the collision boundary.Padding5
disableAnchorTrackingWhether to disable the popup from tracking any layout shift of its positioning anchor.booleanfalse
finalFocusDetermines the element to focus when the menu is closed.boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void)
idstring
positionMethodDetermines which CSS `position` property to use."fixed" | "absolute"'absolute'
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)
sideWhich side of the anchor element to align the popup against. May automatically change to avoid collisions.Side'bottom'
sideOffsetDistance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment.number | OffsetFunction0
stickyWhether to maintain the popup in the viewport after the anchor element was scrolled out of view.booleanfalse

Also takes the attributes of its element.

Takes the attributes of its element.

PropTypeDefault
closeOnClickWhether to close the menu when the item is clicked.booleantrue
disabledWhether the component should ignore user interaction.booleanfalse
idstring
labelOverrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided.string
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button.booleanfalse
onClickThe click handler for the menu item.(event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

PropTypeDefault
appearance"outline" | "solid" | "soft"
variant"primary" | "accent" | "warning" | "danger" | "default" | "information" | "muted" | "success" | "busy" | "you"
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

Takes the attributes of its element.

PropTypeDefault
containerA parent element to render the portal element into.HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null>
keepMountedWhether to keep the portal mounted in the DOM while the popup is hidden.booleanfalse
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

PropTypeDefault
childrenThe content of the component.ReactNode
defaultValueThe uncontrolled value of the radio item that should be initially selected.any
disabledWhether the component should ignore user interaction.booleanfalse
onValueChangeFunction called when the selected value changes.(value: any, eventDetails: BaseMenu.RadioGroup.ChangeEventDetails) => void
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)
valueThe controlled value of the radio item that should be currently selected.any

Also takes the attributes of its element.

PropTypeDefault
closeOnClickWhether to close the menu when the item is clicked.booleantrue
disabledWhether the component should ignore user interaction.booleanfalse
idstring
labelOverrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided.string
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button.booleanfalse
onClickThe click handler for the menu item.(event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)
value (required)Value of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected.any

Also takes the attributes of its element.

PropTypeDefault
keepMountedWhether to keep the HTML element in the DOM when the radio item is inactive.booleanfalse
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

PropTypeDefault
orientationThe orientation of the separator.Orientation'horizontal'
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

Takes the attributes of its element.

PropTypeDefault
actionsRefA ref to imperative actions. - `unmount`: Ends the closing phase of the menu after an externally controlled closing animation finishes. Call `preventUnmountOnClose()` in `onOpenChange` first, otherwise the menu completes closing on its own. Whether it leaves the DOM is decided by `keepMounted` on the portal. - `close`: Closes the menu imperatively when called.RefObject<MenuRootActions | null>
childrenThe content of the submenu.ReactNode
closeParentOnEscWhen in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu.booleanfalse
defaultOpenWhether the menu is initially open.booleanfalse
disabledWhether the component should ignore user interaction.booleanfalse
highlightItemOnHoverWhether moving the pointer over items should highlight them. Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state.booleantrue
loopFocusWhether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.booleantrue
onItemHighlightedCallback fired when an item is highlighted or unhighlighted. Receives the highlighted item element (or `undefined` if no item is highlighted) and details containing the reason for the change, the event, and the item's text label. The `reason` can be: - `'keyboard'`: the highlight changed due to keyboard navigation. - `'pointer'`: the highlight changed due to pointer hovering. The event may be a `MouseEvent` rather than a `PointerEvent`. - `'none'`: the highlight changed for another reason, such as automatic highlighting while filtering, the item list changing, or the popup opening or closing.(highlightedItem: HTMLElement | undefined, eventDetails: BaseMenu.Root.HighlightEventDetails) => void
onOpenChangeEvent handler called when the menu is opened or closed.(open: boolean, eventDetails: BaseMenu.SubmenuRoot.ChangeEventDetails) => void
onOpenChangeCompleteEvent handler called after any animations complete when the menu is opened or closed.(open: boolean) => void
openWhether the menu is currently open.boolean
orientationThe visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys.MenuRootOrientation'vertical'
PropTypeDefault
closeDelayHow long to wait before closing the menu that was opened on hover. Specified in milliseconds.number0
delayHow long to wait before the menu may be opened on hover. Specified in milliseconds.number100
disabledWhether the component should ignore user interaction.booleanfalse
idstring
labelOverrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided.string
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `true` if the rendered element is a native button.booleanfalse
onClick(event: BaseUIEvent<MouseEvent<HTMLDivElement, MouseEvent>>) => void
openOnHoverWhether the menu should also open when the trigger is hovered.booleantrue
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

PropTypeDefault
childrenReactNode
closeDelayHow long to wait before closing the menu that was opened on hover. Specified in milliseconds.number0
delayHow long to wait before the menu may be opened on hover. Specified in milliseconds.number100
disabledWhether the component should ignore user interaction.booleanfalse
handleA handle to associate the trigger with a menu.BaseMenu.Handle<unknown>
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).booleantrue
openOnHoverWhether the menu should also open when the trigger is hovered.boolean
payloadA payload to pass to the menu when it is opened.{}
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)<Button variant="outline" size="md" />

Also takes the attributes of its element.

ExperimentalOne choice that is another page, such as the same page in another language: a link, so it opens in a new tab and can be copied. Its `href` goes on the item; `current` marks the page being shown.
PropTypeDefault
currentThe page being shown: `aria-current="page"`, drawn as the chosen value of a radio group (a check mark and bold text).booleanfalse
closeOnClickWhether to close the menu when the item is clicked.booleanfalse
idstring
labelOverrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided.string
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

ExperimentalItems kept below the menu's scrolling items, after a separator, however long the list is: an action on the whole list (Edit, New section, Show all). Write it among the items, as the menu's last child; it is drawn below the scroller and comes last for the arrow keys too.

Takes the attributes of its element.

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 a PopoverContent with a PopoverBody stay 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 DropdownMenuContent inside a DropdownMenuSubmenu opens 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 · AddedDropdownMenuPinnedFooter and ContextMenuPinnedFooter (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-start and --raft-frame-inset-end are 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 a calc() or env(titlebar-area-*) expression on an overlay title bar.
  • 0.0.20 · AddedAdded ContextMenuItemLabel, ContextMenuFooter, DropdownMenuItemLabel, and DropdownMenuFooter for truncatable menu labels and structured footer content.