PageHeader
a layout component to display page title, subtitle, parent, and page-level actions
Using Grommet for HPE?See PageHeader examples and guidance.
Custom label to be used by screen readers. When provided, an aria-label will be added to the element.
string
"a user friendly label for screen readers"
Any page-level actions.
element
<Box direction="row"> <Button label="Delete" /> <Button label="Edit" primary /> </Box>
How to align along the cross axis when contained in a Box or along the column axis when contained in a Grid.
string
"start"
"center"
"end"
"stretch"
"baseline"
The heading level. It corresponds to the number after the 'H' for the DOM tag. Set the level for semantic accuracy and accessibility. The sizing can be further adjusted using the size property.
string
"1"
"2"
"3"
"4"
"5"
"6"
number
1
2
3
4
5
6
The amount of margin around the component.
string
"none"
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
object
Can be specified to distinguish horizontal margin, vertical margin, and margin on a particular side.
{ vertical: "...", horizontal: "...", top: "...", bottom: "...", left: "...", right: "..." }
Contextual navigation or information about where the current page is located within an application.
element
<Anchor label="Parent Page" icon={<FormPrevious />} />
The possible sizes of PageHeader, which impacts the padding, title sizing, and subtitle sizing. 'size' will not impact parent or action sizing.
string
"small"
"medium"
"large"
Additional description about a page's purpose. When provided as a string, it will be rendered as a paragraph.
string
"This page provides documentation for PageHeader."
element
<Box>This is a custom subtitle for the page.</Box>
At its core, the PageHeader component is a regular <header> element. Thus, both DOM and React properties, methods, and events are accessible. To read up on all of the possible DOM attributes and types available for header elements, check out this MDN Web Documents page. To learn more about DOM events and methods, you can read more on the MDN Web Events documentation page.
Also, feel free to read about the types of React events available, or see how DOM attributes change in React. Working in tandem with Styled Components, you also have access to the as property.
Amount of pad when PageHeader size = 'small'.
object
{ top: 'medium', bottom: 'small' }
Any valid Paragraph props for the subtitle when PageHeader size = 'small'.
object
{ size: 'small', }
Any valid Heading props for the title when PageHeader size = 'small'.
object
{ size: 'small', }
Amount of pad when PageHeader size = 'medium'. If not specified, will default to pageHeader.pad.
object
{}
Any valid Paragraph props for the subtitle when PageHeader size = 'medium'. If not specified, will default to pageHeader.subtitle.
object
{}
Any valid Heading props for the title when PageHeader size = 'medium'. If not specified, will default to pageHeader.title.
object
{}
Amount of pad when PageHeader size = 'large'.
object
{ top: 'xlarge', bottom: 'large' }
Any valid Paragraph props for the subtitle when PageHeader size = 'large'.
object
{ size: 'large', }
Any valid Heading props for the title when PageHeader size = 'large'.
object
{ size: 'large', }
Any valid Grid props for the PageHeader layout at small breakpoint. The 'areas' can be customized to change where the contents render.
object
small: { areas: [ ['parent', 'parent'], ['title', 'actions'], ['subtitle', 'actions'], ], columns: [['small', 'flex'], 'auto'], rows: ['auto', 'auto', 'auto'], gap: { row: 'xsmall', column: 'large' }, },
Any valid Grid props for the PageHeader layout at medium breakpoint. The 'areas' can be customized to change where the contents render.
object
medium: { areas: [ ['parent', 'parent'], ['title', 'actions'], ['subtitle', 'actions'], ], columns: [['medium', 'flex'], 'auto'], rows: ['auto', 'auto', 'auto'], gap: { row: 'xsmall', column: 'medium' }, },
Any valid Grid props for the PageHeader layout at large breakpoint. The 'areas' can be customized to change where the contents render.
object
large: { areas: [ ['parent', 'parent'], ['title', 'actions'], ['subtitle', 'actions'], ], columns: [['medium', 'flex'], 'auto'], rows: ['auto', 'auto', 'auto'], gap: { row: 'xsmall', column: 'large' }, },