maui-shell-navigation
What it does
This skill guides page navigation in .NET MAUI apps using Shell, including tabs, flyout menus and routes between pages. It is for developers building the navigation structure of a MAUI app.
When to use it
- βWhen you need tabs or a flyout menu for the main structure of a MAUI app.
- βWhen you want to move between pages in code with a route.
- βWhen you want to ask the user before leaving a page with unsaved changes.
Skill link
https://github.com/dotnet/skills/blob/main/plugins/dotnet-maui/skills/maui-shell-navigation/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSet up Shell navigation for my MAUI app with three tabs and a detail page that opens from the list.β
5 new skills a week. 1 minute to read.
How it works
The agent sets up the shell structure in its XAML file, registers routes for detail pages, and uses route-based navigation to move between pages with any data passed as parameters.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
.NET MAUI Shell Navigation
Implement page navigation in .NET MAUI apps using Shell. Shell provides URI-based navigation, a flyout menu, tab bars, and a four-level visual hierarchy β all configured declaratively in XAML.
When to Use
- Setting up top-level app navigation with tabs or a flyout menu
- Navigating between pages programmatically with
GoToAsync - Passing data between pages via query parameters or object parameters
- Registering detail-page routes for push navigation
- Guarding navigation with confirmation dialogs (e.g., unsaved changes)
- Customizing back button behavior per page
When Not to Use
- Deep linking from external URLs or app links β see .NET MAUI deep linking docs
- Data binding on navigation target pages β use
maui-data-binding - Dependency injection for pages and view models β use
maui-dependency-injection - Apps using
NavigationPagewithout Shell (different navigation API)
Inputs
- A .NET MAUI project with
AppShell.xamlas the root shell - Pages (
ContentPage) to navigate between - Route names for detail pages not in the visual hierarchy
Rules That Change the Answer
These are the Shell-specific decisions that are easy to get wrong. Apply them whenever they are relevant to what the user asked.
| Situation | Do this | Not this |
|---|---|---|
Declaring pages in AppShell.xaml |
With xmlns:views="clr-namespace:MyApp.Views" declared: <ShellContent ContentTemplate="{DataTemplate views:MyPage}" /> β the page is created on first navigation |
<ShellContent><views:MyPage /></ShellContent>, which constructs every page at startup |
| Navigating to a page not in the visual hierarchy | Routing.RegisterRoute("details", typeof(DetailsPage)) first |
Calling GoToAsync("details") unregistered β it throws at runtime |
| Receiving navigation parameters | Implement IQueryAttributable on the ViewModel |
Implementing it on the Page, which splits state from the BindingContext |
| Passing a whole object | ShellNavigationQueryParameters |
Serialising the object into the query string |
Any GoToAsync call |
await it |
Fire-and-forget β exceptions are swallowed and navigation races |
| Confirming before back navigation | ShellNavigatingEventArgs.GetDeferral() β¦ deferral.Complete() |
Blocking synchronously on the dialog task |
| Detecting back navigation | Check e.Source == ShellNavigationSource.Pop |
Assuming every navigation is a back action |
Do not propose NavigationPage / PushAsync solutions for a Shell app, and do
not restructure a working AppShell hierarchy unless the user asked.
Answer narrowly, but completely. Staying on topic does not mean being terse. When
you show a navigation change, include the pieces needed to run it: the AppShell.xaml
markup and the Routing.RegisterRoute call, or the GoToAsync call and the
receiving IQueryAttributable / [QueryProperty] code. Where two approaches are both
valid (query string vs ShellNavigationQueryParameters), show both and say when each
fits β a single snippet the user still has to complete is a worse answer.
Shell Visual Hierarchy
Shell uses a four-level hierarchy. Each level wraps the one below it:
Shell
βββ FlyoutItem / TabBar (top-level grouping)
β βββ Tab (bottom-tab grouping)
β β βββ ShellContent (page slot β ContentPage)
β β βββ ShellContent (multiple = top tabs)
β βββ Tab
βββ FlyoutItem / TabBar
- FlyoutItem β appears in the flyout menu; contains
Tabchildren - TabBar β bottom tab bar with no flyout entry
- Tab β groups
ShellContent; multiple children produce top tabs - ShellContent β each points to a
ContentPage
Implicit Conversion
You can omit intermediate wrappers. Shell auto-wraps:
| You write | Shell creates |
|---|---|
ShellContent only |
FlyoutItem > Tab > ShellContent |
Tab only |
FlyoutItem > Tab |
ShellContent in TabBar |
TabBar > Tab > ShellContent |
Workflow: Set Up AppShell
- Define
AppShell.xamlinheriting fromShell - Add
FlyoutItemorTabBarelements for top-level navigation - Add
Tabelements for bottom tabs; nest multipleShellContentfor top tabs - **Always use `Content
FAQ
What is Shell?
Shell is the built-in navigation structure in .NET MAUI, with tabs, flyouts and routes.
Can I pass data to a page?
Yes. Data can be passed with query parameters or object parameters.
Does it cover deep links?
No. Deep links from outside links are covered by separate documentation.
Details
Original description by the author
Guide for implementing Shell-based navigation in .NET MAUI apps. Covers AppShell setup, visual hierarchy (FlyoutItem, TabBar, Tab, ShellContent), URI-based navigation with GoToAsync, route registration, query parameters, back navigation, flyout and tab configuration, navigation events, and navigation guards. Use when: setting up Shell navigation, adding tabs or flyout menus, navigating between pages with GoToAsync, passing parameters between pages, registering routes, customizing back button behavior, or guarding navigation with confirmation dialogs. Do not use for: deep linking from external
repo: dotnet/skills
Popularity
- GitHub stars
- 5.8k
- Ranking position
- #14588
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
create-custom-agent
5.8kHelps your agent create VS Code custom agent files with their own tools, instructions and handoffs to other agents.
create-skill
5.8kHelps your agent create a new agent skill with a valid name, a clear trigger description and a SKILL.md file that follows the standard.
csharp-scripts
5.8kHelps your agent run a small C# program as a single file with the .NET command line tool, without creating a full project.
dotnet-pinvoke
5.8kHelps your agent call native C or C++ libraries from .NET correctly, covering signatures, string handling, memory and safe handles.
Similar skills
android-clean-architecture
280kMakes your agent organize Android projects efficiently. It structures the code to make maintenance and new feature development easier.
compose-multiplatform-patterns
280kHelps your agent use Compose Multiplatform and Jetpack Compose patterns in KMP projects, covering state, navigation, theming, and performance.
dart-flutter-patterns
280kMakes your agent write code for Dart and Flutter apps. It uses modern patterns to create robust and manageable apps.