Page
Page is the screen someone navigated to, with a large title and an optional description at the top.
Use a Page for each screen someone moves to, such as a settings page or a report. It shows a large title and an optional description at the top, with your content underneath. Set the words with title and description.
The toolbar above a Page is a separate thing. The row with the navigation button, the back button and the tools stays in place while someone moves from one page to the next, so build it with a ShellPaneHeader and a Toolbar. The Page is the part that changes with each screen.
Inside a Shell, the Page leaves room for the toolbar row above it, whether that row floats over the content or sits in the layout. When the large title scrolls up behind the row, a ToolbarTitle in the row shows the same words. That is why title must be a string: the same words appear in two places.
A Page has no size and no width. Every page in an app uses the same title size, so the pages look like one product, and you set the reading width on the box that holds the Page. Outside a Shell, the title shows in place and doesn't collapse into a toolbar.
The title is the page's only h1, and screen readers use it as the name of the screen. Use a Heading at size 6 or 7 for sections inside the Page. Put actions in the toolbar row, not under the title, and use mark to show your app's logo above the title on a front page.
Props
Generated from the types. It lists what this component DECLARES: a prop that arrives from a shared type or from the platform is real and is not repeated here.
| Prop | Type | What it does |
|---|---|---|
description? | React.ReactNode | A sentence under the title that describes the page. |
mark? | React.ReactNode | A logo or mark above the title, such as an app's logo on its home page. |
title | string | The title of the page. |
It also takes every prop of a <div>.
- A heading level โ The page title is always the document's one
h1, because it names the screen. For headings at other levels, use aHeadinginside the Page. sizeโ An app has one page title size. If pages used different sizes, parts of one app would look like different products.- Actions beside the title โ Put actions in the toolbar with the other controls. A row of buttons under the title would be a second toolbar, without the toolbar's keyboard support.
- A width โ Different pages need different widths, such as a reading column or a wide table, so the Page doesn't limit its line length. Set a maximum width on the box that holds it.
- Collapsing into a toolbar outside a Shell โ The title can only collapse into a toolbar row that stays in place over a scrolling region. Outside a
Shellthere is no such row, so the title shows in place.