PageHeader is used to indicate the title of the current page, as well as optional actions.

Props

Component props
Name
Type
Default
title
Required
string
-

Page title. Will always be a level 1 heading. Content should be localized.

maxWidth
Dimension
"100%"

Use numbers for pixels: `maxWidth={100}` and strings for percentages: `maxWidth="100%"`. See the max width variant for more info.

primaryAction
React.Element<typeof Button | typeof IconButton | typeof Link | typeof Tooltip>
-

The primary action of the page. Can be Button, Link, Tooltip surrounding IconButton or a combination of IconButton, Tooltip and Dropdown.

secondaryAction
React.Element<typeof Button | typeof IconButton | typeof Link | typeof Tooltip>
-

A secondary action for the page. Can be Button, Link, Tooltip surrounding IconButton or a combination of IconButton, Tooltip and Dropdown.

subtext
string
-

Used for metadata related to the current page, not designed to describe the title or the current surface. Content should be localized.

Best practices

Do

Use only one primary style action in PageHeader .

Do

Ensure the title of PageHeader matches the title of the item that navigated the user to this page. For instance, if the user selects "Settings" from an overflow menu, the title of PageHeader should also say "Settings".

Do

Plan for most PageHeaders to be full width. A maxWidth should only be supplied when the content of the page is center aligned. Content should match PageHeader's 32px start/end padding.

Don't

Supply more than one primary style action.

Don't

Use subtext to add a description about the page. It should only be used for metadata.

Don't

Use maxWidth when the content of the page is not center aligned.

Accessibility

Be sure to follow any accessibility guidelines for the components used within PageHeader. The heading within PageHeader will be rendered as a level 1 heading, so ensure there are no other level 1 headings present on the page. For headings level 2-6, use Heading. Learn more about creating accessible headings.

Localization

Be sure to localize the title, subtext and actions within PageHeader.

Variants

Primary action

PageHeader supports an optional primaryAction. It can be a Button, a Link or an IconButton with a Tooltip and optional Dropdown. Any Buttons or IconButtons should be size="lg".

Secondary action

PageHeader also supports an optional secondaryAction. It will likely be a Button or an IconButton with a Tooltip and optional Dropdown. Any Buttons or IconButtons should be size="lg".

Subtext

subtext should be used to add metadata about the content on the page, not to describe the page itself.

Max width

maxWidth should be set when the content of the page is centered and/or has a maximum width itself.

Heading
Heading should be used to create level 2-6 headings on a page. If a level 1 heading is needed, use PageHeader.