PageHeader

PageHeader determines the top-level headings of a UI.

Page navigation navigation

React
readyReviewed for a11y

The PageHeader arranges elements that apply context and provide navigation for the current page.

The elements within PageHeader are rearranged and displayed accordingly depending on the viewport size and context of the page.

React examples

Title only

With a description

With actions

With UnderlineNav in the navigation slot

With leading and trailing visuals

Leading visual guidelines

Trailing visual guidelines

With leading and trailing actions

Leading action guidelines

Trailing action guidelines

More examples

The previous examples are a small subset of the full capabilities of the PageHeader component. For more in-depth examples that demonstrate responsive behavior and show realistc use-cases for GitHub, see the PageHeader Storybook stories.

Props

NameRequiredDescription
aria-label
string | undefined
A unique label for the rendered landmark
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden. The component can be hidden for all viewport widths, or specified viewport widths. Some children have a default value for this prop: - `PageHeader.ContextArea`, `PageHeader.ContextAreaActions`, `PageHeader.ContextBar`, and `PageHeader.ParentLink` are hidden on regular and wide viewports by default. - - `PageHeader.LeadingAction`, and `PageHeader.TrailingAction` are hidden on narrow viewports by default.
role
AriaRole
The ARIA role to assign to the top-level node of this component.
sx
SystemStyleObject
as
React.ElementType

PageHeader.ContextArea

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject
NameRequiredDescription
aria-label
string | undefined
A unique label for the rendered landmark
className
string | undefined
CSS string
href
string
The URL to link to.
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the parent link is hidden.
sx
SystemStyleObject

PageHeader.ContextBar

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject

PageHeader.ContextAreaActions

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject

PageHeader.TitleArea

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
variant
| 'subtitle' | 'medium' | 'large' | { narrow?: | 'subtitle' | 'medium' | 'large' regular?: | 'subtitle' | 'medium' | 'large' wide?: | 'subtitle' | 'medium' | 'large' }
Default title (medium) is the most common page title size. Use for static titles in most situations. Large variant should be used for user-generated content such as issues, pull requests, or discussions. Subtitle variant can be used when a PageHeader.Title is already present in the page, such as in a SplitPageLayout.
sx
SystemStyleObject

PageHeader.LeadingAction

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject

PageHeader.LeadingVisual

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject

PageHeader.Title

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject
as
React.ElementType

PageHeader.TrailingVisual

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject

PageHeader.TrailingAction

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject

PageHeader.Actions

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject

PageHeader.Breadcrumbs

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject

PageHeader.Description

NameRequiredDescription
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject

PageHeader.Navigation

NameRequiredDescription
aria-label
string
The aria-label attribute for the navigaton component when it is rendered as a "nav" element.
aria-labelledby
string
The aria-labelledby attribute for the navigaton component when it is rendered as a "nav" element.
as
div | nav
The HTML element used to render the navigation.
className
string | undefined
CSS string
hidden
| boolean | { narrow?: boolean regular?: boolean wide?: boolean }
Whether the content is hidden.
sx
SystemStyleObject