Page layout

Page layout defines the header, main, pane, and footer areas of a page.

  • @primer/react@37.0.1
  • Alpha
  • Reviewed for accessibility

Import

import {PageLayout} from '@primer/react'

Examples

View in Storybook

Props

PageLayout

NameDefaultDescription
containerWidth
'xlarge'| 'full' | 'medium' | 'large' | 'xlarge'

The maximum width of the page container.

padding
'normal'| 'none' | 'condensed' | 'normal'

The spacing between the outer edges of the page container and the viewport

columnGap
'normal'| 'none' | 'condensed' | 'normal'
rowGap
'normal'| 'none' | 'condensed' | 'normal'
sx
SystemStyleObject

PageLayout.Header

NameDefaultDescription
aria-label
string | undefined

A unique label for the rendered banner landmark

aria-labelledby
string | undefined

An id to an element which uniquely labels the rendered banner landmark

padding
'none'| 'none' | 'condensed' | 'normal'

The amount of padding inside the header.

divider
'none'| 'none' | 'line' | { narrow?: | 'none' | 'line' | 'filled' regular?: | 'none' | 'line' wide?: | 'none' | 'line' }
dividerWhenNarrowDeprecated
'inherit'| 'inherit' | 'none' | 'line' | 'filled'

Use the divider prop with a responsive value instead.

hidden
false| boolean | { narrow?: boolean regular?: boolean wide?: boolean }

Whether the header is hidden.

sx
SystemStyleObject

PageLayout.Content

NameDefaultDescription
width
'full'| 'full' | 'medium' | 'large' | 'xlarge'

The maximum width of the content region.

padding
'none'| 'none' | 'condensed' | 'normal'

The amount of padding inside the content.

hidden
false| boolean | { narrow?: boolean regular?: boolean wide?: boolean }

Whether the content is hidden.

sx
SystemStyleObject

PageLayout.Pane

NameDefaultDescription
aria-label
string | undefined

Label for the pane. Required if the pane overflows and doesn't have aria-labelledby.

aria-labelledby
string | undefined

Id of an element that acts as a label for the pane. Required if the pane overflows and doesn't have aria-label.

width
'medium'| 'small' | 'medium' | 'large' | { min: string max: string default: string }

The width of the pane. If using custom widths, provide an object with keys 'min', 'max' and 'default'.

minWidth
256number

The minimum width of the pane.

resizable
falseboolean

When true, the pane may be resized by the user.

widthStorageKey
'paneWidth'string

Provide a key used by localStorage to persist the size of the pane on the client.

sticky
falseboolean

Whether the pane should stick to the top of the screen while the content scrolls.

offsetHeader
0number | string

Use offsetHeader along with the sticky prop to push the sticky pane down to make room for a sticky header if necessary. Use the type string to specify the height with a unit i.e. 5rem; otherwise the type number will be taken as px.

padding
'none'| 'none' | 'condensed' | 'normal'

The amount of padding inside the pane.

divider
'none'| 'none' | 'line' | { narrow?: | 'none' | 'line' | 'filled' regular?: | 'none' | 'line' wide?: | 'none' | 'line' }
dividerWhenNarrowDeprecated
'inherit'| 'inherit' | 'none' | 'line' | 'filled'

Use the divider prop with a responsive value instead.

hidden
false| boolean | { narrow?: boolean regular?: boolean wide?: boolean }

Whether the pane is hidden.

sx
SystemStyleObject
ref
React.RefObject<HTMLDivElement>

PageLayout.Footer

NameDefaultDescription
aria-label
string | undefined

A unique label for the rendered contentinfo landmark

aria-labelledby
string | undefined

An id to an element which uniquely labels the rendered contentinfo landmark

padding
'none'| 'none' | 'condensed' | 'normal'

The amount of padding inside the footer.

divider
'none'| 'none' | 'line' | { narrow?: | 'none' | 'line' | 'filled' regular?: | 'none' | 'line' wide?: | 'none' | 'line' }
dividerWhenNarrowDeprecated
'inherit'| 'inherit' | 'none' | 'line' | 'filled'

Use the divider prop with a responsive value instead.

hidden
false| boolean | { narrow?: boolean regular?: boolean wide?: boolean }

Whether the footer is hidden.

sx
SystemStyleObject