Skip to content
GitHub11 stars

A menu bar providing commands and options for your application.

<MenubarRoot class="menubar">
    <MenuRoot>
        <MenuTrigger class="menubar-menu-trigger">

Anatomy

Import the primitives and assemble the parts:

@using Blazix.Primitives

<MenubarRoot>
    <MenuRoot>
        <MenuTrigger />
        <MenuPortal>
            <MenuBackdrop />
            <MenuPositioner>
                <MenuPopup>
                    <MenuArrow />
                    <MenuItem />
                    <MenuLinkItem />
                    <MenuSeparator />

                    <MenuSubmenuRoot>
                        <MenuSubmenuTrigger />
                    </MenuSubmenuRoot>

                    <MenuGroup>
                        <MenuGroupLabel />
                    </MenuGroup>

                    <MenuRadioGroup>
                        <MenuRadioItem>
                            <MenuRadioItemIndicator />
                        </MenuRadioItem>
                    </MenuRadioGroup>

                    <MenuCheckboxItem>
                        <MenuCheckboxItemIndicator />
                    </MenuCheckboxItem>

                    <MenuViewport />
                </MenuPopup>
            </MenuPositioner>
        </MenuPortal>
    </MenuRoot>
</MenubarRoot>

API Reference

Renders a <div> element.

ParameterTypeDefault
Modal bool true
Disabled

Whether the component should ignore user interaction.

bool false
Orientation

Which way the parts are laid out, and which arrow keys move between them.

Orientation Orientation.Horizontal
LoopFocus bool true
Render RenderFragment<MenubarRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-orientation

Determines the orientation of the menubar.

'horizontal' | 'vertical'
data-has-submenu-open

Present when any submenu within the menubar is open.

-
data-modal

Present when the corresponding menubar is modal.

-