DocsDocs

App frame

Frame an application's screens and their navigation by the width of the window.

BetaSince 1.0.0
On this page

Overview

Show code, AppFrame.tsx

Variants

Details beside the page

Side content that is not navigation goes in a supporting pane of Panes, in the body.

Show code, WithDetails.tsx

An installed app's window

An installed app that draws its own title bar runs it across the whole window, above the navigation.

  • A Menubar goes at its start, where the app has one.
  • Only the body scrolls below it, so the window's controls never cover a scrollbar.
40 rem wide
Show code, InstalledWindow.tsx

Anatomy

  1. Top bar

  2. Search

  3. Account menu

  4. Navigation

  5. Page header

  6. Page

Show code, AppFrameAnatomy.tsx

The app frame is one Scaffold at the application's root, around the router's outlet.

Behaviour

Adapting to width

The navigation takes the form the frame's width calls for: a bar on a phone, a rail on a tablet and a drawer on wider windows.

  • With many destinations, or none with icons, a phone shows no bar.
  • A menu button in the top bar then opens the same NavigationDrawer in a Sheet.
Show code, MenuOnPhones.tsx

Rules

Every destination has one place, the navigation, so people never look for it in two.

Use it when

  • A handful of destinations, each with a page
  • An installed app that draws its own title bar
DoEvery destination in the navigation, and the page's own action in its header.
Show code, DestinationsInNavigation.tsx
Donโ€™tMore destinations in the top bar: people look for them in two places.
Show code, DestinationsInTopBar.tsx

Content

Name each destination with one or two nouns, the words of its page's title.

  • In an installed app, title the bar as the window's title would read, the document's or the application's name.
  • Order the menubar's menus as the platform does: File, Edit, View.

Accessibility

Focus and keyboard

After a destination opens its page, move focus to the body or the page's heading.