Menubar
A row of menus, like a desktop app's File, Edit and View.
Installation
bash
shellui-native add menubar
Platforms: MAUI · Avalonia. Also installs icon.
Usage
Basic
Each menu opens a panel of items under its title. Clicking outside, picking an item or pressing Escape closes it, and opening one menu closes the other. Shortcut is a hint at the end of the row; it doesn't register a key.
MAUI and Avalonia
- On Avalonia the titles are tab stops: Enter, Space or Down opens a menu, and Left / Right move between titles.
- In an open Avalonia menu, Up / Down move between the items and Enter picks one.
- On Avalonia the menus are collected in
Menusand a menu's items inItems.
API
Menubar
XAML children go to Menus.
No properties of its own.
MenubarMenu
XAML children go to Items.
| Property | Type | Default | Description |
|---|---|---|---|
Title |
string |
— | The menu's name in the bar. |
| Event | Arguments | Description |
|---|---|---|
Opened |
— | The menu opened. |
Closed |
— | The menu closed. |
| Method | Description |
|---|---|
SetOpen(bool open) |
Opens or closes it. |
Close() |
Closes it. |
MenubarItem
| Property | Type | Default | Description |
|---|---|---|---|
Text |
string |
— | Item text. |
Icon |
IconName |
None |
Lucide icon from IconName; None for no icon. |
Shortcut |
string |
— | Keyboard hint shown at the end of the row (display only). |
IsDestructive |
bool |
false |
Draws the item in the destructive colour. |
| Event | Arguments | Description |
|---|---|---|
Clicked |
— | Clicked or tapped (or Enter / Space with keyboard focus). |
| Method | Description |
|---|---|
Press() |
Picks the item in code, as a click or Enter/Space would. Avalonia only. |
MenubarSeparator
No properties of its own.