import {PageLayout} from '@primer/react'
See storybook for fullscreen examples.
<PageLayout><PageLayout.Header><Placeholder label="Header" height={64} /></PageLayout.Header><PageLayout.Content><Placeholder label="Content" height={240} /></PageLayout.Content><PageLayout.Pane><Placeholder label="Pane" height={120} /></PageLayout.Pane><PageLayout.Footer><Placeholder label="Footer" height={64} /></PageLayout.Footer></PageLayout>
<PageLayout><PageLayout.Header divider="line"><Placeholder label="Header" height={64} /></PageLayout.Header><PageLayout.Content><Placeholder label="Content" height={240} /></PageLayout.Content>{/* You can change the divider based on the viewport width */}<PageLayout.Pane divider={{narrow: 'line'}}><Placeholder label="Pane" height={120} /></PageLayout.Pane><PageLayout.Footer divider="line"><Placeholder label="Footer" height={64} /></PageLayout.Footer></PageLayout>
<PageLayout padding="none" rowGap="none" columnGap="none"><PageLayout.Header padding="normal" divider="line"><Placeholder label="Header" height={64} /></PageLayout.Header><PageLayout.Content padding="normal"><Placeholder label="Content" height={240} /></PageLayout.Content><PageLayout.Pane padding="normal" divider="line"><Placeholder label="Pane" height={120} /></PageLayout.Pane><PageLayout.Footer padding="normal" divider="line"><Placeholder label="Footer" height={64} /></PageLayout.Footer></PageLayout>
<PageLayout><PageLayout.Header><Placeholder label="Header" height={64} /></PageLayout.Header><PageLayout.Content><Placeholder label="Content" height={240} /></PageLayout.Content><PageLayout.Pane position="start"><Placeholder label="Pane" height={120} /></PageLayout.Pane><PageLayout.Footer><Placeholder label="Footer" height={64} /></PageLayout.Footer></PageLayout>
<PageLayout><PageLayout.Header><Placeholder label="Header" height={64} /></PageLayout.Header><PageLayout.Content><Placeholder label="Content" height={240} /></PageLayout.Content><PageLayout.Pane position="start" hidden={{narrow: true}}><Placeholder label="Pane" height={120} /></PageLayout.Pane><PageLayout.Footer><Placeholder label="Footer" height={64} /></PageLayout.Footer></PageLayout>
<PageLayout padding="condensed" rowGap="condensed" columnGap="condensed"><PageLayout.Header><Placeholder label="Header" height={64} /></PageLayout.Header><PageLayout.Content><Placeholder label="Content" height={240} /></PageLayout.Content><PageLayout.Pane><Placeholder label="Pane" height={120} /></PageLayout.Pane><PageLayout.Footer><Placeholder label="Footer" height={64} /></PageLayout.Footer></PageLayout>
<PageLayout><PageLayout.Content><Placeholder label="Content" height={240} /></PageLayout.Content><PageLayout.Pane><Placeholder label="Pane" height={120} /></PageLayout.Pane></PageLayout>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><PageLayout><PageLayout.Header><Placeholder label="Header" height={64} /></PageLayout.Header><PageLayout.Content><Placeholder label="Content" height={320} /></PageLayout.Content><PageLayout.Pane sticky><Placeholder label="Pane" height={120} /></PageLayout.Pane><PageLayout.Footer><Placeholder label="Footer" height={64} /></PageLayout.Footer></PageLayout></Box>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><Boxsx={{position: 'sticky',top: 0,height: 64,display: 'grid',placeItems: 'center',backgroundColor: 'canvas.subtle',borderBottom: '1px solid',borderColor: 'border.default'}}>Custom sticky header</Box><PageLayout><PageLayout.Content><Placeholder label="Content" height={320} /></PageLayout.Content><PageLayout.Pane position="start" stickyTop={64} sticky><Placeholder label="Pane" height={120} /></PageLayout.Pane><PageLayout.Footer><Placeholder label="Footer" height={64} /></PageLayout.Footer></PageLayout></Box>
| Name | Type | Default | Description |
|---|---|---|---|
| containerWidth | | 'full' | 'medium' | 'large' | 'xlarge' | 'xlarge' | The maximum width of the page container. |
| padding | | 'none' | 'condensed' | 'normal' | 'normal' | The spacing between the outer edges of the page container and the viewport |
| columnGap | | 'none' | 'condensed' | 'normal' | 'normal' | |
| rowGap | | 'none' | 'condensed' | 'normal' | 'normal' | |
| sx | SystemStyleObject | Style overrides to apply to the component. See also overriding styles. |
| Name | Type | Default | Description |
|---|---|---|---|
| padding | | 'none' | 'condensed' | 'normal' | 'none' | The amount of padding inside the header. |
| divider | | 'none'
| 'line'
| {
narrow?:
| 'none'
| 'line'
| 'filled'
regular?:
| 'none'
| 'line'
wide?:
| 'none'
| 'line'
} | 'none' | |
| dividerWhenNarrow Deprecated | | 'inherit' | 'none' | 'line' | 'filled' | 'inherit' | Use the divider prop with a responsive value instead. |
| hidden | | boolean
| {
narrow?: boolean
regular?: boolean
wide?: boolean
} | false | Whether the header is hidden. |
| sx | SystemStyleObject | Style overrides to apply to the component. See also overriding styles. |
| Name | Type | Default | Description |
|---|---|---|---|
| width | | 'full' | 'medium' | 'large' | 'xlarge' | 'full' | The maximum width of the content region. |
| padding | | 'none' | 'condensed' | 'normal' | 'none' | The amount of padding inside the content. |
| hidden | | boolean
| {
narrow?: boolean
regular?: boolean
wide?: boolean
} | false | Whether the content is hidden. |
| sx | SystemStyleObject | Style overrides to apply to the component. See also overriding styles. |
| Name | Type | Default | Description |
|---|---|---|---|
| position | | 'start'
| 'end'
| {
narrow?:
| 'start'
| 'end'
regular?:
| 'start'
| 'end'
wide?:
| 'start'
| 'end'
} | 'end' | |
| positionWhenNarrow Deprecated | | 'inherit' | 'start' | 'end' | 'inherit' | Use the position prop with a responsive value instead. |
| width | | 'small' | 'medium' | 'large' | 'medium' | The width of the pane. |
| sticky | boolean | false | Whether the pane should stick to the top of the screen while the content scrolls. |
| stickyTop | number | string | 0 | Use stickyTop 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' | 'condensed' | 'normal' | 'none' | The amount of padding inside the pane. |
| divider | | 'none'
| 'line'
| {
narrow?:
| 'none'
| 'line'
| 'filled'
regular?:
| 'none'
| 'line'
wide?:
| 'none'
| 'line'
} | 'none' | |
| dividerWhenNarrow Deprecated | | 'inherit' | 'none' | 'line' | 'filled' | 'inherit' | Use the divider prop with a responsive value instead. |
| hidden | | boolean
| {
narrow?: boolean
regular?: boolean
wide?: boolean
} | false | Whether the pane is hidden. |
| sx | SystemStyleObject | Style overrides to apply to the component. See also overriding styles. |
| Name | Type | Default | Description |
|---|---|---|---|
| padding | | 'none' | 'condensed' | 'normal' | 'none' | The amount of padding inside the footer. |
| divider | | 'none'
| 'line'
| {
narrow?:
| 'none'
| 'line'
| 'filled'
regular?:
| 'none'
| 'line'
wide?:
| 'none'
| 'line'
} | 'none' | |
| dividerWhenNarrow Deprecated | | 'inherit' | 'none' | 'line' | 'filled' | 'inherit' | Use the divider prop with a responsive value instead. |
| hidden | | boolean
| {
narrow?: boolean
regular?: boolean
wide?: boolean
} | false | Whether the footer is hidden. |
| sx | SystemStyleObject | Style overrides to apply to the component. See also overriding styles. |