# Desktop navigation

On a desktop window, keep the destinations visible and replace the main content when the user selects one. `NavigationShell` implements this simple, predictable pattern.

## Turn on the sidebar

Use the same destinations from [Connect pages with NavigationShell](../navigation-shell/index.md) and construct the shell with `desktop: true`. Home remains available in the sidebar, alongside each destination.

The selected menu button uses the filled variant; other entries use the text variant. The sidebar can scroll when its list is taller than the window. Opening a page for the first time invokes its factory, while later selections reuse the retained page.

This is enough for a small utility with a handful of destinations. It also makes desktop state retention easy to see: increment Notebook, visit About, then return to Notebook. The count survives because the shell keeps that instance.

## Plan for narrow windows

The current stock shell calculates its sidebar width as the smaller of 208 logical units and 40 percent of the available width. It does not collapse into an icon rail, animate an overlay menu, or switch into mobile navigation at a breakpoint.

DemoApp's desktop gallery has a separate, richer compact/expanded menu. That gallery behavior is not a `NavigationShell` feature. Do not copy a desktop demo assumption into an app and expect the starter shell to provide it.

For a more adaptive product, first let the page content wrap and scroll. If navigation still takes too much room, define an app-level width threshold and build a host that switches presentation while retaining its model. [Adapt to available space](../../layout/adaptive/index.md) shows a measured-width decision without device sniffing.

## Keep navigation and actions distinct

A destination changes the current page; an action operates on that page. Put Save, Delete, and Refresh in the content or its toolbar rather than turning them into destinations that create another screen.

Give every destination a stable ID and use the title only as presentation text. Keep the page factory small and synchronous. Start slow work after activation with visible progress rather than blocking a menu click while constructing the page.

If a page owns subscriptions or a secondary window, close that work when it deactivates even though its view instance remains cached. See [Page state and lifetime](../page-lifetime/index.md).
