Menubar
A keyboard-coordinated bar of independent command panels.
A horizontal menubar with roving keyboard focus and independent dropdown command panels.
Preview
Section titled “Preview” Web Components React Vue Vue 2
Loading interactive preview… The article and source are ready to read. Interactive controls will appear here when ready.
Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases.
Compose Root, Trigger, Content, Item, and optional Group, Label, Separator, CheckboxItem, RadioGroup, RadioItem, Sub, SubTrigger, and SubContent:
- Panel pairing:
Rootmanages the active panel state viavalue, pairing eachTriggerandContentthat share the samevalue. - Controlled and uncontrolled: Pass
valuefor controlled mode (interactions emit change requests without mutating external state), or usedefaultValuefor an uncontrolled initial panel. - Keyboard and focus: The bar uses a single roving tab stop with Left/Right movement across triggers,
ArrowDown/ArrowUpto enter a panel, and vertical navigation with typeahead inside menus. PressingArrowRighton aSubTriggeropens its submenu instead of switching panels, andArrowLeftorEscapeinside a submenu closes only that submenu and returns focus to itsSubTrigger. - Grouping and selection items:
Group,Label, andSeparatorprovide group naming and dividers;CheckboxItemandRadioGroup/RadioItemexposemenuitemcheckboxandmenuitemradiosemantics and keep the menu open by default on activation.
| Prop | Type | Default |
|---|---|---|
defaultValue | string | '' |
disabled | boolean | false |
loop | boolean | true |
a11yLabel | string | '' |
Pass value to control the active panel identifier.
Part Props
Section titled “Part Props”- Trigger:
value(default''),disabled(defaultfalse). - Content:
value(default''),a11yLabel(default''),sideOffset(default4). - Item:
value(default''),textValue(default''),disabled(defaultfalse),closeOnSelect(defaulttrue). - Group / Label / Separator:
Groupacceptsa11yLabel('') and links to a scopedLabel;Separatorexposes horizontalrole="separator". - CheckboxItem / RadioGroup / RadioItem:
CheckboxItemsupportschecked,defaultChecked,indeterminate, andcloseOnCommit/closeOnSelect;RadioGroupsupportsvalue,defaultValue,disabled, anda11yLabel;RadioItemrequiresvalueand keeps the menu open by default. - Sub / SubTrigger / SubContent:
Subacceptsopen,defaultOpen,disabled;SubTriggeracceptsvalue,textValue,disabled;SubContentdefaults to'right'/'start'placement with positioning and Transition props.