Menubar

A horizontal bar of menus sharing one roving focus.

EXAMPLEwasm · webgpu

This demo runs the real GPUI component on WebGPU, which this browser does not expose.

Try Chrome or Edge 113+, or Safari 26+. In Firefox, enable dom.webgpu.enabled.

You can also run it natively: cargo run -p showcase menubar

The demo failed to start in this browser.

You can run it natively instead: cargo run -p showcase menubar

Live examples are not supported on most mobile browsers yet — open this page on a desktop or tablet to run the demo.

Recent phones with WebGPU may manage it (downloads ~18 MB):

#Anatomy

Import the component's parts and compose them under its root:

use base_gpui::menubar::{
    Menubar,
};

Menubar::new();
The anatomy is a structural overview. Parts with mutually exclusive modes may need separate instances; each part's section below documents its configuration.

Public renderable part of the Menubar component.

Source

use base_gpui::menubar::Menubar;

Menubar::new()
    .id("example-id")
    .orientation(/* orientation: MenubarOrientation */)
    .loop_focus(true)
    .modal(true)
    .disabled(true)
    .aria_label("label")
    .style_with_state(|/* callback arguments */| { /* handle change */ });
BuilderSignature & description

#Accessibility

Keyboard interaction and accessibility semantics are implemented by the component, independently of visual styling. Known limitations caused by missing GPUI accessibility primitives are documented in the module source and are not silently approximated.

#Stability

Base GPUI is pre-1.0. Builder names and state types may evolve as GPUI and this port mature.