Edge Menu
A handle on a screen edge that slides out a rail of tool tiles.
On the main branch of shellui-native; not in the 0.2.0-beta.1 CLI yet.
A menu docked to a screen edge: a small handle that slides out a rail of icon tiles, for tools and shortcuts that shouldn't take a tab in the bottom nav.
ShellUI for Blazor has no edge menu, so the previews on this page are the Avalonia component itself, running in your browser. They start open; the handle closes and opens them.
Installation
shellui-native add edge-menu
Platforms: MAUI · Avalonia. Also installs icon, element-extensions.
Usage
Basic
<Grid>
<ScrollView>...</ScrollView>
<ui:EdgeMenu Side="Right" Position="0.4">
<ui:EdgeMenuItem Icon="Calendar" Text="Calendar" Clicked="OnCalendar" />
<ui:EdgeMenuItem Icon="Camera" Text="Camera" Clicked="OnCamera" />
<ui:EdgeMenuItem Icon="Image" Text="Images" Clicked="OnImages" />
<ui:EdgeMenuItem Icon="Share2" Text="Share" Clicked="OnShare" />
</ui:EdgeMenu>
</Grid><Grid>
<ScrollViewer>...</ScrollViewer>
<ui:EdgeMenu Side="Right" Position="0.4">
<ui:EdgeMenuItem Icon="Calendar" Text="Calendar" Clicked="OnCalendar" />
<ui:EdgeMenuItem Icon="Camera" Text="Camera" Clicked="OnCamera" />
<ui:EdgeMenuItem Icon="Image" Text="Images" Clicked="OnImages" />
<ui:EdgeMenuItem Icon="Share2" Text="Share" Clicked="OnShare" />
</ui:EdgeMenu>
</Grid>Put the menu over the page, in the same cell after the content. Only the handle and the open rail take input, so the page stays usable while the menu is closed. The handle opens it; a tap outside, Escape, the handle or a tile closes it.
Side puts it on the Right (the default) or Left edge, and Position places the handle along the edge: 0 at the top, 0.5 (the default) in the middle, 1 at the bottom.
Solid and dimmed
Variant="Solid" is a dock in the primary colour with tiles a shade lighter, and Dim darkens the page while the menu is open.
<ui:EdgeMenu Side="Left" Position="0.3" Variant="Solid" Dim="True" SelectedValue="pen">
<ui:EdgeMenuItem Value="pen" Icon="Pencil" Text="Pen" />
<ui:EdgeMenuItem Value="notes" Icon="FileText" Text="Notes" />
<ui:EdgeMenuItem Value="images" Icon="Image" Text="Images" />
<ui:EdgeMenuItem Value="settings" Icon="Settings" Text="Settings" />
</ui:EdgeMenu><ui:EdgeMenu Side="Left" Position="0.3" Variant="Solid" Dim="True" SelectedValue="pen">
<ui:EdgeMenuItem Value="pen" Icon="Pencil" Text="Pen" />
<ui:EdgeMenuItem Value="notes" Icon="FileText" Text="Notes" />
<ui:EdgeMenuItem Value="images" Icon="Image" Text="Images" />
<ui:EdgeMenuItem Value="settings" Icon="Settings" Text="Settings" />
</ui:EdgeMenu>Actions or a selection
Tiles can be plain actions: handle each tile's Clicked. Or give them a Value, and the menu keeps the picked one in SelectedValue (two-way) and highlights it, like a tool palette. SelectedValueChanged reports user input only: setting SelectedValue from code or a binding doesn't raise it.
CloseOnSelect (true by default) closes the menu when a tile is picked; set it to False to pick several tiles in a row.
Opening from code
IsOpen is two-way, and Open(), Close() and Toggle() set it. IsOpenChanged reports every open and close, like the other overlays.
Tools.IsOpenChanged += (_, open) => Status.Text = open ? "Tools open" : "Tools closed";
Tools.Open();
MAUI and Avalonia
- On Avalonia the tiles are tab stops: Enter or Space picks one, Up and Down move between them, and focus goes to the first tile when the menu opens and back to the handle when it closes. On MAUI a tile is picked with a tap or Enter / Space.
- On MAUI the back button also closes the menu on Android.
- The tiles are collected in
Items: anIList<EdgeMenuItem>on MAUI, aControlscollection on Avalonia.
API
EdgeMenu
XAML children go to Items.
| Property | Type | Default | Description |
|---|---|---|---|
IsOpen |
bool |
false |
Whether it's open. Two-way bindable. |
Side |
EdgeMenuSide |
Right |
The edge the menu is docked to. One of Right, Left. |
Position |
double |
0.5 |
Where the handle sits along the edge: 0 top, 0.5 middle, 1 bottom. |
Variant |
EdgeMenuVariant |
Default |
Visual style. One of Default, Solid. |
Dim |
bool |
false |
Dims the page while the menu is open. |
CloseOnSelect |
bool |
true |
Picking a tile closes the menu. |
SelectedValue |
string |
— | The highlighted tile's Value. Two-way bindable; optional, tiles can be plain actions. |
| Event | Arguments | Description |
|---|---|---|
IsOpenChanged |
bool |
Opened or closed; raised on every change. |
SelectedValueChanged |
string? |
The user picked another tile. Setting SelectedValue from code or a binding doesn't raise it. |
| Method | Description |
|---|---|
Open() |
Opens it. |
Close() |
Closes it. |
Toggle() |
Opens it if closed, closes it if open. |
EdgeMenuItem
| Property | Type | Default | Description |
|---|---|---|---|
Text |
string |
— | Label under the icon. |
Value |
string |
— | Identifies the tile for the menu's SelectedValue (optional). |
Icon |
IconName |
None |
Lucide icon from IconName; None for no icon. |
| Event | Arguments | Description |
|---|---|---|
Clicked |
— | Tapped, or Enter / Space with keyboard focus. |
| Method | Description |
|---|---|
Press() |
Picks the tile in code, as a tap or Enter / Space would. |