import {SplitPageLayout} from '@primer/react'
If you need a more flexible layout component, consider using the PageLayout component.
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><SplitPageLayout><SplitPageLayout.Header><Placeholder label="Header" height={64} /></SplitPageLayout.Header><SplitPageLayout.Pane><Placeholder label="Pane" height={120} /></SplitPageLayout.Pane><SplitPageLayout.Content><Placeholder label="Content" height={420} /></SplitPageLayout.Content><SplitPageLayout.Footer><Placeholder label="Footer" height={64} /></SplitPageLayout.Footer></SplitPageLayout></Box>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><SplitPageLayout><SplitPageLayout.Header><Placeholder label="Header" height={64} /></SplitPageLayout.Header><SplitPageLayout.Pane><Box sx={{display: 'grid', gap: 3}}>{Array.from({length: 5}).map((_, i) => (<Box key={i} as="p" sx={{margin: 0}}>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at enim id lorem tempus egestas a non ipsum.Maecenas imperdiet ante quam, at varius lorem molestie vel. Sed at eros consequat, varius tellus et, auctorfelis. Donec pulvinar lacinia urna nec commodo. Phasellus at imperdiet risus. Donec sit amet massa purus.</Box>))}</Box></SplitPageLayout.Pane><SplitPageLayout.Content><Placeholder label="Content" height={420} /></SplitPageLayout.Content><SplitPageLayout.Footer><Placeholder label="Footer" height={64} /></SplitPageLayout.Footer></SplitPageLayout></Box>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><SplitPageLayout><SplitPageLayout.Header><Placeholder label="Header" height={64} /></SplitPageLayout.Header><SplitPageLayout.Pane hidden={{narrow: true}}><Placeholder label="Pane" height={120} /></SplitPageLayout.Pane><SplitPageLayout.Content><Placeholder label="Content" height={420} /></SplitPageLayout.Content><SplitPageLayout.Footer><Placeholder label="Footer" height={64} /></SplitPageLayout.Footer></SplitPageLayout></Box>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><SplitPageLayout><SplitPageLayout.Header><Placeholder label="Header" height={64} /></SplitPageLayout.Header><SplitPageLayout.Pane divider={{regular: 'line', narrow: 'none'}}><Placeholder label="Pane" height={120} /></SplitPageLayout.Pane><SplitPageLayout.Content hidden={{narrow: true}}><Placeholder label="Content" height={420} /></SplitPageLayout.Content><SplitPageLayout.Footer><Placeholder label="Footer" height={64} /></SplitPageLayout.Footer></SplitPageLayout></Box>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><SplitPageLayout><SplitPageLayout.Header><Placeholder label="Header" height={64} /></SplitPageLayout.Header><SplitPageLayout.Pane resizable><Placeholder label="Pane" height={120} /></SplitPageLayout.Pane><SplitPageLayout.Content><Placeholder label="Content" height={420} /></SplitPageLayout.Content><SplitPageLayout.Footer><Placeholder label="Footer" height={64} /></SplitPageLayout.Footer></SplitPageLayout></Box>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><SplitPageLayout><SplitPageLayout.Header divider="none"><Placeholder label="Header" height={64} /></SplitPageLayout.Header><SplitPageLayout.Pane divider="none"><Placeholder label="Pane" height={120} /></SplitPageLayout.Pane><SplitPageLayout.Content><Placeholder label="Content" height={420} /></SplitPageLayout.Content><SplitPageLayout.Footer divider="none"><Placeholder label="Footer" height={64} /></SplitPageLayout.Footer></SplitPageLayout></Box>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><SplitPageLayout><SplitPageLayout.Header><Placeholder label="Header" height={64} /></SplitPageLayout.Header><SplitPageLayout.Content><Placeholder label="Content" height={420} /></SplitPageLayout.Content><SplitPageLayout.Pane position="end"><Placeholder label="Pane" height={120} /></SplitPageLayout.Pane><SplitPageLayout.Footer><Placeholder label="Footer" height={64} /></SplitPageLayout.Footer></SplitPageLayout></Box>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><SplitPageLayout><SplitPageLayout.Header padding="condensed"><Placeholder label="Header" height={64} /></SplitPageLayout.Header><SplitPageLayout.Pane padding="condensed"><Placeholder label="Pane" height={120} /></SplitPageLayout.Pane><SplitPageLayout.Content padding="condensed"><Placeholder label="Content" height={420} /></SplitPageLayout.Content><SplitPageLayout.Footer padding="condensed"><Placeholder label="Footer" height={64} /></SplitPageLayout.Footer></SplitPageLayout></Box>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><SplitPageLayout><SplitPageLayout.Header padding="none"><Placeholder label="Header" height={64} /></SplitPageLayout.Header><SplitPageLayout.Pane padding="none"><Placeholder label="Pane" height={120} /></SplitPageLayout.Pane><SplitPageLayout.Content padding="none"><Placeholder label="Content" height={420} /></SplitPageLayout.Content><SplitPageLayout.Footer padding="none"><Placeholder label="Footer" height={64} /></SplitPageLayout.Footer></SplitPageLayout></Box>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><SplitPageLayout><SplitPageLayout.Pane><Placeholder label="Pane" height={120} /></SplitPageLayout.Pane><SplitPageLayout.Content><Placeholder label="Content" height={480} /></SplitPageLayout.Content></SplitPageLayout></Box>
<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}><SplitPageLayout><SplitPageLayout.Header><Placeholder label="Header" height={64} /></SplitPageLayout.Header><SplitPageLayout.Pane sticky={false}><Placeholder label="Pane" height={120} /></SplitPageLayout.Pane><SplitPageLayout.Content><Placeholder label="Content" height={420} /></SplitPageLayout.Content><SplitPageLayout.Footer><Placeholder label="Footer" height={64} /></SplitPageLayout.Footer></SplitPageLayout></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',zIndex: 1,}}>Custom sticky header</Box><SplitPageLayout><SplitPageLayout.Content><Placeholder label="Content" height={420} /></SplitPageLayout.Content><SplitPageLayout.Pane sticky offsetHeader={64}><Placeholder label="Pane" height={120} /></SplitPageLayout.Pane><SplitPageLayout.Footer><Placeholder label="Footer" height={64} /></SplitPageLayout.Footer></SplitPageLayout></Box>
Name | Type | Default | Description |
---|---|---|---|
sx | SystemStyleObject | Style overrides to apply to the component. See also overriding styles. |
Name | Type | Default | Description |
---|---|---|---|
padding | | 'none' | 'condensed' | 'normal' | 'normal' | The amount of padding inside the header. |
divider | | 'none' | 'line' | { narrow?: | 'none' | 'line' | 'filled' regular?: | 'none' | 'line' wide?: | 'none' | 'line' } | 'line' | |
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' | 'large' | The maximum width of the content region. |
padding | | 'none' | 'condensed' | 'normal' | 'normal' | 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' } | 'start' | |
width | | 'small' | 'medium' | 'large' | 'medium' | The width of the pane. |
resizable | boolean | false | When true, the pane may be resized by the user. |
widthStorageKey | string | 'paneWidth' | Provide a key used by localStorage to persist the size of the pane on the client. |
sticky | boolean | true | Whether the pane should stick to the top of the screen while the content scrolls. |
offsetHeader | number | string | 0 | 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' | 'condensed' | 'normal' | 'normal' | The amount of padding inside the pane. |
divider | | 'none' | 'line' | { narrow?: | 'none' | 'line' | 'filled' regular?: | 'none' | 'line' wide?: | 'none' | 'line' } | 'line' | |
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' | 'normal' | The amount of padding inside the footer. |
divider | | 'none' | 'line' | { narrow?: | 'none' | 'line' | 'filled' regular?: | 'none' | 'line' wide?: | 'none' | 'line' } | 'line' | |
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. |