Menubar

A menu bar providing commands and options for your application.

Base UI React 1.8.0
FineSoft Stencil
FileEditViewHelp

Anatomy

Import the component and assemble its parts:

Anatomy

Stencil usage

The examples above include the frozen React implementation and the corresponding Stencil implementation. Import finesoft-components/menubar to register fs-menubar-root, and use the Menu parts for its menus.

Stencil anatomy

disabled, modal, orientation, and loopFocus retain the Menubar defaults. The native menubar exposes data-orientation, data-modal, and data-has-submenu-open. Menu state and events remain on each fs-menu-root; Menubar coordinates focus and menu switching.

API reference

loopFocusbooleantrue
Description

Whether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.

Type
Default
true
modalbooleantrue
Name
Description

Whether the menubar is modal.

Type
Default
true
disabledbooleanfalse
Description

Whether the whole menubar is disabled.

Type
Default
false
orientationMenuRoot.Orientation'horizontal'
Description

The orientation of the menubar.

Type
Default
'horizontal'
classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Description

Style applied to the element, or a function that returns a style object based on the component’s state.

Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type
data-orientation

Determines the orientation of the menubar.

data-has-submenu-open

Present when any submenu within the menubar is open.

data-modal

Present when the corresponding menubar is modal.

Attribute
Description
data-orientation

Determines the orientation of the menubar.

data-has-submenu-open

Present when any submenu within the menubar is open.

data-modal

Present when the corresponding menubar is modal.