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
Title
With a description
add-pageheader-docs
broccolinisoup created this branch 5 days ago · 14 commits · updated today
With actions
Title
With UnderlineNav in the navigation slot
Pull request title
With leading and trailing visuals
Title
Beta
With leading and trailing actions
Title
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
PageHeader
Name | Required | Description |
---|---|---|
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
Name | Required | Description |
---|---|---|
className | string | undefined CSS string | |
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } Whether the content is hidden. | |
sx | SystemStyleObject |
PageHeader.ParentLink
Name | Required | Description |
---|---|---|
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
Name | Required | Description |
---|---|---|
className | string | undefined CSS string | |
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } Whether the content is hidden. | |
sx | SystemStyleObject |
PageHeader.ContextAreaActions
Name | Required | Description |
---|---|---|
className | string | undefined CSS string | |
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } Whether the content is hidden. | |
sx | SystemStyleObject |
PageHeader.TitleArea
Name | Required | Description |
---|---|---|
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
Name | Required | Description |
---|---|---|
className | string | undefined CSS string | |
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } Whether the content is hidden. | |
sx | SystemStyleObject |
PageHeader.LeadingVisual
Name | Required | Description |
---|---|---|
className | string | undefined CSS string | |
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } Whether the content is hidden. | |
sx | SystemStyleObject |
PageHeader.Title
Name | Required | Description |
---|---|---|
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
Name | Required | Description |
---|---|---|
className | string | undefined CSS string | |
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } Whether the content is hidden. | |
sx | SystemStyleObject |
PageHeader.TrailingAction
Name | Required | Description |
---|---|---|
className | string | undefined CSS string | |
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } Whether the content is hidden. | |
sx | SystemStyleObject |
PageHeader.Actions
Name | Required | Description |
---|---|---|
className | string | undefined CSS string | |
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } Whether the content is hidden. | |
sx | SystemStyleObject |
PageHeader.Breadcrumbs
Name | Required | Description |
---|---|---|
className | string | undefined CSS string | |
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } Whether the content is hidden. | |
sx | SystemStyleObject |
PageHeader.Description
Name | Required | Description |
---|---|---|
className | string | undefined CSS string | |
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } Whether the content is hidden. | |
sx | SystemStyleObject |
PageHeader.Navigation
Name | Required | Description |
---|---|---|
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 |