Skip to content

Menubar

Move across top-level menus before navigating each command hierarchy.

Usage

Application

Move across top-level application menus, then enter the open command list.

Move across top-level application menus, then enter the open command list.

Sectile Studio All changes saved
Untitled project

Choose a command from the menu bar

Disabled root

Skip an unavailable top-level menu while preserving movement between its siblings.

Skip an unavailable top-level menu while preserving movement between its siblings.

Sectile Studio All changes saved
Untitled project

View menu is unavailable in this workspace

Typeahead

Move to the next menu whose label matches the typed prefix.

Move to the next menu whose label matches the typed prefix.

Sectile Studio All changes saved
Untitled project

Focus the menu bar and type a menu name

API

Vue package: @sectile/vue/menubar

Components
  • MenubarItem
  • MenubarSeparator
  • MenubarContent
  • MenubarRoot

Props

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

disabled

Whether interaction is unavailable.

value

Current value exposed by this contract.

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

defaultHighlightedValue

Initially highlighted value for uncontrolled state.

disabled

Whether interaction is unavailable.

disabledItems

Item values excluded from focus and selection.

items

Ordered item values managed by the component.

label

Accessible name announced for the control.

policies

Behavior policies that customize validation, movement, or selection.

textValue

Returns searchable or presentational text for an item value.

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

for

Value or ID of the related part targeted by this component.

Slots

disabled

Whether interaction is unavailable.

highlighted

Whether this item is highlighted for interaction.

open

Whether the associated popup or disclosure is open.

value

Current value exposed by this contract.

disabled

Whether interaction is unavailable.

highlightedValue

Value currently highlighted for interaction.

open

Whether the associated popup or disclosure is open.

openPath

Ordered values in the open menu path.

Events

invoke

Emitted when the current action is invoked.

update:open

Emitted when the component requests a new open state.

Parts

Shared scope: [data-scope="menubar"]. Combine it with a part selector to keep styles local to this component.

PartSelectorRoleExtra attributes
root[data-part="root"]Defines the component boundary and owns its composed parts.
item[data-part="item"]Menu item at any hierarchy depth; use data-level to distinguish top-level and nested itemsdata-level="<depth>"
sub-content[data-part="sub-content"]Popup content owned by a parent menu itemdata-scope="menu"
data-level="<depth>"
separator[data-part="separator"]Separates related groups without becoming an action.data-scope="menu"

Keyboard interaction

KeyBehavior
Arrow Left / Arrow RightMove between root menu items.
Arrow Down / Arrow UpOpen a branch or move inside its vertical item list.
Home / EndMove to the first or last item at the current level.
Enter / SpaceOpen a branch or invoke the current item.
EscapeClose the branch and return to its owner.

Accessibility

The root exposes menubar semantics while opened branches use hierarchical menu items and roving focus.

See the corresponding WAI-ARIA pattern for the host accessibility contract.

Released under the MIT License.