import {PageHeader} from '@primer/react/drafts'
<PageHeader><PageHeader.TitleArea><PageHeader.Title>Title</PageHeader.Title></PageHeader.TitleArea></PageHeader>
variant="large"
<PageHeader><PageHeader.TitleArea variant="large"><PageHeader.Title>Title</PageHeader.Title></PageHeader.TitleArea></PageHeader>
<PageHeader><PageHeader.TitleArea><PageHeader.LeadingVisual><GitPullRequestIcon /></PageHeader.LeadingVisual><PageHeader.Title>Title</PageHeader.Title><PageHeader.TrailingVisual><Label>Beta</Label></PageHeader.TrailingVisual></PageHeader.TitleArea></PageHeader>
<PageHeader><PageHeader.TitleArea><PageHeader.LeadingVisual hidden={{regular: true}}><GitPullRequestIcon /></PageHeader.LeadingVisual><PageHeader.Title>Title</PageHeader.Title><PageHeader.TrailingVisual><Label>Beta</Label></PageHeader.TrailingVisual></PageHeader.TitleArea></PageHeader>
<PageHeader><PageHeader.TitleArea><Breadcrumbs><Breadcrumbs.Item href="#">...</Breadcrumbs.Item><Breadcrumbs.Item href="#">primer</Breadcrumbs.Item><Breadcrumbs.Item href="#">react</Breadcrumbs.Item><Breadcrumbs.Item href="#">src</Breadcrumbs.Item><Breadcrumbs.Item href="#">PageHeader</Breadcrumbs.Item><Breadcrumbs.Item href="#">PageHeader.tsx</Breadcrumbs.Item></Breadcrumbs><Headingas="h2"sx={{position: 'absolute',width: '1px',height: '1px',padding: 0,margin: '-1px',overflow: 'hidden',clip: 'rect(0, 0, 0, 0)',whiteSpace: 'nowrap',borderWidth: 0,}}>Visually Hidden Title</Heading></PageHeader.TitleArea></PageHeader>
<PageHeader><PageHeader.TitleArea><PageHeader.LeadingAction><IconButton aria-label="Expand" icon={SidebarExpandIcon} variant="invisible" /></PageHeader.LeadingAction><PageHeader.Title>Title</PageHeader.Title><PageHeader.TrailingAction><IconButton aria-label="Edit" icon={PencilIcon} variant="invisible" /></PageHeader.TrailingAction></PageHeader.TitleArea></PageHeader>
<PageHeader><PageHeader.TitleArea><PageHeader.Title>Title</PageHeader.Title><PageHeader.Actions><IconButton aria-label="Workflows" icon={WorkflowIcon} /><IconButton aria-label="Insights" icon={GraphIcon} /><Button variant="primary" trailingIcon={TriangleDownIcon}>Add Item</Button><IconButton aria-label="Settings" icon={GearIcon} /></PageHeader.Actions></PageHeader.TitleArea></PageHeader>
<PageHeader><PageHeader.TitleArea><PageHeader.Title>add-pageheader-docs</PageHeader.Title></PageHeader.TitleArea><PageHeader.Description><Text sx={{fontSize: 1, color: 'fg.muted'}}><Link href="#" muted sx={{fontWeight: 'bold'}}>broccolinisoup</Link>{' '}created this branch 5 days ago · 14 commits · updated today</Text></PageHeader.Description></PageHeader>
<PageHeader><PageHeader.TitleArea><PageHeader.Title>Pull request title</PageHeader.Title></PageHeader.TitleArea><PageHeader.Navigation><UnderlineNav2 aria-label="Pull Request"><UnderlineNav2.Item icon={CommentDiscussionIcon} counter="12" aria-current="page">Conversation</UnderlineNav2.Item><UnderlineNav2.Item counter={3} icon={CommitIcon}>Commits</UnderlineNav2.Item><UnderlineNav2.Item counter={7} icon={ChecklistIcon}>Checks</UnderlineNav2.Item><UnderlineNav2.Item counter={4} icon={FileDiffIcon}>Files Changes</UnderlineNav2.Item></UnderlineNav2></PageHeader.Navigation></PageHeader>
<PageHeader><PageHeader.TitleArea><PageHeader.Title>Page Title</PageHeader.Title></PageHeader.TitleArea><PageHeader.Navigation as="nav" aria-label="Item list"><Box as="ul" sx={{display: 'flex', gap: '8px', listStyle: 'none', paddingY: 0, paddingX: 3}} role="list"><li><Link href="#" aria-current="page">Item 1</Link></li><li><Link href="#">Item 2</Link></li></Box></PageHeader.Navigation></PageHeader>
<PageHeader><PageHeader.ContextArea><PageHeader.ParentLink href="http://github.com">Parent Link</PageHeader.ParentLink><PageHeader.ContextAreaActions><Button size="small" leadingIcon={GitBranchIcon}>Main</Button><IconButton size="small" aria-label="More Options" icon={KebabHorizontalIcon} /></PageHeader.ContextAreaActions></PageHeader.ContextArea><PageHeader.TitleArea><PageHeader.Title>Title</PageHeader.Title></PageHeader.TitleArea></PageHeader>
<PageHeader><PageHeader.ContextArea><PageHeader.ContextBar><Breadcrumbs><Breadcrumbs.Item href="#">...</Breadcrumbs.Item><Breadcrumbs.Item href="#">primer</Breadcrumbs.Item><Breadcrumbs.Item href="#">react</Breadcrumbs.Item><Breadcrumbs.Item href="#">src</Breadcrumbs.Item><Breadcrumbs.Item href="#">PageHeader</Breadcrumbs.Item><Breadcrumbs.Item href="#">PageHeader.tsx</Breadcrumbs.Item></Breadcrumbs></PageHeader.ContextBar><PageHeader.ContextAreaActions><Button size="small" leadingIcon={GitBranchIcon}>Main</Button><IconButton size="small" aria-label="More Options" icon={KebabHorizontalIcon} /></PageHeader.ContextAreaActions></PageHeader.ContextArea><PageHeader.TitleArea><PageHeader.Title>Title</PageHeader.Title></PageHeader.TitleArea></PageHeader>
<PageHeader><PageHeader.ContextArea hidden={false}><PageHeader.ParentLink href="http://github.com" hidden={false}>Parent Link</PageHeader.ParentLink><PageHeader.ContextBar hidden={false}><Breadcrumbs><Breadcrumbs.Item href="#">...</Breadcrumbs.Item><Breadcrumbs.Item href="#">primer</Breadcrumbs.Item><Breadcrumbs.Item href="#">react</Breadcrumbs.Item><Breadcrumbs.Item href="#">src</Breadcrumbs.Item><Breadcrumbs.Item href="#">PageHeader</Breadcrumbs.Item><Breadcrumbs.Item href="#">PageHeader.tsx</Breadcrumbs.Item></Breadcrumbs></PageHeader.ContextBar><PageHeader.ContextAreaActions hidden={false}><Button size="small" leadingIcon={GitBranchIcon}>Main</Button><IconButton size="small" aria-label="More Options" icon={KebabHorizontalIcon} /></PageHeader.ContextAreaActions></PageHeader.ContextArea><PageHeader.TitleArea><PageHeader.Title>Title</PageHeader.Title></PageHeader.TitleArea></PageHeader>
<PageHeader><PageHeader.TitleArea><PageHeader.Title as="h2">Webhooks</PageHeader.Title><PageHeader.Actions><Hidden on={['narrow']}><Button variant="primary">New webhook</Button></Hidden><Hidden on={['regular', 'wide']}><Button variant="primary">New</Button></Hidden></PageHeader.Actions></PageHeader.TitleArea></PageHeader>
Name | Type | Default | Description |
---|---|---|---|
aria-label | string | undefined | A unique label for the rendered main landmark | |
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. | |
as | React.ElementType | "div" | The underlying element to render — either a HTML element name or a React component. |
Name | Type | Default | Description |
---|---|---|---|
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 |
---|---|---|---|
href | string | The URL to link to. | |
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } | `{ narrow: false regular: true wide: true }` | Whether the parent link is hidden. |
sx | SystemStyleObject | Style overrides to apply to the component. See also overriding styles. |
Name | Type | Default | Description |
---|---|---|---|
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 |
---|---|---|---|
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 |
---|---|---|---|
hidden | | boolean | { narrow?: boolean regular?: boolean wide?: boolean } | false | Whether the content is hidden. |
variant | | 'subtitle' | 'medium' | 'large' | { narrow?: | 'subtitle' | 'medium' | 'large' regular?: | 'subtitle' | 'medium' | 'large' wide?: | 'subtitle' | 'medium' | 'large' } | medium | 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 | Style overrides to apply to the component. See also overriding styles. |
Name | Type | Default | Description |
---|---|---|---|
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 |
---|---|---|---|
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 |
---|---|---|---|
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. | |
as | React.ElementType | "h2" | The underlying element to render — either a HTML element name or a React component. |
Name | Type | Default | Description |
---|---|---|---|
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 |
---|---|---|---|
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 |
---|---|---|---|
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 |
---|---|---|---|
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 |
---|---|---|---|
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 | React.ElementType | "div" | The HTML element used to render the navigation. |
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. |