PointThe positioning point for the menu. Can be set by the context menu trigger or the button trigger.
aria-label
stringThe accessibility label for the menu
closeOnSelect
true
booleanWhether to close the menu when an option is selected
composite
true
booleanWhether the menu is a composed with other composite widgets like a combobox or tabs
defaultHighlightedValue
stringThe initial highlighted value of the menu item when rendered.
Use when you don't need to control the highlighted value of the menu item.
defaultOpen
booleanThe initial open state of the menu when rendered.
Use when you don't need to control the open state of the menu.
highlightedValue
stringThe controlled highlighted value of the menu item.
id
stringThe unique identifier of the machine.
ids
{
trigger?: string;
contextTrigger?: string;
content?: string;
groupLabel(id: string)?: string;
group(id: string)?: string;
positioner?: string;
arrow?: string;
}The ids of the elements in the menu. Useful for composition.
loopFocus
false
booleanWhether to loop the keyboard navigation.
navigate
(details: NavigateDetails) => voidFunction to navigate to the selected item if it's an anchor element
onEscapeKeyDown
(event: KeyboardEvent) => voidFunction called when the escape key is pressed
onFocusOutside
(event: FocusOutsideEvent) => voidFunction called when the focus is moved outside the component
onHighlightChange
(details: HighlightChangeDetails) => voidFunction called when the highlighted menu item changes.
onInteractOutside
(event: InteractOutsideEvent) => voidFunction called when an interaction happens outside the component
onOpenChange
(details: OpenChangeDetails) => voidFunction called when the menu opens or closes
onPointerDownOutside
(event: PointerDownOutsideEvent) => voidFunction called when the pointer is pressed down outside the component
onSelect
(details: SelectionDetails) => voidFunction called when a menu item is selected.
open
booleanThe controlled open state of the menu
positioning
PositioningOptionsThe options used to dynamically position the menu
typeahead
true
booleanWhether the pressing printable characters should trigger typeahead navigation
Arrow
Prop
Default
Description
asChild
SnippetRender a different element.
ArrowTip
Prop
Default
Description
asChild
SnippetRender a different element.
Content
Prop
Default
Description
asChild
SnippetRender a different element.
Data Attribute
Value
data-part
content
data-placement
The placement of the content
data-scope
menu
data-state
"open" | "closed"
ContextTrigger
Prop
Default
Description
asChild
SnippetRender a different element.
Indicator
Prop
Default
Description
asChild
SnippetRender a different element.
Data Attribute
Value
data-part
indicator
data-scope
menu
data-state
"open" | "closed"
Item
Prop
Default
Description
closeOnSelect
booleanWhether the menu should close when the item is selected.
disabled
booleanWhether the item is disabled.
value
stringThe value of the item.
valueText
stringThe text value of the item.
asChild
SnippetRender a different element.
Data Attribute
Value
data-disabled
Present when disabled
data-highlighted
Present when highlighted
data-part
item
data-scope
menu
data-value
The value of the item
data-valuetext
The human-readable value
ItemGroup
Prop
Default
Description
asChild
SnippetRender a different element.
ItemGroupLabel
Prop
Default
Description
asChild
SnippetRender a different element.
OptionItem
Prop
Default
Description
checked
booleanWhether the item is checked.
closeOnSelect
booleanWhether the menu should close when the item is selected.
disabled
booleanWhether the item is disabled.
onCheckedChange
(checked:boolean)=>voidCallback for when the item is checked.
type
'checkbox' | 'radio'The type of the item.
value
stringThe value of the item
valueText
stringThe text value of the item.
Data Attribute
Value
data-disabled
Present when disabled
data-highlighted
Present when highlighted
data-part
item
data-scope
menu
data-value
The value of the item
data-valuetext
The human-readable value
OptionItemIndicator
Prop
Default
Description
asChild
SnippetRender a different element.
Data Attribute
Value
data-disabled
Present when disabled
data-highlighted
Present when highlighted
data-part
item-indicator
data-scope
menu
data-state
"checked" | "unchecked"
OptionItemText
Prop
Default
Description
asChild
SnippetRender a different element.
Data Attribute
Value
data-disabled
Present when disabled
data-highlighted
Present when highlighted
data-part
item-text
data-scope
menu
data-state
"checked" | "unchecked"
Positioner
Prop
Default
Description
asChild
SnippetRender a different element.
Separator
Prop
Default
Description
asChild
SnippetRender a different element.
Trigger
Prop
Default
Description
asChild
SnippetRender a different element.
Data Attribute
Value
data-part
trigger
data-placement
The placement of the trigger
data-scope
menu
data-state
"open" | "closed"
TriggerItem
Prop
Default
Description
asChild
SnippetRender a different element.
Accessibility
Keyboard Support
Key
Description
Space
Activates/Selects the highlighted item
Enter
Activates/Selects the highlighted item
ArrowDown
Highlights the next item in the menu
ArrowUp
Highlights the previous item in the menu
ArrowRight + ArrowLeft
When focus is on trigger, opens or closes the submenu depending on reading direction.