PageHeader
PageHeader is used to indicate the title of the current page, as well as optional actions.
Props
Best practices
Use only one primary style action in PageHeader .
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".
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.
Supply more than one primary style action.
Use subtext to add a description about the page. It should only be used for metadata.
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.
Related
Heading
Heading should be used to create level 2-6 headings on a page. If a level 1 heading is needed, use PageHeader.