Skip to content
SevenUI
Sign in
On this page

Dropdown Menu

Displays a menu to the user — such as a set of actions or functions — triggered by a button, built on the Base UI Menu primitive.

Installation

Bash

Usage

API reference

Extends the Base UI Menu Root — all its props apply.

PropTypeDefault
open / defaultOpenbooleanfalse
onOpenChange(open: boolean) => void—
modalbooleantrue
loopFocusboolean — arrow keys wrap (not loop)true
closeParentOnEscboolean — Esc in a submenu closes the parent—

The only part rendering a native <button>; accepts the render prop. Hover-opening lives here (and on DropdownMenuSubTrigger), not the Root.

PropTypeDefault
openOnHoverbooleanfalse
delaynumber100 (ms)

All render <div> elements — disabled styling comes from the data-disabled attribute, not the disabled HTML attribute. closeOnClick defaults differ: true on Item, false on CheckboxItem/RadioItem, so toggling options keeps the menu open.

PropTypeDefault
variant (Item)"default" | "destructive""default"
insetboolean — align with checkablesfalse
checked / onCheckedChange (CheckboxItem)boolean / callback—
value (RadioItem)string (required)—

DropdownMenuLabel must be placed inside DropdownMenuGroup or DropdownMenuRadioGroup — Base UI wires the group’s aria-labelledby to it and throws otherwise. DropdownMenuRadioGroup takes value/onValueChange.

Submenus wrap SubmenuRoot (not a nested root). Positioning is automatic and RTL-aware — it defaults to side="inline-end" align="start"; don’t override with a hardcoded side="right".

Styled parts; the shortcut is a plain span for trailing hints.

Was this page helpful?