Menubar
Horizontal menu bar (File/Edit/View); each label opens its own menu.
ui overlay
Preview
Installation
npx slintcn@latest add menubarUsage
import { Menubar, MenubarMenu, MenubarItem } from "slintcn/components/menubar.slint";
Menubar {
menus: [
{ label: "File", items: [{ label: "New" }, { label: "Save" }] },
{ label: "Edit", items: [{ label: "Undo" }, { label: "Redo" }] },
];
selected(mi, ii) => { /* … */ }
}
Properties
menus
in
[MenubarMenu]
Top-level menus (File / Edit / View / …), each with its own `items`.
highlighted-index
in-out
int
Row highlighted by ↑/↓ inside the currently-open popup.
selected
callback
(int /* menu */, int /* item */)
Fired with the menu index and the chosen item's index; the popup closes.
API
Accessibility
focusableyeskeyboardArrow keysEnterEscapedismissesDependencies
theme only
Installed automatically as transitive dependencies of slintcn add menubar.