Skip to content

Menubar

A visually persistent menu common in desktop applications that provides quick access to a consistent set of commands.

Top-level triggers use Left/Right and Home/End roving focus. Pointer opening leaves the content panel neutral, while keyboard Enter, Space, or ArrowDown opening focuses its first enabled item. Open menus use Up/Down, Home/End, typeahead, Enter/Space, and direction-aware submenu keys while skipping disabled entries.

MenuRoot Loop="true" wraps top-level focus. Configure Loop separately on MenubarContent and MenubarSubContent, use Direction for LTR/RTL key direction, and supply TextValue for non-textual item labels.

MenuRoot is modal by default, so an open menu contains focus, locks document scrolling, and consumes outside activation while closing. Set Modal="false" for a non-modal menubar.

Top-level and nested Menubar panels follow shadcn's non-scrolling overflow-hidden sizing. They do not inherit DropdownMenu's available-height scroll container; use Css on MenubarContent when an application deliberately needs a different overflow policy.

MenubarCheckboxItem and MenubarRadioGroup provide checked-state choices. Call PreventDefault() from OnSelecting to apply a choice without closing the menu.

Top-level and submenu content is named by its trigger automatically unless an explicit aria-label or aria-labelledby is supplied. Attributes on Non-class attributes on MenubarSubContent reach the floating role="menu" wrapper; a splatted class is merged onto its styled content surface.

True static SSR progressively enhances MenuRoot in the browser. Click, Enter, Space, Left/Right, Home/End, horizontal wrapping, RTL direction, pointer switching between open top-level menus, nested Menu keyboard navigation, modal isolation, Escape, outside click, and focus return work without a Blazor circuit.

Enabled leaf commands dispatch the bubbling, cancelable shardui:menubar-select event with instanceId, menuValue, itemId, textValue, itemType, checked, and value. Canceling keeps the menu open while checkable state still changes.

Interactive items expose typed OnSelecting and compatibility OnSelect callbacks. In static SSR, use the browser event because .NET callbacks are initial-response metadata only.

document.addEventListener("shardui:menubar-select", event => {
  runCommand(event.detail.itemId);
});
An unhandled error has occurred. Reload 🗙

    Rejoining the server...

    Rejoin failed... trying again in seconds.

    Failed to rejoin.
    Please retry or reload the page.

    The session has been paused by the server.

    Failed to resume the session.
    Please reload the page.