PageHeader
PageHeader determines the top-level headings of a UI.
Page navigation navigation
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
With actions
Title
With UnderlineNav in the navigation slot
Pull request title
With leading and trailing visuals
Title
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 | Default | Description |
|---|---|---|
aria-label | string | undefinedA unique label for the rendered landmark | |
className | string | undefinedCSS string | |
hidden | false | | 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:
|
role | AriaRoleThe ARIA role to assign to the top-level node of this component. | |
sx Deprecated | SystemStyleObject | |
as | "div" | React.ElementType |
hasBorder | booleanWhether to render a border below the PageHeader. This border will NOT be rendered if the PageHeader has a |
PageHeader.ContextArea
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject |
PageHeader.ParentLink
| Name | Default | Description |
|---|---|---|
aria-label | string | undefinedA unique label for the rendered landmark | |
className | string | undefinedCSS string | |
href | stringThe URL to link to. | |
hidden | `{ narrow: false regular: true wide: true }` | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the parent link is hidden. |
sx Deprecated | SystemStyleObject |
PageHeader.ContextBar
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject |
PageHeader.ContextAreaActions
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject |
PageHeader.TitleArea
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
variant | medium | | '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 Deprecated | SystemStyleObject |
PageHeader.LeadingAction
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject |
PageHeader.LeadingVisual
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject |
PageHeader.Title
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject | |
as | "h2" | React.ElementType |
PageHeader.TrailingVisual
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject |
PageHeader.TrailingAction
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject |
PageHeader.Actions
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject |
PageHeader.Breadcrumbs
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject |
PageHeader.Description
| Name | Default | Description |
|---|---|---|
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject |
PageHeader.Navigation
| Name | Default | Description |
|---|---|---|
aria-label | stringThe aria-label attribute for the navigaton component when it is rendered as a "nav" element. | |
aria-labelledby | stringThe aria-labelledby attribute for the navigaton component when it is rendered as a "nav" element. | |
as | "div" | div | navThe HTML element used to render the navigation. |
className | string | undefinedCSS string | |
hidden | false | | boolean | { narrow?: boolean regular?: boolean wide?: boolean }Whether the content is hidden. |
sx Deprecated | SystemStyleObject |