Navigation Menu

A row of top-level links for an app header, where an item can open a panel of links.

Installation

bash
shellui-native add navigation-menu

Platforms: MAUI · Avalonia. Also installs icon.

Usage

Basic

Rendered with ShellUI for Blazor

Last link: none

<ui:NavigationMenu>
    <ui:NavigationMenuItem Title="Getting started">
        <ui:NavigationMenuLink Title="Introduction" Description="What ShellUI Native is and how it works." Clicked="OnLink" />
        <ui:NavigationMenuLink Title="Installation" Description="Add the CLI and your first component." Clicked="OnLink" />
    </ui:NavigationMenuItem>
    <ui:NavigationMenuItem Title="Components">
        <ui:NavigationMenuLink Title="Button" Description="Variants, sizes, icons and loading." Clicked="OnLink" />
        <ui:NavigationMenuLink Title="Dialog" Description="A modal window over the page." Clicked="OnLink" />
    </ui:NavigationMenuItem>
    <ui:NavigationMenuItem Title="Docs" Clicked="OnDocs" />
</ui:NavigationMenu>
Avalonia, running in your browser

An item with links inside shows a chevron and opens a panel of them. An item without links is a plain link that raises Clicked. A link can also have an Icon.

MAUI and Avalonia

  • On Avalonia the items are tab stops: Enter, Space or Down opens a panel, and Left / Right move between items.
  • In an open Avalonia panel, Up / Down move between the links and Enter picks one.
  • On Avalonia the items are collected in Items and an item's links in Links.

API

XAML children go to Items.

No properties of its own.

XAML children go to Links.

Property Type Default Description
Title string — The item's text in the row.
Event Arguments Description
Clicked — An item without links was pressed.
Method Description
SetOpen(bool open) Opens or closes it.
Close() Closes it.
Press() Opens the panel, or raises Clicked when there are no links, as a click or Enter would. Avalonia only.
Property Type Default Description
Title string — Link text.
Description string — Supporting text under the title.
Icon IconName None Lucide icon from IconName; None for no icon.
Event Arguments Description
Clicked — Clicked or tapped (or Enter / Space with keyboard focus).
Method Description
Press() Picks the link in code, as a click or Enter/Space would. Avalonia only.

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 retry or reload the page.