Skip to content

Commit

Permalink
Header: add overflow (#4768)
Browse files Browse the repository at this point in the history
* add overflow to Header

* Create moody-rivers-impress.md
  • Loading branch information
siddharthkp authored Aug 1, 2024
1 parent 527f9a9 commit b7c90ea
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-rivers-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Header: Add overflow when there are a lot of items
27 changes: 27 additions & 0 deletions packages/react/src/Header/Header.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import React from 'react'
import type {Meta} from '@storybook/react'

import Header from './Header'
import Avatar from '../Avatar'
import Octicon from '../Octicon'
import {MarkGithubIcon} from '@primer/octicons-react'

export default {
title: 'Components/Header/Features',
Expand Down Expand Up @@ -29,3 +32,27 @@ export const WithLinks = () => (
</Header.Item>
</Header>
)

export const WithManyItems = () => (
<Header>
<Header.Item>
<Header.Link href="#" sx={{fontSize: 2}}>
<Octicon icon={MarkGithubIcon} size={32} sx={{mr: 2}} />
<span>GitHub</span>
</Header.Link>
</Header.Item>
<Header.Item>Item</Header.Item>
<Header.Item>Item</Header.Item>
<Header.Item>Item</Header.Item>
<Header.Item>Item</Header.Item>
<Header.Item>Item</Header.Item>
<Header.Item>Item</Header.Item>
<Header.Item>Item</Header.Item>
<Header.Item>Item</Header.Item>
<Header.Item>Item</Header.Item>
<Header.Item>Item</Header.Item>
<Header.Item sx={{mr: 0}}>
<Avatar src="https://github.com/octocat.png" size={20} square alt="@octocat" />
</Header.Item>
</Header>
)
1 change: 1 addition & 0 deletions packages/react/src/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const Header = styled.header<StyledHeaderProps>`
background-color: ${get('colors.header.bg')};
align-items: center;
flex-wrap: nowrap;
overflow: auto;
${sx};
`
Expand Down

0 comments on commit b7c90ea

Please sign in to comment.