{"data":{"allMdx":{"nodes":[{"fileAbsolutePath":"/home/runner/work/design/design/content/index.mdx","frontmatter":{"title":"Interface guidelines"},"rawBody":"---\ntitle: Interface guidelines\n---\n\nimport {HeroLayout} from '@primer/gatsby-theme-doctocat'\nexport default HeroLayout\n\nPrimer's interface guidelines are a collection of principles, standards, and usage guidelines for designing GitHub\ninterfaces.\n\n#### [Guides](/guides)\n\nStandards, guidelines, and tools to getting started with Primer.\n\n#### [Foundations](/foundations)\n\nThe fundamental parts of the design system that underpin all GitHub interfaces, such as color and typography.\n\n#### [UI patterns](/ui-patterns)\n\nDesign guidelines covering common user workflows.\n\n#### [Components](/components)\n\nDesign and usage guidelines for individual Primer components.\n\n## Need help?\n\nIf you found a bug on this website, please [open a new issue](https://github.com/primer/issues/new) with as much detail as possible, including steps to replicate the bug, screenshots, links, and expected results.\n\nIf you need help using and designing with Primer, and you are GitHub staff, please visit the #primer Slack channel.\n","parent":{"relativeDirectory":"","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/action-bar.mdx","frontmatter":{"title":"Action bar"},"rawBody":"---\ntitle: Action bar\nstatus: Experimental\ndescription: Action bar contains a collection of horizontally aligned icon buttons.\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=17042%3A65285&t=SjYdIZSMZa38r2ZU-1\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Usage\n\nUse an action bar to render multiple icon buttons in a row. Buttons can be split into groups by adding a divider. When there is not enough space, buttons that don't fit will be added to an overflow menu.\n\n## Anatomy\n\n<img\n  width=\"960\"\n  alt=\"A diagram of an action bar with a few buttons, a divider and at the end a button that opens an overflow menu.\"\n  src=\"https://user-images.githubusercontent.com/378023/193506131-be8bead4-d1ab-4c79-8ac1-054e75bac9be.png\"\n/>\n\n## Content\n\n### Buttons\n\nAn action bar should only contain icon buttons with the `invisible` variant (no border/background).\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193506398-6d6da18a-b70d-4cd4-b6e4-fd472a24934f.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Use only invisible icon buttons in an action bar.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193506488-44543352-f513-469e-8783-5d1cc7f44eaf.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Don't use other variants or components in an action bar.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Dividers\n\nDividers can be added to visually group related buttons.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193506858-6542a6ba-4bac-400d-bba9-8601fbc032ed.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Use a divider between buttons.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193506894-dc0a65a0-0f81-444a-aa8c-f3b0f74aecb5.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Don't use a divider at the beginning or end of the action bar.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Overflow menu\n\nWhen the buttons don't fit in the available space, an overflow button (\"kebab\" icon) is added at the end of the action bar signaling that there are more actions available. Clicking on the overflow button opens a menu with the remaining actions that didn't fit.\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/193507064-4efe3f63-7b30-4656-8304-3dea3e3f1e03.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\n#### Sorting\n\nButtons that don't fit are added to the top of the menu. Meaning that the last button in the action bar will also be the last button when inside the menu:\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/188835345-0cfd3376-1658-496f-a78b-f5977aa2198c.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\n#### Demo\n\n<CustomVideoPlayer\n  width=\"720px\"\n  loop\n  src=\"https://user-images.githubusercontent.com/378023/188359460-bc88bac8-9c69-4aea-8ce0-bc427bedc3a3.mov\"\n  poster=\"https://user-images.githubusercontent.com/378023/188529873-eafbad89-9eeb-4342-905d-15d89d288ffd.png\"\n/>\n<Caption>Overflow button appears when not enough space and resizing the action bar updates the overflow menu.</Caption>\n\n## States\n\n### Button states\n\nButtons in action bars are solely used for triggering actions. Consider using a [segmented control](/components/segmented-control) when a button should have a selected state.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193506579-a665b941-5b4e-4e44-9439-cfb4e7e93ef3.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>\n      Buttons in action bars have a hover and pressed state, and a focused state when using a keyboard to navigate.\n    </Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193506649-07cb8b8b-3658-477a-b7a2-f00ad9825f26.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Don't add a selected state or any other information like a notification dot or a counter.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Tooltips\n\nWhen hovering over a button, a tooltip will appear that describes the action.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193506950-1702cff8-c751-4bc2-a37a-a837d1e69320.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Describe what action will be taken when clicking on the button.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193506979-07aa35d2-48f5-4b09-aa3e-c575be0e578e.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Don't use a tooltip in action bars to convey a current state.</Caption>\n  </Dont>\n</DoDontContainer>\n\n## Options\n\n### Size\n\nAction bars can have 3 different sizes:\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/193507132-f3ad4632-e257-4301-bd48-0669f4347ddc.png\"\n  role=\"presentation\"\n  width=\"960\"\n/>\n\n- Small (`28px`)\n- Medium (`32px`) (default)\n- Large (`40px`)\n\n## Layout\n\nAction bars can be used inline next to other content or also full width taking up the entire space.\n\n<Box as=\"p\">\n  <img\n    src=\"https://user-images.githubusercontent.com/378023/193507204-7d2e1e10-8906-49b4-9c80-10d69fce3e92.png\"\n    role=\"presentation\"\n    width=\"960\"\n  />\n</Box>\n\n### Spacing\n\nMake sure to add extra spacing around the action bar.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193507240-00801a0a-053b-45e3-9896-9d47150f8a99.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Extra padding of 8px is added when nesting an action bar in a box component.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193507276-25dbece0-ea90-4050-8333-2a7891dee8ef.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>\n      Avoid having the action bar touch something else. Even though the action bar buttons have no borders in their\n      resting state, when hovering/pressing a button it will show a background color.\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\n## Accessibility\n\n### Role\n\nAn action bar has an ARIA role of [`toolbar`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/toolbar_role).\n\n### Keyboard navigation\n\n| Key                | description                                                                                                                                                                                                                                                                                                                                            |\n| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `Tab`              | Moves focus into and out of the action bar. Note that there should only be **one tab-stop** and pressing tab again should focus the next focusable element after the action bar. Also the first button is focused if the action bar is receiving focus for the first time after page load. Otherwise, the most recently focused button receives focus. |\n| `→`                | Right arrow moves focus to the **next** button. If the last button has focus, focus loops back to the first button.                                                                                                                                                                                                                                    |\n| `←`                | Left arrow moves focus to the **previous** button. If the first button has focus, focus moves to the last button.                                                                                                                                                                                                                                      |\n| `Home`             | Moves focus to the **first** button.                                                                                                                                                                                                                                                                                                                   |\n| `End`              | Moves focus to the **last** button.                                                                                                                                                                                                                                                                                                                    |\n| `Enter` or `Space` | Triggers the button **action**.                                                                                                                                                                                                                                                                                                                        |\n\n<!-- TODO: Add video -->\n\n### Touch targets\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Text as=\"p\" mt=\"0\">\n    Ensure action bar buttons have a large enough touch target size (44px by 44px). The buttons should respond to\n    hovers, clicks, and taps anywhere in the touch target area, even if it isn't directly on the control. To avoid\n    overlapping of touch targets, additional space between each button is needed (for example a 12px gap for medium\n    sized buttons).\n  </Text>\n  <img\n    src=\"https://user-images.githubusercontent.com/378023/193507314-1f1cc55d-ca4e-4832-a6de-785546e079ca.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n","parent":{"relativeDirectory":"components","name":"action-bar"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/action-list.mdx","frontmatter":{"title":"Action list"},"rawBody":"---\ntitle: Action list\nreactId: action_list\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=1927%3A0\ndescription:\n  Action list is a vertical list of interactive actions or options. It's composed of items presented in a consistent.\n  single-column format, with room for icons, descriptions, side information, and other rich visuals.\n---\n\nimport {Box, Button, Heading, Link} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<ImageContainer>\n  <img\n    width=\"868\"\n    src=\"https://user-images.githubusercontent.com/293280/125994797-430b8376-30f8-4971-b476-c5186f9ef6ca.png\"\n    alt=\"Action list examples\"\n    style=\"background: none\"\n  />\n</ImageContainer>\n\n## Overview\n\nAction lists can have many applications:\n\n- They’re the foundation of menus, selection panels, and other overlay components\n- They can be applied to page sidebars for showing individual actions, handling local navigation, and displaying metadata\n\nAction lists support section dividers and headers for grouping items, and individual item dividers for added clarity.\n\nAction lists use a mobile-friendly inset style. Their sizes are adapted on touch devices, and their single-column format should render consistently in any screen size.\n\nItems in an action list are generally interactive, and respond visually to `hover`, `active`, and `focus` states. Disabled and read-only items are also supported.\n\n## Anatomy\n\nAn action list can be composed of:\n\n- Action list items\n- Item dividers\n- Section headers (subtle or filled styles)\n- Section dividers (subtle or filled styles)\n\n<img\n  src=\"https://user-images.githubusercontent.com/293280/125995889-12a2de9a-7e15-4638-87dd-6796a983f733.png\"\n  alt=\"Action list anatomy\"\n/>\n\n<img\n  src=\"https://user-images.githubusercontent.com/293280/125996049-e2af9cc7-c736-4adc-9800-a1d742b7929e.png\"\n  alt=\"Action list item anatomy\"\n/>\n\n## Options\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n    <Box justifyContent=\"center\">\n        <img\n            width=\"464\"\n            alt=\"Action list sizes\"\n            src=\"https://user-images.githubusercontent.com/293280/125997468-fa064d6b-ace3-4dec-920d-178478d67ba9.png\"\n        />\n    </Box>\n    <Box>\n        <Heading sx={{fontSize: 3}}>Sizes</Heading>\n        <Box as=\"p\">Action list items support three different sizes: small, medium, and large. The small size is the default and most common option. Medium sizes work well for relaxed local navigation, while large sizes can support items that need more breathing room.</Box>\n        <Box as=\"p\">Sizes only grow vertically. This behavior keeps the content aligned among items, and retains horizontal space for density.</Box>\n        <Box as=\"p\">On touch devices, the large size is used at all times to ensure usability when tapping.</Box>\n        <Box as=\"p\">Be cautious when mixing different sizes in the same list to avoid inconsistency.</Box>\n    </Box>\n    <Box flexDirection=\"column\" justifyContent=\"center\">\n        <Box>\n            <img\n                width=\"464\"\n                alt=\"\"\n                src=\"https://user-images.githubusercontent.com/293280/125997571-d8b92b5e-5241-4f33-b223-825335b18f3d.png\"\n            />\n            <Caption>Use leading visuals to represent system sections, features, or options.</Caption>\n        </Box>\n        <Box>\n            <img\n                width=\"464\"\n                alt=\"\"\n                src=\"https://user-images.githubusercontent.com/293280/125997693-e0d9e379-19c1-4382-adbb-2a1882937373.png\"\n            />\n            <Caption>Use leading visuals in important menu items.</Caption>\n        </Box>\n        <Box>\n            <img\n                width=\"464\"\n                alt=\"\"\n                src=\"https://user-images.githubusercontent.com/293280/125998871-9f51e402-2ccf-4e0a-9465-65d4956c630f.png\"\n            />\n            <Caption>Use leading visuals to represent content types.</Caption>\n        </Box>\n    </Box>\n    <Box>\n        <Heading sx={{fontSize: 3}}>Leading visual</Heading>\n        <Box as=\"p\">Leading visuals are optional and appear at the start of an item. They can be octicons, avatars, and other custom visuals that fit a small area.</Box>\n        <Box as=\"p\">When listing system sections, features, or options, use leading visuals to improve the items' scannability. In user-generated objects, they can help to indicate the item's content type and status.</Box>\n        <Box as=\"p\">Depending on the context, displaying a leading visual may not be necessary. For example, a list of branches in a select panel may not need repeated icons if the surrounding UI provides enough hints about its content type.</Box>\n    </Box>\n    <Box flexDirection=\"column\" justifyContent=\"center\">\n        <Box>\n            <img\n                width=\"464\"\n                alt=\"\"\n                src=\"https://user-images.githubusercontent.com/293280/125998961-24f90611-fe5f-4169-8943-eef68a6755a9.png\"\n            />\n            <Caption>A right arrow as a trailing visual indicates there are more options to choose after selecting an item.</Caption>\n        </Box>\n        <Box>\n            <img\n                width=\"464\"\n                alt=\"\"\n                src=\"https://user-images.githubusercontent.com/293280/125999062-bc489a21-cdc6-455a-8363-b7c8c7faeb3a.png\"\n            />\n            <Caption>Trailing text with custom styling to indicate diff change.</Caption>\n        </Box>\n    </Box>\n    <Box>\n        <Heading sx={{fontSize: 3}}>Trailing visual and trailing text</Heading>\n        <Box as=\"p\">Trailing visual and trailing text can display auxiliary information. They're placed at the right of the item, and can denote status, keyboard shortcuts, or be used to set expectations about what the action does.</Box>\n        <Box as=\"p\">Note these side visuals don't have dedicated interaction targets.</Box>\n        <Box as=\"p\">\n\nUse an [`arrow-right`](https://primer.style/octicons/arrow-right-16) octicon in menus to indicate the action will open more options, such as in a nested context. Use a [`pencil`](https://primer.style/octicons/pencil-16) octicon to indicate the item is going to be edited after clicking it.\n\n</Box>\n        <Box as=\"p\">Custom trailing elements are supported, such as counters, labels, and other custom visuals that may help identify the item.</Box>\n        <Box as=\"p\">When using a trailing text for displaying keyboard shortcuts, always confirm the characters match with the user's operating system. For example, to indicate a bold action in a Markdown toolbar, use \"Ctrl+B\" on Linux and Windows, and \"⌘B\" on Mac. <a href=\"https://support.apple.com/en-us/HT201236\">See reference for Mac keyboard glyphs</a>.</Box>\n    </Box>\n    <Box justifyContent=\"center\">\n        <img\n            width=\"464\"\n            alt=\"Navigation list with an action button used to rerun a job, visible on hover.\"\n            src=\"https://user-images.githubusercontent.com/18661030/193155140-ae9cca41-280b-4cc2-a0c0-1a830b12b5c9.png\"\n        />\n    </Box>\n    <Box>\n        <Heading sx={{fontSize: 3}}>Trailing actions</Heading>\n        <Box as=\"p\">Trailing action buttons can be used to present a secondary interaction related to the contents of the main item, such as opening a menu or dialog. They may appear when an item is hovered, and can be keyboard focused individually.</Box>\n    </Box>\n    <Box justifyContent=\"center\">\n        <img\n            width=\"464\"\n            alt=\"Multi-selection\"\n            src=\"https://user-images.githubusercontent.com/293280/126000062-3fc62e04-670d-4346-b65b-57c2e70ceeb0.png\"\n        />\n    </Box>\n    <Box>\n        <Heading sx={{fontSize: 3}}>Item dividers</Heading>\n        <Box as=\"p\">Item dividers allow users to parse heavier amounts of information. They're placed between items and are useful in complex lists, particularly when descriptions or multi-line text is present.</Box>\n        <Box as=\"p\">When considering whether to use item dividers, make sure they truly make the presented information easier to parse, instead of only increasing visual clutter.</Box>\n        <Box as=\"p\">When using item dividers, increasing the action list item size may also help with legibility.</Box>\n    </Box>\n    <Box justifyContent=\"center\">\n        <img\n            width=\"464\"\n            alt=\"Multi-selection\"\n            src=\"https://user-images.githubusercontent.com/293280/126000062-3fc62e04-670d-4346-b65b-57c2e70ceeb0.png\"\n        />\n    </Box>\n    <Box>\n        <Heading sx={{fontSize: 3}}>Selection states</Heading>\n        <Box as=\"p\">\n\nAction list items can be selected. Single selections are represented with a [`check`](https://primer.style/octicons/check-16) octicon, while multiple selections are represented with a checkbox component. These selection visuals are always placed at the beginning of the item.\n\n</Box>\n        <Box as=\"p\">When listing selectable items alongside non-selectable items in a menu, use dividers to differentiate between the item types.</Box>\n        <Box as=\"p\">Don't mix different types of selections in the same list.</Box>\n    </Box>\n    <Box justifyContent=\"center\">\n        <img\n            width=\"464\"\n            alt=\"Action list item in danger variation\"\n            src=\"https://user-images.githubusercontent.com/293280/125999384-b2a322db-8ec3-4a69-a414-10050544813b.png\"\n        />\n    </Box>\n    <Box>\n        <Heading sx={{fontSize: 3}}>Danger items</Heading>\n        <Box as=\"p\">An action list item can have a special \"danger\" style, to be used in cases that require extra attention from the user.</Box>\n        <Box as=\"p\">For destructive or irremediable actions, show a confirmation dialog for extra friction. If the action is not destructive, present the user a way to undo the action instead of asking for confirmation. <a href=\"https://alistapart.com/article/neveruseawarning/\">Never use a warning when you mean undo</a>.</Box>\n        <Box as=\"p\">Place danger items at the end of the list.</Box>\n    </Box>\n</Box>\n\n## Application\n\n### In overlays\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 2fr']} gridGap={4}>\n    <div>\n        <Link href=\"https://primer.style/react/ActionMenu\">\n            <img alt=\"Action menu\" src=\"https://user-images.githubusercontent.com/293280/123880964-95b3a700-d8f8-11eb-9775-cbaf165207ed.png\" />\n        </Link>\n    </div>\n    <div>\n        <Heading sx={{fontSize: 3}}>Action menu</Heading>\n        <Box as=\"p\">\n\nAction menus are used for disambiguation, navigation, or to display secondary options. They appear when users interact with buttons, actions, or other controls.\n\n[Primer React implementation](https://primer.style/react/ActionMenu)\n\n</Box>\n    </div>\n    <div>\n        <Link href=\"https://primer.style/react/ActionMenu#with-selection\">\n            <img alt=\"Action Menu with selection\" src=\"https://user-images.githubusercontent.com/293280/123881067-cdbaea00-d8f8-11eb-98e4-e57c64489308.png\" />\n        </Link>\n    </div>\n    <div>\n        <Heading sx={{fontSize: 3}}>Action menu with selection</Heading>\n        <Box as=\"p\">\n\nActionMenu can be used for making a single selection among a small list of options. The list is usually predefined with system values, but in some cases it can include user-provided data when those are known not to grow into too many items.\n\n[Primer React implementation](https://primer.style/react/ActionMenu#with-selection)\n\n</Box>\n    </div>\n    <div>\n        <Link href=\"https://primer.style/react/SelectPanel\">\n            <img alt=\"Select panel\" src=\"https://user-images.githubusercontent.com/293280/123876997-4158f900-d8f1-11eb-85cb-461d9bbee0cb.png\" />\n        </Link>\n    </div>\n    <div>\n        <Heading sx={{fontSize: 3}}>Select panel</Heading>\n        <Box as=\"p\">\n\nSelect panels allow manipulating long lists of options, with filtering and other advanced interactions. They can be used for single or multi-selection.\n\n[Primer React implementation](https://primer.style/react/SelectPanel)\n\n</Box>\n    </div>\n</Box>\n","parent":{"relativeDirectory":"components","name":"action-list"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/action-menu.mdx","frontmatter":{"title":"Action menu"},"rawBody":"---\ntitle: Action menu\nreactId: action_menu\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=17091%3A66640\ndescription: Action menu is composed of action list and overlay patterns used for quick actions and selections.\n---\n\nimport {Box, Button, Heading, Link} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Usage\n\nAction menu is used for actions, navigation, to display secondary options, or single/multi select lists. They appear when users interact with buttons, actions, or other controls.\n\n## Anatomy\n\n<img\n  width=\"960\"\n  alt=\"Action menu opened with a label for the trigger (button), overlay (menu), and the internal action list.\"\n  src=\"https://user-images.githubusercontent.com/18661030/226487158-06c6cc38-65de-438c-8028-373862fa0dfe.png\"\n/>\n\n## Options\n\n<img\n  src=\"https://user-images.githubusercontent.com/18661030/226486461-c43f75c5-d9ed-415f-907c-9d2dbf71e3a2.png\"\n  width=\"960\"\n  alt=\"\"\n/>\n<Caption>\n  The trigger button can be a standard or icon button. For single select menus that display the selection in the\n  trigger, a label must be persist either internally or externally.\n</Caption>\n\n<img\n  src=\"https://user-images.githubusercontent.com/18661030/226486463-893231bb-8f57-4255-83a4-7d468b2be5ed.png\"\n  width=\"960\"\n  alt=\"\"\n/>\n<Caption>Menus can contain simple actions and links, single select items, or multi select items.</Caption>\n\n## Behavior\n\n### Opening\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/18661030/226486479-52730f0f-cc41-41e0-a996-a974899cbc4e.png\"\n      alt=\"\"\n    />\n    <Caption>Open by clicking the trigger button with a mouse</Caption>\n  </div>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/18661030/226486480-4a807f86-b2b0-4d12-8a43-8cc95d36d995.png\"\n      alt=\"\"\n    />\n    <Caption>Open by focusing the trigger button and hitting return, space, or any arrow key</Caption>\n  </div>\n</Box>\n\n### Closing\n\n#### Default behavior\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/18661030/226486482-fc457572-342d-42d3-9da6-fa87ef009cea.png\"\n      alt=\"\"\n    />\n    <Caption>\n      Close the menu by clicking on an item, clicking on the trigger, or clicking anywhere outside the menu.\n    </Caption>\n  </div>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/18661030/226486483-e3d658ea-4148-47d6-95ed-5ca90cc55b38.png\"\n      alt=\"\"\n    />\n    <Caption>Close the menu by hitting enter on an item, or esc.</Caption>\n  </div>\n</Box>\n\n#### Single and multi select\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <div>\n    <CustomVideoPlayer\n      width=\"100%\"\n      src=\"https://user-images.githubusercontent.com/18661030/226487362-b66daa5f-40b3-4f73-908c-19a74cabd435.mp4\"\n    />\n    <Caption>Single select menu closes upon selection and may update the button label.</Caption>\n  </div>\n  <div>\n    <CustomVideoPlayer\n      width=\"100%\"\n      src=\"https://user-images.githubusercontent.com/18661030/226487367-680395c7-1859-40a0-bbfc-53f37a686662.mp4\"\n    />\n    <Caption>Multi select menu closes upon selection and can be re-opened to select more options.</Caption>\n  </div>\n</Box>\n\n### Responsive\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"\"\n    src=\"https://user-images.githubusercontent.com/18661030/226487827-ad73d646-dfbc-4794-9627-c346bd6fbaa2.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Narrow viewports</h4>\n    For narrow viewports, ActionMenu should remain anchored to its trigger and stay within the bounds of the viewport.\n  </Box>\n</Box>\n\n## Best practices\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"464\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/226486465-1616fde7-733c-4cbd-b4f8-24b3b113731c.png\"\n    />\n    <Caption>Use ActionMenu for quick actions.</Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"464\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/226486469-677e6998-a700-43d7-8048-2033cb7b3eac.png\"\n    />\n    <Caption>For complex interactions, use <a href=\"https://primer.style/react/SelectPanel\">SelectPanel</a>.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"464\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/226486470-ee837f56-21ee-4b7b-a4c6-6d4bf63bd115.png\"\n    />\n    <Caption>Use ActionMenu for simple selection.</Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"464\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/226486471-1fd6f434-ecb6-4159-92ee-f2ce8b5b9021.png\"\n    />\n    <Caption>\n      Use <a href=\"https://primer.style/react/SelectPanel\">SelectPanel</a> for a filtered search.\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"464\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/226486473-9cf0c64f-5ae6-40a5-bd0f-87d3ed34f90d.png\"\n    />\n    <Caption>Use a button to open a menu.</Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"464\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/226486474-08b75358-bfcb-483d-bba0-25947a71c8de.png\"\n    />\n    <Caption>Don’t use a link to open a menu.</Caption>\n  </Dont>\n</DoDontContainer>\n\n## Accessibility\n\nSee [focus management](/guides/accessibility/focus-management) for more information.\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"\"\n    src=\"https://user-images.githubusercontent.com/18661030/226486487-b03672c1-c314-4be0-b96b-d4c348b2ff4d.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Menu mnemonics</h4>\n    When a menu is open, hitting a letter key for the first letter in an item to be selected will move focus to that item. If\n    two items have the same first letter, the first item in the list will be focused first, and hitting the letter key again\n    will focus the next item.\n  </Box>\n</Box>\n\n### Keyboard navigation\n\n#### Trigger button\n\n| Key                                                                                                                                                            | Description     |\n| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>Enter</Box>      | Opens the menu. |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>Space</Box>      | Opens the menu. |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowDown</Box>  | Opens the menu. |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowUp</Box>    | Opens the menu. |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowLeft</Box>  | Opens the menu. |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowRight</Box> | Opens the menu. |\n\n#### Menu items\n\n| Key                                                                                                                                                            | Description                                                     |\n| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowUp</Box>    | Cycle through items starting with current item to previous item |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowDown</Box>  | Cycle through items starting with current item to next item     |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowLeft</Box>  | Cycle through items starting with current item to previous item |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowRight</Box> | Cycle through items starting with current item to next item     |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>Home</Box>       | Move focus to first item                                         |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>PageUp</Box>     | Move focus to first item                                         |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>End</Box>        | Move focus to last item                                         |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>PageDown</Box>   | Move focus to last item                                         |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>Esc</Box>        | Close menu                                                      |\n\n## Related components\n\n- [Action list](/components/action-list)\n- [Select panel](https://primer.style/react/SelectPanel)\n","parent":{"relativeDirectory":"components","name":"action-menu"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/anchored-overlay.mdx","frontmatter":{"title":"Anchored overlay"},"rawBody":"---\ntitle: Anchored overlay\nreactId: anchored_overlay\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=15528%3A49147\ndescription: Anchored overlay opens an overlay relative to the anchor position.\n---\n\nimport {Box, Button, Heading} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Overview\n\nAnchored overlay provides an anchor that will open a floating overlay positioned relative to the anchor. The overlay can be opened and navigated using a keyboard or mouse.\n\nSee also [Overlay positioning](https://primer.style/react/Overlay#positioning)\n\n## Related components\n\n- [Overlay](https://primer.style/react/Overlay)\n\n## Accessibility\n\nThe anchored overlay menu will automatically receive a focus trap and focus zone. Use up/down keys to navigate between buttons.\n","parent":{"relativeDirectory":"components","name":"anchored-overlay"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/autocomplete.mdx","frontmatter":{"title":"Autocomplete"},"rawBody":"---\ntitle: Autocomplete\ndescription: Autocomplete allows users to quickly filter through a list of options and pick one or more values for a field.\nreactId: autocomplete\nrails: https://primer.style/view-components/components/beta/autocomplete\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=1927%3A0\n---\n\nimport {Box} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Overview\n\nThe autocomplete component is an enhanced text input that makes it easier to choose one or more values from a long list of options. The list of options is displayed when a user focuses the input.\n\n## Anatomy\n\nAutocomplete is made up of a form input field, label, and overlay of menu options. The label is required but may be visually hidden. Optionally, a leading visual and/or clear button may be displayed.\n\n![autocomplete component diagram with an input label stating pick a branch, empty focused input field with a search icon and clear button, and an overlay menu listing search options](https://user-images.githubusercontent.com/18661030/170589956-7c0f2498-b55c-4013-8c99-ef5bc1844218.png)\n\n## Usage\n\n### Text input\n\n![two side by side autocomplete inputs, one showing a single select filled state, and another showing a multi select filled state with clearable tokens](https://user-images.githubusercontent.com/18661030/170590638-b7868803-6558-4df9-b462-20d00420b9f5.png)\n\nThe Autocomplete text input has all the same design functionality and properties as a regular text input including size options, width, leading visual, trailing action, and states. When a single item is selected from the menu, it will display in the input as regular text. If multiple items are selected, they will display as clearable tokens within the input.\n\n### Menu\n\n![two side by side autocomplete inputs focused with open menus. One shows a single select menu, the second shows a multi select menu with checkboxes](https://user-images.githubusercontent.com/18661030/170590641-42b27a3a-799a-4c1e-aaef-774990aed345.png)\n\nThe menu is a list of options for the field's value. It appears as a list in a non-modal dialog that the user may select one or more values from. The menu uses Overlay and ActionList designs for size, structure and interaction.\n\n#### Menu item rendering\n\nBy default, menu items are rendered as a single line of text. The list in the menu is rendered using the [Action List](/action-list) component, so menu items can be rendered with all of the same options as Action List items.\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"opened autocomplete menu stating: no selectable options\"\n    src=\"https://user-images.githubusercontent.com/18661030/170601327-97307d21-a33c-4a9f-9e2f-ad9e444a161d.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    If no options are available based on the search term, the menu will display a message that says \"No selectable\n    options\". A concise, custom message may be used in place of the default.\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"opened autocomplete menu with an add item action\"\n    src=\"https://user-images.githubusercontent.com/18661030/170589959-73608127-771d-4f7e-a78d-11b31433141d.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    If a user is not limited to a pre-defined list of options, an additional item can be rendered in the menu to select\n    the value that has been typed into the text input.\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"opened autocomplete menu with a loading spinner\"\n    src=\"https://user-images.githubusercontent.com/18661030/170589963-ab3e211b-1082-4fdb-928e-eddd2b773ba3.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    A loading indicator should be displayed while the data for the list of options is being populated. The loading\n    indicator helps the user understand that the list is not empty, it's just not done loading.\n  </Box>\n</Box>\n\n## Sort and filter behavior\n\n### Sorting\n\nThe order of the items should be ordered in a way that makes it easy for a user to find a specific value. This could mean items may be ranked by how likely a user is to pick that option (for example, ordering labels by the number of times they've been used in that repository), or it could simply be in alphabetical order.\n\nIf multiple values can be selected, the default behavior is to move the selected items to the top of the list after the menu is closed. If this sorting logic is not helpful for your use case, you may override this behavior with a more appropriate sorting logic.\n\n### Filtering\n\nBy default, menu items are filtered based on whether or not they match the value of the text input. The default filter is case-insensitive.\n\nCustom filtering logic can be applied if the default filtering behavior does not make sense for your use case. However, it is strongly discouraged to disable filtering entirely.\n","parent":{"relativeDirectory":"components","name":"autocomplete"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/avatar-pair.mdx","frontmatter":{"title":"Avatar pair"},"rawBody":"---\ntitle: Avatar pair\ndescription: Avatar pair is composed of two avatars, one larger one and a smaller one, overlaid slightly.\nreactId: avatar_pair\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=13007%3A40428\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Usage\n\n<img\n  width=\"960\"\n  alt=\"An image showing two different avatars, one larger and one smaller, to represent a parent-child combination.\"\n  src=\"https://user-images.githubusercontent.com/586552/203213337-c7d0f683-4971-4ef3-b480-c4743b929634.png\"\n/>\n\nUse AvatarPair to display two avatars when one is secondary to the other.\n\n## Options\n\nAvatar pair has two parent-child combinations: the parent as the circle and the child as the square, and vice-versa.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/203212171-7fff46e1-e250-4b9f-8e4c-a9acab8eec8b.png\"\n      alt=\"\"\n    />\n    <Caption>Parent as the circle avatar (human) and child as the square (entity).</Caption>\n  </div>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/203212177-e872b53e-6a2c-4539-a148-a5d86298fde6.png\"\n      alt=\"\"\n    />\n    <Caption>Parent as the square avatar (entity) and child as the circle (human).</Caption>\n  </div>\n</Box>\n\n## Related components\n\n- [Avatar](/components/avatar)\n- [Avatar stack](/components/avatar-stack)\n","parent":{"relativeDirectory":"components","name":"avatar-pair"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/avatar-stack.mdx","frontmatter":{"title":"Avatar stack"},"rawBody":"---\ntitle: Avatar stack\ndescription: Avatar stack displays two or more avatars in an inline stack.\nreactId: avatar_stack\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=13007%3A40428\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  alt=\"A diagram of three avatars stacked next to each other.\"\n  src=\"https://user-images.githubusercontent.com/586552/203208345-b110f45e-f7e5-4fab-b972-f5d31e809f22.png\"\n/>\n\n## Usage\n\nStacked avatars can be used to show multiple collaborators or participants when there is limited space available. When you hover over the stack, the avatars will reveal themselves.\n\n### Best practices\n\n- Use AvatarStack when space is limited\n- Don’t use AvatarStack if there is adequate space to show 4 avatars or less.\n\n## Anatomy\n\nAvatar stack displays a minimum of 2 avatars and a maximum of 4 avatars.\nOnly the 20px avatar size is currently used in the avatar stack.\n\n## Options\n\n### Alignment\n\nThe default AvatarStack is left-aligned. You can [right-align](https://primer.style/react/AvatarStack#right-aligned) the component for layouts that are better suited for it.\n\n## Related components\n\n- [Avatar](/components/avatar)\n- [Avatar pair](/components/avatar-pair)\n","parent":{"relativeDirectory":"components","name":"avatar-stack"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/avatar.mdx","frontmatter":{"title":"Avatar"},"rawBody":"---\ntitle: Avatar\ndescription: Avatar is an image that represents a user or organization.\nreactId: avatar\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=13007%3A40428\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  alt=\"An image showing two different avatars, a user and an organization.\"\n  src=\"https://user-images.githubusercontent.com/586552/203206390-f57e83e5-6950-4036-8e67-869ca99f510c.png\"\n/>\n\n## Usage\n\nUse avatars to represent users, organizations, bots, or teams. On GitHub, avatars are either rounded squares or circles.\n\n## Options\n\n### Size\n\nAvatars start at 16px and increment by base-4 until 32px. At 32px, the scale switches to base-8 up to 48px.\n64px is the largest size in this scale.\n\n<img\n  width=\"960\"\n  alt=\"An image showing avatars ranging in size from smallest to largest.\"\n  src=\"https://user-images.githubusercontent.com/586552/207139770-429f7327-c3e5-4e38-aa58-185a03d82304.png\"\n/>\n\n### Shape\n\nAvatars appear as two different shapes, each with their own functional purpose.\n\n- **Circle avatars** represent individual people.\n- **Square avatars** represent non-human entities, such as bots, teams, or organizations\n\n## Related components\n\n- [Avatar pair](/components/avatar-pair)\n- [Avatar stack](/components/avatar-stack)\n","parent":{"relativeDirectory":"components","name":"avatar"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/box.mdx","frontmatter":{"title":"Box"},"rawBody":"---\ntitle: Box\ndescription: Box is a basic wrapper component for most layout related needs.\nreactId: box\nrails: https://primer.style/view-components/components/box\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Usage\n\nThe box component is considered a utility component, as it can be used for something as simple as a rounded corner box.\n\nBy default there are no additional styles, as these can be achieved using styled system props to enable custom theme-aware styling.\n","parent":{"relativeDirectory":"components","name":"box"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/branch-name.mdx","frontmatter":{"title":"Branch name"},"rawBody":"---\ntitle: Branch name\ndescription: Branch name is a label-type component rendered as an <a> tag by default that displays the name of a branch.\nreactId: branch_name\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=14855%3A46652\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  alt=\"An image showing a branch name component.\"\n  src=\"https://user-images.githubusercontent.com/586552/207118150-306e0679-f77b-4668-8700-3da506256ad1.png\"\n/>\n\n## Usage\n\nUse this component to represent a branch name label and link to its tree.\n\n## Options\n\n### Icon\n\nInclude the branch icon when using the component in isolation and in places where users can’t easily determine whether the label represents a branch from the surrounding context.\n\n<img\n  width=\"960\"\n  alt=\"An image showing a branch name component with a branch icon.\"\n  src=\"https://user-images.githubusercontent.com/586552/207118155-5660c7c8-32f0-4eee-84c6-ce2b5c98b3ba.png\"\n/>\n\n## As a link\n\nBranch name is rendered as a link by default. You can also represent the branch label in plain text.\n\n<img\n  width=\"960\"\n  alt=\"An image showing a branch name component as a link and a branch name component as plain text.\"\n  src=\"https://user-images.githubusercontent.com/586552/204637507-08c61b68-c474-4d64-9d64-91bf46fcff42.png\"\n/>\n","parent":{"relativeDirectory":"components","name":"branch-name"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/breadcrumbs.mdx","frontmatter":{"title":"Breadcrumbs"},"rawBody":"---\ntitle: Breadcrumbs\ndescription: Breadcrumbs display the current page or context within the site, allowing them to navigate different levels of the hierarchy.\nreactId: breadcrumbs\nrails: https://primer.style/view-components/components/beta/breadcrumbs\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=14985%3A47006\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  alt=\"An image of the breadcrumb component\"\n  src=\"https://user-images.githubusercontent.com/586552/204619264-27de7458-1a77-445f-bc56-83472bf30bfe.png\"\n/>\n\n## Usage\n\nBreadcrumbs are used to show taxonomical context on pages that are many levels deep in a site’s hierarchy. Breadcrumbs show and link to pages higher up in the ancestry.\n\nBreadcrumbs are most appropriate on pages that:\n\n- Are many levels deep on a site\n- Do not have a section-level navigation\n- May need the ability to quickly go back to the previous (parent) page\n- All items must contain links, with the last item as the user's current context\n\n## Anatomy\n\nBreadcrumbs are made of links (indicating parents), dividers, and the current page. The default breadcrumbs component can be modified to change the number of items within the chain.\n\n<img\n  width=\"960\"\n  alt=\"An image showing the anatomy of the breacrumb component\"\n  src=\"https://user-images.githubusercontent.com/586552/204619263-c21f06c1-433d-4817-860b-f9d051836cd3.png\"\n/>\n\n<Caption>Note: The space between items is set to 0px as the divider has padding built into it.</Caption>\n\n## Options\n\n### Breadcrumb length\n\nBy default the breadcrumbs component can show up to 10 items within the chain.\n\n<img\n  width=\"960\"\n  alt=\"An image showing various breadcrumbs with different numbers of items in the breadcrumb chain\"\n  src=\"https://user-images.githubusercontent.com/586552/204618645-1abd2204-f197-402d-9b01-de648ddd1812.png\"\n/>\n","parent":{"relativeDirectory":"components","name":"breadcrumbs"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/button-group.mdx","frontmatter":{"title":"Button group"},"rawBody":"---\ntitle: Button group\ndescription: Button group renders a series of buttons.\nreactId: button_group\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=20363%3A71038&t=GrA68FvIJRoUaVbl-1\nrails: https://primer.style/view-components/components/beta/buttongroup\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n    src=\"https://user-images.githubusercontent.com/586552/226987730-84d99d46-1dd4-4ddc-91b3-046d7eeedbad.png\"\n    role=\"presentation\"\n    width=\"960\"\n    alt=\"An image showing a button group in medium and small sizes.\"\n/>\n\n## Usage\n\nButtons can be grouped together as individual segments of related actions. \n\nEach segment in a button group is comprised from our default button component and can be visually represented with the same button types and states.\n\nGrouping buttons with a button group is better than rendering buttons close together for the following uses:\n\n- rendering a group of buttons next to one or more buttons\n- grouping multiple sets of buttons\n- saving horizontal space when rendering multiple closely-related buttons\n\n### Best practices\n\n- Use button groups to organize similar functionality. Don't group buttons just because they're close together.\n- For most use-cases, only default button types should be used in button groups. In rare cases, primary buttons can be included in button groups but there should only ever be one primary button (if any) in a button group.\n- Avoid grouping too many buttons together. It could be overwhelming to the user.\n- Do not use a button group to indicate a selection. Use a [segmented control](/components/segmented-control) instead.\n- Do not use a button group as a replacement for tab navigation. <!-- TODO: link to TabNav once it's merged -->\n- Avoid mixing buttons with text labels with icon-only buttons. However, it is acceptable to group a text-labeled button with an icon-only button with a [down-pointing triangle](https://primer.style/design/foundations/icons/triangle-down-16) that opens a dropdown menu of actions related to the button.\n- Do not group an [invisible](/components/button#invisible) button with buttons of another variant.\n\n## Options\n\n### Size\n\nButton groups only support medium (default) and small button sizes.\n\n<img\n    src=\"https://user-images.githubusercontent.com/586552/226987738-cf95c038-8fa7-4393-bf2c-014082145556.png\"\n    role=\"presentation\"\n    width=\"960\"\n    alt=\"An image showing a button group in medium and small sizes.\"\n/>\n\n### Split buttons with a dropdown\n\nA button group can be shown as a split button with an action on the left and dropdown button with an additional list of actions.\n\n<img\n    src=\"https://user-images.githubusercontent.com/586552/226987739-a7aeadc7-9bc3-40d1-ba34-beefe32525ff.png\"\n    role=\"presentation\"\n    width=\"960\"\n    alt=\"An image showing a button group in medium and small sizes.\"\n/>\n\n### Leading and trailing visuals\n\nSimilarly to buttons, button segments can optionally include an icon and/or a counter.\n\n<img\n    src=\"https://user-images.githubusercontent.com/586552/226987735-471711f1-5342-4605-903d-889301eace46.png\"\n    role=\"presentation\"\n    width=\"960\"\n    alt=\"An image showing a button group in medium and small sizes.\"\n/>\n\n## Accessibility\n\nA button group does not behave like a [toolbar](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/toolbar_role), so assistive technologies still interpret the buttons as unrelated. The grouping is purely visual.\n\n### Descriptive buttons\n\nLabeling buttons properly lets users know what will happen when they activate the control, lessens errors, and increases confidence.\n\nRead more about [descriptive buttons](/guides/accessibility/descriptive-buttons).\n\n## Related links\n\n- [Button](/components/button)\n\n- [Segmented control](/components/segmented-control)\n\n","parent":{"relativeDirectory":"components","name":"button-group"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/button.mdx","frontmatter":{"title":"Button"},"rawBody":"---\ntitle: Button\ndescription: Button is used to initiate actions on a page or form.\nreactId: button\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=136%3A1805&t=Tj1PzACLUAihiXgm-1\nrails: https://primer.style/view-components/components/beta/button\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  alt=\"Image displaying each variation of button, from left: Secondary, Primary, Danger, Invisible.\"\n  src=\"https://user-images.githubusercontent.com/586552/217628240-8ff527d5-8cac-4b3d-b7ac-8fd3b36ffd64.png\"\n/>\n\n## Usage\n\nButtons allow users to initiate an action or command when clicked or tapped. The button's label or text description indicates the purpose of the action to the user. At GitHub, buttons are a fundamental building block of our products. Most of the time, we use the \"Default\" button type, but other types of buttons may be used to indicate something special about the button's hierarchy or functionality.\n\n## Anatomy\n\n<img\n  width=\"960\"\n  alt=\"Anatomy of a button, including the label, leading visual, trailing visual, and trailing action\"\n  src=\"https://user-images.githubusercontent.com/586552/217702365-f8d6ce35-08e0-4d0b-a6d6-8af12d8ea8cf.png\"\n/>\n\n## Options\n\n### Leading and trailing visuals\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"trailing action on a button\"\n    src=\"https://user-images.githubusercontent.com/586552/217703058-f9ad11e2-162d-4073-bc7c-04a70890b84e.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Trailing actions</h4>\n    Trailing actions such as dropdown carets are always locked to the end of a button, which is particularly obvious for full width scenarios. If a button is a call-to-action (Submit, Save, Do this™, etc), its contents (visuals and button label) appear center-aligned inside the button container. If a button is used for selecting items (Weeks ▾, Iteration ▾, Sort ▾, Select™ ▾, etc), its contents (visuals and button label) appear left-aligned inside the button container.\n\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"leading visual on a button\"\n    src=\"https://user-images.githubusercontent.com/586552/217703061-a5d658ee-b5af-4bf7-8771-59f4190fb2ea.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Leading visuals</h4>\n    Leading visuals provide additional context for a button label, such as a “search” icon next to the label for a search field submit. Leading visuals always apear locked to the button label, even if the button is full width.\n\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"trailing visual on a button\"\n    src=\"https://user-images.githubusercontent.com/586552/217703062-40a5ef54-d89f-44b0-a7ab-5c7b23ec927b.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Trailing visuals</h4>\n    Trailing visuals such as counters display additional information about the action or task at hand.\n    Trailing visuals always apear locked to the button label, even if the button is full width.\n\n  </Box>\n</Box>\n\n### Sizing and spacing\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"button at medium size\"\n    src=\"https://user-images.githubusercontent.com/586552/217703064-c8e13e96-585b-4a91-a4e8-0059ef7dd57e.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Medium (default)</h4>\n    Primer buttons are medium sized by default. \n    Medium is suitable for most interfaces and is considered the preferred size.\n\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"button at small size\"\n    src=\"https://user-images.githubusercontent.com/586552/217703067-8a732463-0c5d-4722-b075-c01813f00482.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Small</h4>\n    Small buttons may be used when space is limited and if the action is less significant.\n\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"button at large size\"\n    src=\"https://user-images.githubusercontent.com/586552/217703069-f37700df-22be-4e1a-a701-e34856927da6.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Large</h4>\n    Large buttons increase the significance of an action and should be used sparingly. \n    More often than not a medium sized button will be more appropriate.\n\n  </Box>\n</Box>\n\n### Color\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"Primary button with green background\"\n    src=\"https://user-images.githubusercontent.com/586552/217703071-524b0574-2f03-444e-95df-6be46782ee47.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Primary</h4>\n    Primary buttons represent the highest priority action in a page. There should only ever be one primary button (if any) in a button group, and typically only one primary button should be present in page.\n\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"Secondary button with gray background\"\n    src=\"https://user-images.githubusercontent.com/586552/217703800-053ca7db-195b-4894-9114-907d6d56e5e1.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Secondary</h4>\n    Secondary buttons are the default button color scheme and are suitable for more interactions. They can be paired with a primary button to perform a secondary action, or used on their own.\n\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"Invisible button with transparent background\"\n    src=\"https://user-images.githubusercontent.com/586552/217703072-3d4fc9d5-687d-42bd-a819-326b24b70ae0.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Invisible</h4>\n    Invisible buttons have a transparent background with translucent hover and active states, making them useful for compound components like ActionList.\n\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"Danger button with red background\"\n    src=\"https://user-images.githubusercontent.com/586552/217703074-33192c43-21d5-44f4-abd3-e35c87ab8f7f.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    <h4>Danger</h4>\n    Danger buttons should be used sparingly to warn of a destructive action, typically resulting in the opening of a confirmation dialog.\n\n  </Box>\n</Box>\n\n## Best practices\n\n### Primary and outline button usage\n\nLimit primary button usage. Only use one primary button on the page, whenever possible, to indicate its emphasis relative to other actions. Primary buttons have top priority in visual hierarchy, and using too many of them on a single view dilutes their effectiveness.\n\n\n### Button usage\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/217700259-ad2702e6-cf3d-4708-b62b-a44a6f54d9b2.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An image showing a button with no line breaks\"\n    />\n    <Caption>Keep button labels succinct with no line breaks.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/217700258-2ab8cdf3-22a2-4628-80dd-1489b28ea387.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An image showing a button with a line break\"\n    />\n    <Caption>Buttons should never contain line breaks and lose their button shape.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/217700257-558c4517-9df3-41a8-bc5c-4df9cca1d7d9.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A button using sentance case\"\n    />\n    <Caption>Use sentence case for labels.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/217700255-95b40748-a02a-4829-a373-aadc587e843d.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A button with text in all caps\"\n    />\n    <Caption>Don't use all-caps or other text formats.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/217700253-97df122e-b484-4ce8-a0cc-886d20cd8beb.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A button showing :focus state\"\n    />\n    <Caption>Show focus styles on keyboard :focus</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/217700252-064704cf-e8ff-46af-a859-acf114c3a19d.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A button with the default :focus styles removed\"\n    />\n    <Caption>Don't remove default button :focus styles.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/217700251-6b03cd5f-1fe9-4176-8347-35a1382ad9d3.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"Primary button placed at the end of the button group\"\n    />\n    <Caption>Do place primary buttons at the end of a button group</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/217700250-b38baf90-bea5-470f-a69b-ec5ed32ca4d8.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"Primary button placed at the start of the button group\"\n    />\n    <Caption>Don't place primary buttons at the start of a button group</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/217700248-e0db9c6c-05b6-488a-89b4-83f55ecaaaf1.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A primary button next to a secondary button\"\n    />\n    <Caption>Use a primary button with a secondary button</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/586552/217700246-62b420c4-523b-4706-a7f6-8a0f219d9b7e.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"Multiple primary buttons placed together\"\n    />\n    <Caption>Don’t place multiple primary buttons together</Caption>\n  </Dont>\n</DoDontContainer>\n\n## Accessibility\n\n### Descriptive buttons\n\nLabeling buttons properly lets users know what will happen when they activate the control, lessens errors, and increases confidence.\n\nRead more about [descriptive buttons](/guides/accessibility/descriptive-buttons).\n","parent":{"relativeDirectory":"components","name":"button"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/checkbox-group.mdx","frontmatter":{"title":"Checkbox group"},"rawBody":"---\ntitle: Checkbox group\ndescription: Checkbox group renders a set of checkboxes.\nreactId: checkbox_group\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=15341%3A47574\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  alt=\"An image of a checkbox group showing two selections\"\n  src=\"https://user-images.githubusercontent.com/586552/205333350-f767c1ee-61b9-49e8-963d-0fad537749e9.png\"\n/>\n\n## Usage\n\nUse checkbox group to allow users to select multiple items from a list of individual items, or to mark one individual item as selected.\n\n### Best practices\n\n- Put checkboxes in a logical order\n- If users are only allowed to select a single option, consider using a [radio group](/components/radio-group) instead\n- Each checkbox's state should be independent from other checkboxes in the group. For example: checking one checkbox should not check or disable any other checkboxes\n\n## Anatomy\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224140255-57987086-f2b3-47be-9ee7-99af26ea6846.png\"\n/>\n\n**Label:** A title that labels the group of options and helps users understand the relationship between the options in the group.\n\n**Required indicator:** Indicates that a selection is required.\n\n**Caption:** May be used to provide additional context about the checkbox group when the label alone is not sufficient\n\n**Options:** A list of options represented using [checkboxes](/components/checkbox).\n\n**Validation message:** A message explaining why the selection failed validation. See the [form pattern documentation](../ui-patterns/forms#validation) for more information on form validation patterns.\n\n## Accessibility\n\nOnce a user checks an option from a checkbox group, the result should not be saved or applied until the user has explicitly submitted their input using a \"save\" or \"submit\" button. See the [saving pattern guidelines](../ui-patterns/saving) for more information.\nAlternative: you can use a [toggle switch](/components/toggle-switch) to immediately toggle something on and off as long as it's not in the context of a bigger form that applies other input values when submited\n\n## Related links\n\n- [Forms](../ui-patterns/forms)\n- [Form control](/components/form-control)\n- [Checkbox](/components/checkbox)\n- [Radio](/components/radio)\n- [Radio group](/components/radio-group)\n","parent":{"relativeDirectory":"components","name":"checkbox-group"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/checkbox.mdx","frontmatter":{"title":"Checkbox"},"rawBody":"---\ntitle: Checkbox\ndescription: Checkbox is a form control for single and multiple selections.\nreactId: checkbox\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=15341%3A47574\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Usage\n\nUse checkboxes to allow users to select multiple items from a list of individual items, or to mark one individual item as selected.\n\n### States\n\nCheckboxes have static dimensions and three different states: rest (default), focus, and disabled.\n\n<img\n  width=\"960\"\n  alt=\"An image showing checkboxes with three different states, rest, focus, and disabled.\"\n  src=\"https://user-images.githubusercontent.com/586552/204882576-5b698ce7-c471-4f4e-9f33-c861842f5743.png\"\n/>\n\n### Selected states\n\nCheckboxes are capable of showing two forms of selection: checked (left) or indeterminate (right).\n\n<img\n  width=\"960\"\n  alt=\"An image showing checkboxes selected as checked and indeterminate\"\n  src=\"https://user-images.githubusercontent.com/586552/204883614-01743d25-1f7d-4261-b59d-8dd7ceaf29d3.png\"\n/>\n<Caption>The indeterminate state is colored in some browsers (e.g. Safari) and grey in others (e.g. Chrome).</Caption>\n\n### Best practices\n\n- An individual checkbox should not have its own validation message or style. Instead, show a validation message on the [checkbox group](/components/checkbox-group). For more information, see the [Validation Message](../ui-patterns/forms#validation) section in the Forms documentation.\n- An individual checkbox button cannot be marked as required. Instead, make a selection required using the [checkbox group](/components/checkbox-group). For more information, see the [Required field indicator](../ui-patterns/forms/#required-field-indicator) in the Forms documentation.\n\n## Related links\n\n- [Forms](../ui-patterns/forms)\n- [Form control](/components/form-control)\n- [Checkbox group](/components/checkbox-group)\n- [Radio](/components/radio)\n- [Radio group](/components/radio-group)\n","parent":{"relativeDirectory":"components","name":"checkbox"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/comment-box.mdx","frontmatter":{"title":"Comment box"},"rawBody":"---\ntitle: Comment box\nstatus: Experimental\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=17091%3A66640\ndescription: Comment box allows users to write and preview comments.\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Anatomy\n\n<img\n  width=\"960\"\n  alt=\"A diagram of a comment box with a heading, a tab nav, a toolbar and a textarea with a placeholder text.\"\n  src=\"https://user-images.githubusercontent.com/378023/197092931-b5207868-036b-4858-9fad-1195b2fd7604.png\"\n/>\n\n## Content\n\n### Heading (required)\n\nA heading is shown above the comment box to establish the context and inform users about the purpose of the textarea that follows. The default heading is \"Add a comment\".\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193514339-81bc5e18-3aab-4e15-919f-933fb5e74ef0.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Use a different heading depending on the context.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/218910346-21023ac1-b251-4272-b0a0-ceb4dfc97075.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>\n      Don't use the term \"Write\". This may create confusion when navigating between the comment box's heading and the \"Write/Preview\" tab nav.\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\nIt's recommended to *always* show a heading to give users a permanent description of the comment box. In case the design doesn't have room for a heading, the `sr-only` class may be added to visually hide the heading.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/193514612-a0bdb034-4047-4491-affa-e3e5fc10d455.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>When the heading needs to be visually hidden, use the placholder text instead.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/218910567-0f0f5377-4b72-40ef-b1e5-e6cafada7453.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Don't visually hide the heading and remove the placholder text.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Placeholder text (recommended)\n\nThe placeholder text is meant to give users addtional hints. Keep in mind that it will disappear as soon as users start typing. A placeholder text is not required, but can help suggest CommentBox features specific to a component implementation, such as slash commands. Having a placeholder text also helps with improving usablity and making sure users know where to start typing. The default placeholder text is \"Type your comment here...\".\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/195568002-a794f61a-e103-4350-97e7-7cb7fccb3a1e.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Use a different placeholder text depending on the context.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/378023/218911032-29096ec5-be0b-4e4b-8670-7c095fcc85bf.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Don't repeat the heading also as placeholder text.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Tab nav\n\nA tab nav is used to toggle between write and preview mode. In **write mode** the entered text is rendered as typed (plain text).\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/193514697-e96fdb90-15d1-4557-8216-1772698a0888.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\nWhen switching to **preview mode** the toolbar disappears and the text is rendered as HTML. Markdown formatting, autolinking and other features are supported as well.\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/191464912-fb6dcdb1-f3d7-4d0c-bfdd-e44fab9e6b57.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\n### Toolbar\n\nThe toolbar provides the comment box with shortcuts to...\n\n- format Markdown\n- @-mention users or reference issues and pull requests\n- insert saved replies\n- attach images and files\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/193514788-20ceac63-2229-41bf-ad5e-7e4cafb19bf9.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\nAdditional toolbar items can be added based on context. They appear at the beginning of the toolbar separated with a divider.\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/197093096-ea3a9f65-4dde-4636-a154-06b03add8788.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\n### Textarea\n\nA textarea is used to write the comment. While typing it will automatically resize to fit the content until a certain max height is reached. The textarea can also be manually resized by dragging the handle in the bottom right corner.\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/193514864-e0528816-7560-4fdd-b816-e076f74a9981.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\nThe default and minimum height is `100px`. For cases where users typically add a lot of content, like issues or pull request descriptions, the textarea can be configured to have an increased initial height:\n\n| Option            | value   |\n| ----------------- | ------- |\n| `small` (default) | `100px` |\n| `medium`          | `300px` |\n| `large`           | `500px` |\n\n## Messages\n\nA [flash alert](/ui-patterns/messaging#flash-alerts) is used to inform users about an event related to the comment box. Events include but are not limited to error or warning messages, uploading state or successful actions. The flash alert is shown undertneath the comment box.\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/191891077-fd523ae4-7bb0-495d-be15-afca2b194ac4.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\n## Responsive behavior\n\nThe comment box's toolbar uses an [action bar](/components/action-bar) under the hood that is responsive by default. Toolbar items that don't fit in the available space are moved to an [overflow menu](/components/action-bar#overflow-menu).\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/197094055-a68f5cb1-a0df-4e39-8803-32338d7829cc.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\nWhen the available space becomes narrow, the tab nav takes up full width and the toolbar moves to its own row underneath.\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/197094061-d073e3fe-9f82-4592-a04c-3d9bb9cb7e5e.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\n## Example usage\n\nA typical use of the comment box is at the bottom of a timeline or inline when replying to existing comments. Most often there is a cancel and a submit button at the bottom right of the comment box. Pro tips can also be shown to eductate users and help feature discovery.\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/197094065-ae2cdb9f-94a7-4703-a5b7-a9f4d5b224cf.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\n## Accessibility\n\n### Keyboard navigation\n\n| Key   | description                                                                                                          |\n| ----- | -------------------------------------------------------------------------------------------------------------------- |\n| `Tab` | Moves focus between the different parts of the comment box. The order is as follows: 1. tab nav 2. toolbar 3. textarea. |\n\n<img\n  src=\"https://user-images.githubusercontent.com/378023/193515190-f18d784f-43c2-4d9e-87c7-7c9ba4a08069.png\"\n  alt=\"\"\n  width=\"960\"\n/>\n\nNote that tab nav and toolbar ([action bar](/components/action-bar#keyboard-navigation)) have their own keyboard navigation.\n","parent":{"relativeDirectory":"components","name":"comment-box"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/counter-label.mdx","frontmatter":{"title":"Counter label"},"rawBody":"---\ntitle: Counter label\ndescription: Counter label is a button with a numbered label accompanied by text.\nreactId: counter_label\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=14919%3A49961\nrails: https://primer.style/view-components/components/beta/counter\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Usage\n\nUse counter label to add a count to navigational elements and buttons.\n\n<img\n  width=\"960\"\n  alt=\"A image showing two examples of buttons with counters\"\n  src=\"https://user-images.githubusercontent.com/586552/205141782-bfe137b1-6d83-4b9d-bcdd-bcd1877f864b.png\"\n/>\n\n## Accessibility\n\nAlways use counter label with adjacent text that provides supplementary information regarding what the count is for. For instance, Counter should be accompanied with text such as issues or pull requests.\n","parent":{"relativeDirectory":"components","name":"counter-label"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/data-table.mdx","frontmatter":{"title":"Data table"},"rawBody":"---\ntitle: Data table\nreactId: data_table\ndescription: Data table is a 2-dimensional data structure where each row is an item, and each column is a data point about the item.\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\nimport {Box, Heading} from '@primer/react'\n\n<Note>This component is not available in production yet</Note>\n\n## Anatomy\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361202-0f1735a7-0409-4c51-b095-1cdd0bc92bb3.png\"\n/>\n\n### Table header\n\nThe table header shows contextual information about the table and render controls that affect the table.\n\n- **Title:** A concise label that describes the table and its contents\n- **Subtitle:** A brief description to adds more context for the table when the title alone is not enough\n- **Actions:** Controls that affect the entire table\n- **Filter:** An input used to filter table data to make it easier for the user to focus only on the rows relevant to their task. Even though the filter affects the entire table, it's not considered an \"action\".\n\n### Column headers\n\nA very short label that describes the data in the column.\n\nColumn headers are buttons that sort rows by the column data in ascending or descending order. Sort functionality may be disabled on a column-by-column basis.\n\nThe column that contains row actions does not have a visible column header.\n\n### Row headers\n\nA row header identifies the item being represented in the row. They are typically the first cell in the row, and are visually distinct from the other cells in the row.\n\n### Row actions\n\nActions that affect the item represented in the row.\n\n### Data cells\n\nThe data for each row that is described by its corresponding column header and optional row header.\n\n### Pagination footer\n\nThe pagination footer shows the user where they are in relation to the total number of rows and provides controls for navigating all rows.\n\n## Usage\n\n### When to use a data table\n\n- To navigate a lot of information at once and to make it easy to compare data points between rows or columns\n- If the data is easy to understand when all data points are displayed in a flat hierarchy\n\n### When to use something else\n\n#### Use a list or something else\n\n- When there are columns where the cells will usually be empty\n- If the data is easier to understand with grouping and hierarchy (sections, headings, subheadings, etc.)\n- When rows and columns are only a means of layout\n- For data with longform content such as paragraphs or long lists\n\n#### Use a data grid\n\n- If the primary purpose is to edit or otherwise interact with the cells (like a spreadsheet)\n- If rows or columns support some kind of user interaction\n\n### Best practices\n\n<Box display=\"grid\" gridTemplateColumns={['', '', '', '', '18rem 1fr']} gridGap={[0, 0, 0, 0, 3]} sx={{'> h4': { margin: 0 }}}>\n\n#### Order rows intuitively\n\n<div>\n\nData should be initially rendered in an intuitive order. For example, starting with the most recently created items.\n\nBy default, sort alphabetically by the first column's content. Rows will be re-ordered as the user updates the sort\nparameters\n\n</div>\n\n#### Minimize the number of columns\n\nIt's easier to scan many rows than it is to scan many columns. Consider swapping columns and rows when it's unlikely that there will ever be more rows than columns.\n\n#### Adapt column widths when necessary\n\nUse the column width options to appropriately size the columns depending on the content and the available horizontal space.\n\n#### Keep column headers short\n\nColumn headers are short labels used to define the kind of data that is shown in that column.\n\n#### Keep cell content concise\n\nCells should represent data in the shortest possible format. This makes the table easier to scan, and preserves horizontal space.\n\n#### Don't use a single column to show multiple pieces of data\n\nThe column header should accurately represent the data point rendered in the column's cells. It would also be unclear which data point is being used when sorting.\n\n#### Make numbers easier to compare\n\nRight-align numeric values and use the `tabular-num` [font variant](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-numeric) when possible.\n\n#### Avoid wrapping or truncation of cell content as much as possible\n\n<div>\n\nIdeally, the cell content is very short and the column will be wide enough to accommodate its content. In cases where it's not possible to fit the content, you may wrap or truncate the content.\n\nCells that are likely to contain long strings may choose to wrap the content. This is the preferred way to accommodate long content because it doesn't hide the content.\n\nContent truncation is available as a last resort when column widths are set. The full content may be exposed in a tooltip.\n\n</div>\n\n#### By default, leave empty cells blank\n\nYou may show a message to explain an absence of data. Just don't use a character like “x” or “-”. It creates a weird experience for assistive technologies like screen readers.\n\n#### Use “skeleton” placeholders to indicate loading content\n\n<div>\n\nThe placeholder should match the real content as closely as possible.Use the following properties to adjust the size and alignment of the placeholder:\n\n- column width\n- alignment\n- whether or not there is a leading visual\n\nDon't worry about whether the text wraps. Ideally, the height of the cell will not change once the data is loaded. However, it wouldn't be possible to know how many lines of text the content wraps to.\n\n</div>\n\n#### Use pagination to accommodate tables with a large dataset\n\nBy paginating, the user can focus on segments of a large dataset without being overwhelmed. Pagination also helps with performance by reducing the amount of data to be downloaded and the amount of content that needs to be rendered.\n\n#### Don't put too many or too few rows per page\n\n<div>\n\nIf page length is too short, it would be annoying to browse the data in small segments. If page length is too long, users could get lost or overwhelmed.\n\nThe following factors influence what the ideal page length would be for your use-case:\n\n- Whether rows can be filtered\n- Number of columns\n- Visual complexity of the rendered cells\n- Amount of context needed when reviewing the data\n\nThese factors make it difficult to recommend an “ideal” page size for all use cases, but 20 rows is a good place to start.\n\n</div>\n\n#### Communicate when the table has no data to show\n\nShow a `Blankslate` component in place of the table\n\n#### Consider small screens\n\n<div>\n\nSome strategies for adapting the table for narrow viewports include:\n\n- Use the column width options\n- Remove less important columns\n- Scroll horizontally\n\n</div>\n\n</Box>\n\n### Do's and Don'ts\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/205361204-99082cdf-36d7-4248-9a77-0bf58ee7fae5.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Use a data table for data in a flat hierarchical structure\n    </Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/205361206-e066a62d-40dd-4956-aa69-e2766c3b7d0b.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Don't use a data table for information that has hierarchical relationships\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/205361208-4191728f-b130-4c44-b834-da7dc29abc81.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Restrict the data in a column to represent one type of data\n    </Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/205361210-dcd62746-c10e-40dc-ba6d-7b6c509693e3.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Don't group data in a column cell that isn't described by the column header\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/205361212-b35c07de-4f66-4dfb-b2ac-bffd01723879.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Leave the cell blank {`(preferred)`} or show text that explains the absence\n    </Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/205361213-5bf83f35-ec56-4aa4-807b-3687fbef6d0a.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Don't show a character, icon, or emoji to indicate a cell is empty\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/205361215-c7f15b31-bf91-49ec-8ee0-f85af5c86588.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Allow the title in the page header to act as a table title when appropriate\n    </Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/205361216-a10a8d67-5f04-4bf9-9b82-9ca851731698.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Don't repeat or rephrase the title in the page header as the table title\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\n## Options\n\n### Column widths\n\n<!-- TODO: apply a layout -->\n\n#### Grow (default)\n\nStretch to fill available space, and min width is the width of the widest cell in the column. This is the same behavior as a CSS grid column with the value `minmax(auto, 1fr)`\n\nMay have a min and max width constraint\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/2313998/205382519-b97666be-05bd-4449-a4d9-b924c3bbe70a.png\"\n  />\n\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/2313998/205361220-078f56f6-0681-4e64-bab3-7860f179d066.png\"\n  />\n</Box>\n\n#### Shrink\n\nStretch to fill available space in the parent **or shrink** to fit in the available space in the parent\n\nMay have a min and max width constraint\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/2313998/205361223-f9becdb3-64ca-44b2-a350-2d33e2b20b1f.png\"\n  />\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/2313998/205361225-fcd06af1-8087-429a-99fe-1cf3c98fa479.png\"\n  />\n</Box>\n\n#### Auto\n\nThe column is the width of its widest cell. Not intended for use with columns whose content length varies a lot because a layout shift will occur when the content changes.\n\nMay have a min and max width constraint\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/2313998/205361223-f9becdb3-64ca-44b2-a350-2d33e2b20b1f.png\"\n  />\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/2313998/205361224-f39ba3d5-feb4-464a-9059-2784bb91eec9.png\"\n  />\n</Box>\n\n#### Explicit width\n\nWill be exactly that width and will not grow or shrink to fill the parent\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205385940-7dca1d5d-b2ae-4faf-a656-5b2bbec7b85f.png\"\n/>\n\n#### Action column\n\nThe action column would not accept a width. Its min-width would be the width of the actions.\n\n#### Filling available space\n\nIf all columns have width constraints set and the row doesn't fill the table container, the difference is added to the width of the last column.\n\n### Cells\n\n<Box display=\"flex\" flexDirection=\"column\" sx={{gap: 3, 'h4': { margin: 0 }}}>\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box flex={1}>\n\n#### Density\n\nOptions:\n\n- **Condensed:** Optimize for showing more information in a smaller area.\n- **Normal (default):** Shows a lot of information in a small area, but provides enough whitespace that the cells won't risk visually running together.\n- **Spacious:** Optimizes readability for tables with visually busy cell content.\n\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361229-8f29b673-93d5-414a-8e77-aa7b74e3c4b1.png\"\n/>\n\n</Box>\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box flex={1}>\n\n#### Text alignment\n\n- **Left (default):** Matches natural reading direction of text in right-to-left writing systems.\n- **Right:** Optimizes for comparing column data that is easier to compare when it's right-aligned. Most commonly used for numeric data.\n\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361230-91f0dcb1-7b50-4df4-937f-76eaa7f12b36.png\"\n/>\n\n</Box>\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box flex={1}>\n\n#### Content fitting\n\n- Wrapping (default)\n- Single-line truncation\n- Multi-line truncation\n\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361233-640aadba-27d7-41ac-920f-16422d684873.png\"\n/>\n\n</Box>\n</Box>\n\n### Row actions cell options\n\n<!-- TODO: apply a layout -->\n\n<Box display=\"flex\" flexDirection=\"column\" sx={{gap: 3, 'h4': { margin: 0 }}}>\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box flex={1}>\n\n#### 1 action\n\nRow actions are placed in the last column, and they don't require a visible column header\n\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361234-183d525d-d23d-4e6a-85d7-b0a816c5215f.png\"\n/>\n\n</Box>\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box flex={1}>\n\n#### Multiple actions\n\nIf you have multiple actions for a row, start by pulling them into a dropdown menu.\n\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361236-f200108e-6fa2-4c38-b0eb-fa2f695c5e15.png\"\n/>\n\n</Box>\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box flex={1}>\n\n#### 1 primary action, other actions in an overflow\n\nIf one of the actions is heavily used, pull it out for easier access. Do not pull out more than 1 action.\n\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361238-f5219090-dd2f-4c6c-a9ab-6bab8b43d74c.png\"\n/>\n\n</Box>\n</Box>\n\n## Interactions\n\n### Sorting\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box as=\"p\" flex={1}>\n  If a table is sortable, it must start with one column sorted on page load. Interacting with a column that is already\n  sorted will toggle the sort between ascending and descending. If a column is not sorted yet, the first click sorts in\n  ascending order.\n</Box>\n\n<CustomVideoPlayer\n  width=\"456\"\n  loop\n  src=\"https://user-images.githubusercontent.com/2313998/217949039-8d6a3062-e7ec-40f6-b6d9-b80494a7e89b.mp4\"\n/>\n</Box>\n\n#### States\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box as=\"ul\" flex={1}>\n  <li>Unsorted (default)</li>\n  <li>Ascending sort active</li>\n  <li>Descending sort active</li>\n  <li>Sort in progress</li>\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361240-85add374-1599-48bf-b6f0-c8e958fbd2dc.png\"\n/>\n</Box>\n\n### Filtering\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box as=\"p\" flex={1}>\n\nA [filter input](/components/filter-input) is used to write a query and only show rows that\nmatch that query.\n\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/207115488-96f5b4c6-b870-4fca-b049-9d7574eb48ca.png\"\n/>\n</Box>\n\n## Accessibility\n\n### Labeling and describing the table\n\nThe table must have a title, and can optionally have a subtitle to describe more context. If you encounter a case where there is enough context that the table doesn’t need a visible label, you may hide it so it’s only accessible to assistive technologies.\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} mb={3} sx={{gap: 3}}>\n\n<Box as=\"p\" flex={1}>\n  If you use the table header, the table's title and subtitle will automatically be associated with the table for\n  assistive technologies.\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361243-62d0b497-a4ba-44b5-8e3e-258cdd6e53e1.png\"\n/>\n</Box>\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box as=\"p\" flex={1}>\n  If your table's title exists somewhere else on the page (for example, in the PageHeader), then you must manually\n  associate that contextual information with the table using ARIA.\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361244-8a1f527a-e1f3-45a3-ab13-5fdf82476038.png\"\n/>\n</Box>\n\n### Labeling actions\n\n<Box display=\"flex\" flexDirection=\"column\" sx={{gap: 3}}>\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box as=\"p\" flex={1}>\n  The row header string will be prepended to the ARIA text of action buttons. For examples, Download {`{row header}`}“,\n  “Actions:{`{row header}`}”\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361247-dfea530d-9989-442b-8a50-9c66aa5d3733.png\"\n/>\n</Box>\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box as=\"p\" flex={1}>\n  To handle cases where the row header can be very long, we should give consumers the option to specify a shorter string\n  to identify the rows. For example, if an issue title is used as the row header, we could use the issue number instead\n  of the full issue title.\n</Box>\n\n<img\n  width=\"456\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/205361249-763772e1-d856-479e-a632-d185c27095db.png\"\n/>\n</Box>\n</Box>\n\n## Related components and patterns\n\n- [ActionBar](/components/action-bar)\n- [Pagination (React implementatiopn)](https://primer.style/react/Pagination)\n","parent":{"relativeDirectory":"components","name":"data-table"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/details.mdx","frontmatter":{"title":"Details"},"rawBody":"---\ntitle: Details\ndescription: Details is a styled component to enhance the native behaviors of the <details> element.\nreactId: details\nrails: https://primer.style/view-components/components/beta/details\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\nimport {Box, Text} from '@primer/react'\n\n## Usage\n\nThe details component can reveal additional information by using a button to toggle between hidden and visible. It includes a summary followed by the content that's hidden or visible.\n\nBy default, the information is hidden. When triggered, it expands and displays the information.\n","parent":{"relativeDirectory":"components","name":"details"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/dialog.mdx","frontmatter":{"title":"Dialog"},"rawBody":"---\ntitle: Dialog\ndescription:\n  Dialog is a floating surface used to display transient content such as confirmation actions, selection options, and\n  more.\nreactId: dialog\nrails: https://primer.style/view-components/components/alpha/dialog\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\nimport {Box} from '@primer/react'\nimport {Caption} from '@primer/gatsby-theme-doctocat'\n\nDialogs can streamline the interface by allowing extra content to be disclosed as needed. Dialogs create a new modality to the user, and can expedite the completion of individual tasks.\n\n## Anatomy\n\n<img\n  width=\"960\"\n  alt=\"\"\n  src=\"https://user-images.githubusercontent.com/18661030/185509649-50791e2f-0a4c-44d9-8b2b-e34b3f394315.png\"\n/>\n<Caption>Anatomy of a Dialog.</Caption>\n\n### Header region\n\nThe **header** region provides context for the Dialog. By default, the region supports a title, description, and a close button. Titles and descriptions may wrap to multiple lines if necessary.\n\nThe title is required for all Dialogs, but may be visually hidden for custom scenarios such as a command palette. The close button is required and may **not** be visually hidden. The title has a default size along with a larger option for confirmation dialogs.\n\nThe header region provides a slot for custom content in place of the default title/description, though a title is still required and may be visually hidden. Secondary action icon buttons may be placed next to the close button.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5} marginBottom={5}>\n  <div>\n    <img\n      width=\"464\"\n      src=\"https://user-images.githubusercontent.com/293280/175849372-a9d33d3b-96f3-497e-bad6-70df4d91072a.png\"\n      alt=\"\"\n    />\n    <Caption>Header with the default title variant.</Caption>\n  </div>\n  <div>\n    <img\n      width=\"464\"\n      src=\"https://user-images.githubusercontent.com/293280/175849374-6a71d8a0-da61-4745-a059-4560d053089b.png\"\n      alt=\"\"\n    />\n    <Caption>Header with large title variant.</Caption>\n  </div>\n</Box>\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <div>\n    <img\n      width=\"464\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/185478040-be5a3552-9ed1-40ef-a713-3d6ac8f6b697.png\"\n    />\n    <Caption>Header with custom variant and a secondary action button.</Caption>\n  </div>\n  <div>\n    <img\n      width=\"464\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/185990665-5cf39b59-420a-41bf-8d65-d431134d2738.png\"\n    />\n    <Caption>Command palette with a visually hidden title.</Caption>\n  </div>\n</Box>\n\n### Subheader region\n\nThe subheader region is an optional space for interactive controls. Use it to display a search field, a filter menu, or a local navigation component.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/293280/175849377-ef70f4e7-2978-415c-9da1-a2ba2f33bdc3.png\"\n      alt=\"\"\n    />\n    <Caption>Header displaying a subheader with a search field.</Caption>\n  </div>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/293280/175849376-ef25a1ba-b5b7-4ae0-8d9a-78095932886a.png\"\n      alt=\"\"\n    />\n    <Caption>Header displaying a subheader with a local navigation.</Caption>\n  </div>\n</Box>\n\n### Body region\n\nThe body region is the main content of the dialog. It can contain any content that is relevant to the task at hand. The body region is scrollable if the content exceeds the height of the dialog.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <div>\n    <img\n      width=\"650\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/185506131-1436b06b-a8fb-4de8-b9b2-4715ab0a63d2.png\"\n    />\n    <Caption>Body content will scroll vertically if the content exceeds the overall dialog height.</Caption>\n  </div>\n  <div>\n    <img\n      width=\"650\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/187487429-bef6924c-9f25-4ec9-9416-5800396a7b32.png\"\n    />\n    <Caption>The body may contain additional content such as banners and form controls.</Caption>\n  </div>\n</Box>\n\n### Footer region\n\nThe footer region may be used to show confirmation actions, navigation links, or specialized actions. Primary actions should be aligned to the right of the footer, and grouped by additional related actions. Secondary actions may be shown aligned to the left side.\n\nIf the content area has overflow scrolling, a divider should be added between the footer and content area. Otherwise, showing a divider is optional.\n\n<img\n  src=\"https://user-images.githubusercontent.com/293280/175850630-9f3df284-c69b-4d16-9e57-ea04a0202d04.png\"\n  width=\"960\"\n  alt=\"\"\n/>\n<Caption>Use buttons in a footer to let the user complete a task.</Caption>\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/293280/175850639-a77d537e-2807-47d2-b456-a298d5f44918.png\"\n      alt=\"\"\n    />\n    <Caption>Footer with small buttons aligned to the right.</Caption>\n  </div>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/293280/175850637-3b193552-b35f-4b07-b2d6-4ca546c8131a.png\"\n      alt=\"\"\n    />\n    <Caption>Footer with an auxiliary action aligned to the left.</Caption>\n  </div>\n</Box>\n\n### Backdrop\n\nDialog displays with a **backdrop**, which dims the rest of the page. The backdrop is visible when the dialog is centered on the page, or attached to a side as a sheet.\n\nBy default, clicking on the **backdrop** will dismiss the dialog. However, if the dialog contains a form that can have unsaved changes, the **backdrop** won't dismiss the dialog, regardless of the state of the form.\n\n### Spacing\n\nThe edges of dialog are free of text and heavy visuals to visually distinguish the dialog as an elevated surface, alongside its shadow. Content within the body and header should remain within the 16px safe area. However, inner components that have transparent or discrete backgrounds may bleed into the padding for visual alignment.\n\n<img\n  alt=\"\"\n  src=\"https://user-images.githubusercontent.com/293280/174925634-603a27cf-2281-4a3a-9078-d1b8138e0d09.png\"\n  width=\"960\"\n/>\n<Caption>\n  1. A search field in the Subheader region appears closer to the edges. While the search icon remains within the safe\n  area.\n  <br />\n  2. Close button placed `8px` away from the edges. Note that the \"×\" glyph remains within the safe area.\n  <br />\n  3. Action list items in the Body region.\n  <br />\n  4. Footer buttons always appear inside the safe area. <br />\n</Caption>\n\n## Size\n\nDialog offers a range of sizes from `small` to `xlarge`, with the default size set to `medium`.\n\nEach size defines a width and a maximum height. By default the dialog height will adjust to the body content. If the maximum height is reached, the body contents will scroll.\n\nA dialog sizing is constrained by the viewport dimensions. Dialogs will not grow beyond the boundaries of the viewport.\n\nSmall viewports force dialogs to remain small. All dialogs need to work on viewports of at least `320px` of width, and `256px` of height.\n\n### Small\n\n<img\n  width=\"1292\"\n  alt=\"\"\n  src=\"https://user-images.githubusercontent.com/18661030/187552557-452e7253-9fdc-4f58-8ad7-9cd016d7786e.png\"\n/>\n<Caption>Small dialogs have a width of 320px, and a max height of 256px.</Caption>\n\n### Medium (default)\n\nMedium is the default size for Dialog and should be used for most tasks such as completing a form or selecting an option from a list. The medium portrait size is suitable for longer lists of items that require more vertical space for the body.\n\n<img\n  width=\"1292\"\n  alt=\"\"\n  src=\"https://user-images.githubusercontent.com/18661030/187552600-06dcbd81-90b5-45aa-81ce-89f8d9763508.png\"\n/>\n<Caption>\n  Medium dialogs have a width of 480px, and a max height of 320px. Medium portrait oriented Dialogs have a width of\n  480px, and a max height of 600px.\n</Caption>\n\n### Large\n\nLarge dialogs are suitable for content that requires more horizontal space for the body compared to size medium, such as a comment box.\n\n<img\n  width=\"1292\"\n  alt=\"\"\n  src=\"https://user-images.githubusercontent.com/18661030/187482693-04eb3780-89e1-4705-a55b-5fa8ba0f9865.png\"\n/>\n<Caption>Large dialogs have a width of 640px, and a max height of 432px.</Caption>\n\n### Extra large\n\nBefore using an extra large dialog, consider whether or not the content would be more appropriate for a new page.\n\n<img\n  width=\"1292\"\n  alt=\"\"\n  src=\"https://user-images.githubusercontent.com/18661030/187482817-9d82fe3e-c24d-4eca-9b4b-c74fa32450d4.png\"\n/>\n<Caption>Extra large dialogs have a width of 960px, and a max height of 600px.</Caption>\n\n## Usage\n\n### Keep content simple\n\nDialogs are meant to be interacted with in a single context. Avoid creating a whole page inside a dialog. Prefer single-column layouts that convey a clear goal from the moment the dialog is opened.\n\nHowever, dialogs are powerful tools when creating space for single-context interfaces. When designing a new feature to support a main interface, start by considering if the new feature can be created under a single context.\n\nIf the answer is yes, designing the feature inside a dialog provides an easy way to add responsive support, and avoid deeper navigations. If the answer is no, or if a side navigation is required for the feature, consider designing a new page.\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"464\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/185224257-a40112ff-aaf3-4947-acf0-6b4020e023df.png\"\n    />\n    <Caption>Prefer a single column layout.</Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"464\"\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/18661030/185224316-0680b89a-8514-4336-9147-64aac722cd9a.png\"\n    />\n    <Caption>Avoid side navigation within a Dialog.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Dialogs should work well on any device\n\nDialogs must adjust their designs to fit in smaller viewports. Make sure the overlay contents work with all supported sizes and input methods.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <div>\n    <CustomVideoPlayer\n      width=\"100%\"\n      src=\"https://user-images.githubusercontent.com/18661030/185507523-74e0acff-6980-439e-84c5-422b16470c9e.mp4\"\n    />\n    <Caption>Center aligned dialog becomes fullscreen on narrow viewport.</Caption>\n  </div>\n  <div>\n    <CustomVideoPlayer\n      width=\"100%\"\n      src=\"https://user-images.githubusercontent.com/18661030/185507508-298f9378-3f26-4e45-9809-5aef3d8cd3e2.mp4\"\n    />\n    <Caption>Center aligned dialog becomes a bottom sheet on narrow viewport.</Caption>\n  </div>\n</Box>\n\n## Regular-viewport placement\n\n### Centered\n\nBy default, dialog appears centered in the viewport, with a visible backdrop that dims the rest of the window for focus. Centered dialogs are surrounded by a safe area of `16px` between the frame and the viewport for all sizes.\n\n<img\n  width=\"960\"\n  alt=\"\"\n  src=\"https://user-images.githubusercontent.com/18661030/185224429-9f0af3ee-3e11-4f94-a5f6-746ed8a5c300.png\"\n/>\n<Caption>Dialog centered within a desktop screen.</Caption>\n\n### Side sheets\n\nSide sheets slide from the right or left edges of the viewport. **Left side sheets are reserved for global navigation drawers. Right side sheets are used for global actions, but can also be considered for quick previews in full-width pages, or configuration panels.**\n\nSide sheets take the entire height of the viewport, and should be used sparingly. Don't use side sheets to present create/edit forms, or flows that may contain a lot of information. For that, use a page instead.\n\n<img\n  width=\"960\"\n  alt=\"placement-desktop-1\"\n  src=\"https://user-images.githubusercontent.com/18661030/185214096-8ad908b4-2cbd-467d-8e74-bad6948c5a2d.png\"\n/>\n<Caption>Left aligned side sheet is reserved for global navigation only.</Caption>\n\n<img\n  width=\"960\"\n  alt=\"placement-desktop-2\"\n  src=\"https://user-images.githubusercontent.com/18661030/185214094-419d2271-dbb9-4e78-90e6-4433ed9c42fb.png\"\n/>\n<Caption>\n  Right aligned side sheet can be used for global actions, but may also be considered for quick previews or\n  configuration panels.\n</Caption>\n\n## Narrow-viewport placement\n\n### Bottom sheets\n\nA bottom sheet is a variant supported on narrow viewports made to facilitate reachability. dialogs that appear centered in large screens may adapt to appear as a bottom sheet on small screens.\n\nA bottom sheet always dims the rest of the screen for focus and takes up the full width of the viewport. Tapping on the backdrop dismisses the dialog.\n\nUse a bottom to indicate that the user is still in the context of the main page, and that the dialog is a secondary action.\n\n<img\n  width=\"960\"\n  alt=\"bottom-sheet\"\n  src=\"https://user-images.githubusercontent.com/18661030/185214084-43e9573a-1a3b-4b82-b121-bd03897f48ac.png\"\n/>\n<Caption>Bottom sheet in portrait mode.</Caption>\n\nIn landscape mode, a bottom sheet has a maximum width of `480px`, and is centered horizontally.\n\n<img\n  width=\"960\"\n  alt=\"overlay-sheet-landscape\"\n  src=\"https://user-images.githubusercontent.com/18661030/185214089-a1bb1a70-914b-4a8f-b395-9c279a88a1fe.png\"\n/>\n<Caption>Bottom sheet in landscape mode.</Caption>\n\n### Full-screen\n\nFull-screen dialogs may be used to present content that needs all the available space on narrow viewports, or to act as a new page without navigating away from the main page. Dialogs that have one or more input fields should always use the full-screen variant.\n\n<img\n  width=\"960\"\n  alt=\"\"\n  src=\"https://user-images.githubusercontent.com/18661030/185214079-d30342c1-6061-4a31-ab65-c0cef0f00278.png\"\n/>\n<Caption>Full-screen Dialog in portrait mode.</Caption>\n\n## Accessibility\n\nDialog's title and close button are required to ensure an accessible experience for everyone. Further, keyboard and focus behavior must be considered.\n\n### Trigger elements and keyboard focus\n\nDialogs are initially hidden, and can be opened by an element with `role=\"button\"`, called a **trigger**. The role `button` allows the **trigger** to be a relatively complex element, such as an action list item.\n\nDialogs must be fully functional using the keyboard and assistive technology. Pressing `Esc` must dismiss a dialog, also returning focus to the **trigger** that opened it.\n\n<CustomVideoPlayer\n  width=\"100%\"\n  loop\n  src=\"https://user-images.githubusercontent.com/18661030/185507547-0843b014-0b90-48f5-9e4f-746caa42b4e6.mp4\"\n/>\n<Caption>Clicking the backdrop or hitting the `Esc` key should dismiss the dialog.</Caption>\n\nWhen a dialog is opened, the first interactive element (typically the close button) is focused. For a scenario like a command palette with an `<input>` next to the close button, the `<input>` will recieve focus first. Hitting `Tab` will cycle through all interactive elements within the dialog. To escape the focus trap, hitting the `Esc` key or clicking on the backdrop will close the dialog. While the dialog is open, page scrolling is disabled and becomes `inert`.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5} marginBottom={5}>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/18661030/185997280-fb36be9c-bfde-463b-b33c-9f25412683d2.png\"\n      alt=\"\"\n    />\n    <Caption>Dialogs can be triggered by buttons with a mouse click or keypress.</Caption>\n  </div>\n  <div>\n    <img\n      src=\"https://user-images.githubusercontent.com/18661030/185997278-6fc2b938-6453-47d7-99ae-0411354eb06e.png\"\n      alt=\"\"\n    />\n    <Caption>The first interactive item inside a dialog is focused when opened.</Caption>\n  </div>\n</Box>\n\n<img\n  width=\"960\"\n  alt=\"\"\n  src=\"https://user-images.githubusercontent.com/18661030/185997276-25cd8796-42e2-41f6-b5be-551f6a02349b.png\"\n/>\n<Caption>When a dialog is closed, focus is returned to the trigger button.</Caption>\n","parent":{"relativeDirectory":"components","name":"dialog"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/filter-input.mdx","frontmatter":{"title":"Filter input"},"rawBody":"---\ntitle: Filter input\nstatus: Experimental\ndescription: Filter input is an input that provides suggestions through qualifiers and highlights complex filter syntax.\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=1927%3A0\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<Note>\n  This component is not available in production yet however multiple teams are currently contributing to this.\n</Note>\n\n## Overview\n\nAn input that provides suggestions through qualifiers and highlights complex filter syntax.\n\n## Anatomy\n\n<img\n  width=\"960\"\n  alt=\"The filter input annotated with specific naming for individual items. The input has a 'label:bug state:open assignee:' value and shows multiple suggestions for users.\"\n  src=\"https://user-images.githubusercontent.com/980622/207303787-02ef7089-d3c5-4135-bdca-d83eccd032f4.png\"\n/>\n\n## Content\n\n### Icon\n\nA filter input allows free form text searching as well as using qualifiers to narrow down your search.\nThe filter input always supports free form text search. This is why you should use the search icon as a leading visual. A filter icon could give the impression that free form text search isn't available.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/204516414-4e6e00ba-38f7-49e5-8a80-9e3bc91ccd97.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input that has a magnifying glass icon on the left side.\"\n    />\n    <Caption>Use the search icon in a filter input.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/204516427-75b0a18d-9f61-4541-931c-ba0e8175fa07.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input that has a filter icon on the left side which consists of 3 lines getting incrementally smaller.\"\n    />\n    <Caption>Don't use a filter icon in a filter input.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Submit\n\nThere are two ways this component can trigger submission of the input value.\n\n1. Auto update results as the value changes (recommended)\n2. Provide a search button next to the filter input\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/208663121-13da38c6-a38a-4b83-b8a0-ae72fd6ca803.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A focused filter input with value 'label:bug state:open abc' indicating that when it should instantly filter results on the page and debounce this if using API calls.\"\n    />\n    <Caption>Auto update results based on when the input value changes.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/208663115-a8ed1b8e-e2f9-4ce4-9fdd-7ffaa639e447.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A focused filter input with value 'label:bug state:open abc' suggesting a `Submit/Start search` item.\"\n    />\n    <Caption>Don't add an item to submit the current value.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Clear button\n\nThe clear button only appears when there is at least one character entered in the input. When the input is empty the clear button disappears again.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/204872106-ff9e6eb7-dc9a-421a-a82e-4a3df9115795.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input without a value.\"\n    />\n    <Caption>Hide the clear button when the input is empty.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/204872101-33720780-4f9a-4141-bffc-4d008dde755e.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input without a value showing a clear button on the right.\"\n    />\n    <Caption>Don't show the clear button when the input is empty.</Caption>\n  </Dont>\n</DoDontContainer>\n\nUse an icon instead of a link for clearing the input. This avoids confusion with the value of the input. Especially when the input has a long value that gets close to the clear button a link could be problematic.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/206299392-9399c13b-ee1c-4bc9-9c9c-d177fb76a06b.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input with a value must shows a clear button on the right.\"\n    />\n    <Caption>Use a circular clear button with an x icon to clear the input.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/206299390-808585c6-8d78-4dc6-949b-7aa20cccc4c4.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input without a value incorrectly showing a 'clear' link on the right.\"\n    />\n    <Caption>Don't use a link for clearing as this could be confused with the text inside the input.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Avoid duplication\n\nWhen introducing custom qualifiers it's important to avoid repetitive icons or descriptions to increase readability and reduce noise for screen readers.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/208691915-5bc8d7a7-c706-42a9-a7db-b80d25696ca6.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input with a value 'pinned:' suggesting 'Application', 'Form submissions', 'Performance', 'Feature requests', 'Large data sets' and 'Issues'. None of the items has an icon or additional descriptions.\"\n    />\n    <Caption>\n      An input with a value 'pinned:' suggesting 'Application', 'Form submissions', 'Performance', 'Feature requests',\n      'Large data sets' and 'Issues'. All items include a pin board icon and a `Pinned` description.\n    </Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/208691913-0d95c706-13fe-4ef9-b730-7a70c9991fcb.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input without a value incorrectly showing a 'clear' link on the right.\"\n    />\n    <Caption>Don't repeat icons or descriptions that add no additional value.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Sorting\n\nThere are two different states that should be considered when providing suggestions:\n\n1. **Default**: You've entered a matching qualifier and get default suggestions. For example: `author:`.\n2. **Narrow down**: You've entered a value after your qualifier to narrow down the suggestions. For example: `author:max`\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/207305358-37b63ef8-f85a-4616-8c1c-9bc8b077b42f.png\"\n  role=\"presentation\"\n  width=\"960\"\n  alt=\"Two examples of the filter input. One has the value `author:` and is suggesting a few users to pick from. The other one has the value `author:max` and is suggesting a few users with `max` in their name or username.\"\n/>\n\nWe should always strive to provide as relevant results as possible when dealing with `user`, `organization`, `repository`, `issue`, `pull request` items. This can be done through a mix of considerations:\n\n1. Objects you've interacted with\n2. Organizations you're part of and it's members\n3. Repositories you're part of and it's members\n4. [Approximate string matching](https://en.wikipedia.org/wiki/Approximate_string_matching) (fuzzy)\n\nLet's take the `author:` as an example. While in the `default` state we aren't searching through the authors and want to provide a default list with users.\nIt's crucial we make the suggestions as relevant as possible therefore we rank them based on how often/recently you've interacted with them.\n\nOnce we start narrowing down those results by using `author:max` we enter the `narrow down` state and apply _approximate string matching_ on those suggestions. In this case we still rank users that I've recently interacted with or that are part of my organization/repositories higher.\n\nNot all our infrastructure supports this logic yet. If not available we fall back on alphabetical ordering.\n\nFor static items that only return a handful of suggestions we often can just order items through common sense:\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/207307327-b31cef7a-39cc-4d18-a801-033746d710ef.png\"\n  role=\"presentation\"\n  width=\"960\"\n  alt=\"Two example of qualifiers that return static data. The 'created' qualifier suggests: 'Today', 'This week', 'This month', 'Oct 19, 2007', 'Before June 4, 2018' and 'After June 4, 2018'. The 'stars' qualifier suggests: 'More than 10', 'Less than 10', 'Between 10 and 100' and '100'\"\n/>\n\n## Qualifiers\n\nThe filter input comes with a list of predefined qualifiers and prestyled suggestions. This ensures everyone aligns on the same qualifiers as well as on the styling of suggestions.\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/207306454-20315d1b-74c3-4188-a854-5c62bb955886.png\"\n  role=\"presentation\"\n  alt=\"Multiple examples of qualifiers and the suggestions they provide. Qualifiers 'language', 'author' and 'state' are used as examples.\"\n  width=\"960\"\n/>\n\nEven though custom qualifiers can be added it's important to check if your new qualifier could fit in one of the predefined qualifiers below.\n\n| Icon                                                                              | Qualifier         | Origin | Suggestions                                                                                                      | Format                                                                                                | Preview                                                                                                     |\n| --------------------------------------------------------------------------------- | ----------------- | ------ | ---------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |\n| [person](https://primer.style/octicons/person-16)                                 | `assignee`        | api    | `avatar`, `username` and `Full Name`                                                                             | `username`                                                                                            | [View](https://user-images.githubusercontent.com/980622/207335821-6dcb45dc-1b79-4270-8a78-825acadce8f0.png) |\n| [person](https://primer.style/octicons/person-16)                                 | `author`          | api    | `avatar`, `username` and `Full Name`                                                                             | `username`                                                                                            | [View](https://user-images.githubusercontent.com/980622/207335836-1f7766cd-acc6-41c5-921e-9764357d2589.png) |\n| [calendar](https://primer.style/octicons/calendar-16)                             | `created`         | static | `Today`, `Yesterday`, `Last 7 days`, `Last 30 days`, `Oct 19, 2007`, `Before June 4, 2018`, `After June 4, 2018` | `@today`, `@today-1d`,`@today-1w`,`>@today-1m`, `>YYYY-MM-DD`, `YYYY-MM-DD`, `YYYY-MM-DD..YYYY-MM-DD` | [View](https://user-images.githubusercontent.com/980622/207335851-a5f464cc-2e70-4050-8e48-82f71c837389.png) |\n| [repo-forked](https://primer.style/octicons/repo-forked-16)                       | `fork`            | static | `Yes`, `No`                                                                                                      | `true`, `false`                                                                                       | [View](https://user-images.githubusercontent.com/980622/207335873-2f6e8519-c2cf-41fb-8560-572c2ee660e2.png) |\n| [apps](https://primer.style/octicons/apps-16)                                     | `is`              | static | `Action`, `Code`, `Command`, `Commit`...                                                                         | `name`                                                                                                | [View](https://user-images.githubusercontent.com/980622/207335878-9877e103-c235-4e03-a306-12cbc4e77f35.png) |\n| [tag](https://primer.style/octicons/tag-16)                                       | `label`           | api    | `Title`, `Description` and `color`.                                                                              | `title`                                                                                               | [View](https://user-images.githubusercontent.com/980622/207335883-08f7a9ba-5529-4486-9c24-da8debf562b2.png) |\n| [code](https://primer.style/octicons/code-16)                                     | `language`        | static | `C`, `C##`, `C++`, `CoffeeScript`...                                                                             | `language`                                                                                            | [View](https://user-images.githubusercontent.com/980622/207335891-e63e53e9-b30c-4636-91d2-b9eba239a223.png) |\n| [globe](https://primer.style/octicons/globe-16)                                   | `location`        | static | `Amsterdam, Netherlands`, `Bern, Switzerland`...                                                                 | `\"Amsterdam, Netherlands\"`                                                                            | [View](https://user-images.githubusercontent.com/980622/207335903-928f9bc7-4772-4166-8a83-8d62a60ff48f.png) |\n| [file-badge](https://primer.style/octicons/file-badge-16)                         | `license`         | static | `BSD Zero Clause License`, `Academic Free License v3.0`...                                                       | `cc0-1.0`                                                                                             | [View](https://user-images.githubusercontent.com/980622/207335897-9311c884-0c66-4d10-81b0-a7111405444b.png) |\n| [mention](https://primer.style/octicons/mention-16)                               | `mentions`        | api    | `avatar`, `username` and `Full Name`.                                                                            | `username`                                                                                            | [View](https://user-images.githubusercontent.com/980622/207335907-b58c2ae4-59bf-4594-abca-c85f838b1f3d.png) |\n| [organization](https://primer.style/octicons/organization-16)                     | `org`             | api    | `avatar`, `username` and `Full Name`                                                                             | `username`                                                                                            | [View](https://user-images.githubusercontent.com/980622/207335912-324815e0-eed5-492d-ad69-e070e6d2ffb7.png) |\n| [repo](https://primer.style/octicons/repo-16)                                     | `repo`            | api    | `avatar`, `username/repo-name`                                                                                   | `username/repo-name`                                                                                  | [View](https://user-images.githubusercontent.com/980622/207335923-f63517ed-eda2-4ed8-a434-7ff25a123d54.png) |\n| [file-directory](https://primer.style/octicons/file-directory-16)                 | `path`            | api    | `path`                                                                                                           | `path`                                                                                                | [View](https://user-images.githubusercontent.com/980622/207335918-83e9b028-e7f5-48e1-99b0-b68ac7c12d85.png) |\n| [issue-draft](https://primer.style/octicons/issue-draft-16)                       | `state` (generic) | static | `open`, `merged`, `closed`, `draft`                                                                              | `open`                                                                                                | [View](https://user-images.githubusercontent.com/980622/207335939-ec2d1c4c-e564-4509-93ca-a4ba05b5c167.png) |\n| [git-pull-request-draft](https://primer.style/octicons/git-pull-request-draft-16) | `state` (pr)      | static | `open`, `merged`, `closed`, `draft`                                                                              | `open`                                                                                                | [View](https://user-images.githubusercontent.com/980622/207335949-e65f3708-65eb-4087-a8f4-c657a0bcd5d6.png) |\n| [issue-draft](https://primer.style/octicons/issue-draft-16)                       | `state` (issue)   | static | `open`, `closed`, `draft`                                                                                        | `open`                                                                                                | [View](https://user-images.githubusercontent.com/980622/207335944-80089848-ffc4-4fbc-8d6b-ed7b00d11fab.png) |\n| [comment-discussion](https://primer.style/octicons/comment-discussion-16)         | `comments`        | static | `More than 10`, `Less than 10`, `Between 10 and 100`, `100`,                                                     | `>100`, `10..100`, `100`                                                                              | [View](https://user-images.githubusercontent.com/980622/207335844-4b89c9db-1add-4b39-951d-5bee28c2b2d6.png) |\n| [people](https://primer.style/octicons/people-16)                                 | `followers`       | static | `More than 10`, `Less than 10`, `Between 10 and 100`, `100`                                                      | `>100`, `10..100`, `100`                                                                              | [View](https://user-images.githubusercontent.com/980622/207335866-81c6cfc6-e619-4624-8fbd-f09d92373b0a.png) |\n| [star](https://primer.style/octicons/star-16)                                     | `stars`           | static | `More than 10`, `Less than 10`, `Between 10 and 100`, `100`                                                      | `>100`, `10..100`, `100`                                                                              | [View](https://user-images.githubusercontent.com/980622/207335933-795de5c6-8bb6-414a-bf83-4e34aaa08972.png) |\n| [calendar](https://primer.style/octicons/calendar-16)                             | `updated`         | static | `Today`, `Yesterday`, `Last 7 days`, `Last 30 days`, `Oct 19, 2007`, `Before June 4, 2018`, `After June 4, 2018` | `@today`, `@today-1d`,`@today-1w`,`>@today-1m`, `>YYYY-MM-DD`, `YYYY-MM-DD`, `YYYY-MM-DD..YYYY-MM-DD` | [View](https://user-images.githubusercontent.com/980622/207335954-d669b842-5437-47d3-8589-a3ed67b834c4.png) |\n| [file-code](https://primer.style/octicons/file-code-16)                           | `extension`       | static | `md, Markdown`, `json, JavaScript Object Notation`...                                                            | `md`                                                                                                  | [View](https://user-images.githubusercontent.com/980622/207335860-7237c64b-f159-4c25-9591-0bbaae7dde51.png) |\n| [people](https://primer.style/octicons/people-16)                                 | `team`            | api    | `avatars`, `name` and `total members`                                                                            | `name`                                                                                                | [View](https://user-images.githubusercontent.com/980622/207593729-5f39a33f-277a-4329-bfc1-d75f63bba34e.png) |\n\n⚠️ This list will change a lot over the next month to accomodate different teams.\n\n### Generics\n\nThe `state:` qualifier has multiple variants to improve the experience for specific items:\n\n- `state`: For both pull requests and issues (no icons)\n- `state-pr`: For only pull requests (with icons)\n- `state-issue`: For only issues (with icons)\n\nTherefore it's important to use the correct qualifier as soon as you can determine if you're filtering to pull requests or issues.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/207307872-9c518626-32f4-46cf-afc8-7b0518fe5e6a.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input with value 'is:pr state:' showing suggestions with colored icons: 'Open', 'Merged', 'Closed' and 'Draft'\"\n    />\n    <Caption>Use the `state-pr` variant when filtering pull requests.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/207307868-b3d78303-3ba0-4d3d-ade4-dd893d9065a7.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input with value 'is:pr state:' showing suggestions without icons: 'Open', 'Merged', 'Closed' and 'Draft'\"\n    />\n    <Caption>Don't use the `state` variant when filtering pull requests.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Highlighting\n\nIf invalid values are used we don't show highlighting.\n\nWhile this applies to all qualifiers we do understand that for the ones that depend on our api endpoints (`users`, `repositories`, `organisations`...) we can't always accurately match every result and therefore while not ideal we always highlight those. For example when not single signed-on to a organisation some repositories might not be returned.\nAlso consider that users might copy paste strings containing qualifiers. In this case you need to run through every qualifier to set the highlight if needed.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/205069299-569989df-e6b7-410f-bcf6-5106774887a0.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input with the value 'is:bananas' where 'bananas' isn't highlighted.\"\n    />\n    <Caption>Remove highlighting on values when they are invalid.</Caption>\n\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/205069297-b9e03b40-0d52-4079-966d-e6d089440ab6.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input with the value 'is:bananas' where 'bananas' is highlighted.\"\n    />\n    <Caption>Don't show highlighting on invalid values.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### No matches\n\nWhen no matches are found we stop suggesting items through the popover and don't show anything.\nIn rare cases the user could be searching for `format:format` within the content of items they are filtering to and this will still allow them to do so.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/207312763-f4b5c848-cb18-4172-8e25-35a510c1e1b7.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input with the value 'author:username-not-found'\"\n    />\n    <Caption>Stop suggesting if no matches are found.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/207312759-97e6a6ce-5fa3-4a6f-bd23-a7f0d98f754d.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input with the value 'author:username-not-found' and a suggestion showing 'Not found, try a different username'\"\n    />\n    <Caption>Don't show an empty state when no matches are found.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Values with spaces\n\nSome qualifiers like `location:` might have values which contain spaces. eg: 'Amsterdam, Netherlands'. In this case we encapsulate the value between straight quotes (not smart quotes).\n\nWithout this it would be hard for the parser to understand where the value ends.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/205074856-ae4b1b8b-7276-4d6d-8177-baa465241b30.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An input with the value `location:'Amsterdam, Netherlands'` using straight quotes around the location value.\"\n    />\n    <Caption>Use straight quotes around values with spaces.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/205074852-1b3376d9-aee1-4ba3-994b-84305604e0bf.png\"\n      role=\"presentation\"\n      alt=\"An input with the value 'location:Amsterdam, Netherlands' without using quotes around the location value. This is invalid.\"\n      width=\"456\"\n    />\n    <Caption>Don't use values with spaces without quotes.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Deprecate where possible\n\nThere are many qualifiers on our platform that could be unified or deleted. For example `type:` can now be replaced by `is:`.\nRemember that deprecating means that we stop suggesting those options to users but we still keep them available in the backend until we see usage declining to low volumes.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/207309519-affaf0ce-ab7d-471f-a52c-7c59242045e8.png\"\n      role=\"presentation\"\n      alt=\"An input with the value 'is:' suggesting options: 'Issue' and 'Pull request'. The options also include icons.\"\n      width=\"456\"\n    />\n    <Caption>Use a predefined qualifier where possible.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/207309517-48fa4064-48c5-4131-9759-ac1c4ff9ff87.png\"\n      role=\"presentation\"\n      alt=\"An input with the value 'type:' suggesting options: 'Issue' and 'Pull request'. The options are missing icons.\"\n      width=\"456\"\n    />\n    <Caption>Use a custom qualifier instead of a predefined one.</Caption>\n\n  </Dont>\n</DoDontContainer>\n\n### Formatting\n\nAlways list qualifiers in a readable way and don't include all their options by using descriptions.\nWe do this to ensure that qualifiers are easy to scan and have enough context.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/207311524-8ccb8373-b77d-424f-992f-d4d7c80860aa.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An empty filter input showing initial suggestions: 'Assignee', 'Is', 'Repository', 'State' and 'Total comments'\"\n    />\n    <Caption>List qualifiers in a readable way and without their options.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/207311528-dbe0c3d2-bb3a-4d7d-a115-8d285aa9697a.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"An empty filter input showing initial suggestions with all the possible combinations: 'assignee: username, username', 'is: pr, issue, project', 'repo: github/github, github/primer', 'state: open, closed, draft', 'comments: >400, 100...200'\"\n    />\n    <Caption>Don't list qualifiers as their raw value with possible options.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Dynamic values\n\nSometimes static values can be limiting when filtering results. For example, let's say you want to get all items created in the past 7 days. Using a static value, you would have to create a range of dates manually, such as `2022-01-01..2023-01-07`. However, when you come back the next day (the 8th of January), you would have to update this range manually again to `2022-01-02..2023-01-08`. This is not very convenient. That's why dynamic values can be useful in these situations. Using the same example, if you use the dynamic value `@today-7d`, you will get all items created in the past 7 days. When you come back the next day, the range of dates will automatically update to reflect the current date, so you don't have to do it manually.\n\n| Value    | Translation                  |\n| -------- | ---------------------------- |\n| `@today` | Current date (excludes time) |\n| `@me`    | Current signed in user       |\n\n⚠️ At the moment, we are conducting a review of dynamic values with multiple stakeholders, so changes may be made.\n\n## Options\n\n### Size\n\nFilter inputs can have 3 different sizes:\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/204341476-89ad64b4-3232-42dd-894a-003877738cb7.png\"\n  role=\"presentation\"\n  alt=\"The filter input in three different sizes. The heights are as following: 28px, 32px and 40px.\"\n  width=\"960\"\n/>\n\n- Small (`28px`)\n- Medium (`32px`) (default)\n- Large (`40px`)\n","parent":{"relativeDirectory":"components","name":"filter-input"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/flash.mdx","frontmatter":{"title":"Flash"},"rawBody":"---\ntitle: Flash\ndescription: Flash alert informs users of successful or pending actions.\nreactId: flash\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=142%3A597&t=PFYau6cmDlujeJkx-1\nrails: https://primer.style/view-components/components/beta/flash\n---\n\nimport {Heading, Link} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  alt=\"Default, warning, critical, and success flash banners\"\n  src=\"https://user-images.githubusercontent.com/586552/217706820-5e289d3d-40b4-4b05-b1ea-24d140d31d12.png\"\n/>\n\n## Usage\n\nFlash alerts are used to display updates or alerts pertaining to any part of the system; this includes information regarding the user's account, the organization, the repo, and more.\n\nThese updates are typically not user-initiated but rather alerts that require the user's attention. Similarly to toasts, flash alerts can convey a warning, error, success, or a neutral message. If additional context is needed, provide a link for the user to learn more.\n\n### Best practices\n\n- Use flash alerts sparingly and only when necessary. Flash alerts can disrupt the user experience and should only be used when and where relevant.\n\n- Though flash alerts don't need to be as concise as a typical Toast message, they should **be direct and not exceed two to three sentences**. Don't use headings or multiple type sizes in flash alerts, rely on the default paragraph size instead.\n\n- Don't show more than one flash alert at a time. For more information, see this article on [alert fatigue](https://www.nngroup.com/videos/alert-fatigue-user-interfaces/).\n\n- They do not typically timeout on their own, but can include a dismiss action for messages that can be closed.\n\n## Options\n\n### Types\n\nThere are four types of flash banners, each with their own styles: Default, Warning, Danger, and Success.\n\n<img\n  width=\"960\"\n  alt=\"Default, warning, critical, and success flash banners\"\n  src=\"https://user-images.githubusercontent.com/586552/217706819-d5d615c5-4850-41fa-b1b1-51eaff2f6dd1.png\"\n/>\n\n#### Full-width\n\nFull-width can be applied when attaching a banner to a container. It attaches only to the top of a container.\n\n<img\n  width=\"960\"\n  alt=\"Full-width flash\"\n  src=\"https://user-images.githubusercontent.com/586552/217706818-7b3bb10f-52e0-4f24-9f2b-e4b7ea5b8087.png\"\n/>\n\n#### Accessories and actions\n\nBanners contain options to add an icon, button, or dismiss button to the content of the alert.\n\n<img\n  width=\"960\"\n  alt=\"Flash with icon, button, and dismiss button.\"\n  src=\"https://user-images.githubusercontent.com/586552/217706817-8a647058-9ab6-40d9-a5f7-289d67150add.png\"\n/>\n\n## Accessibility\n\nThe flash component should trigger notifications for users utilizing assistive technology. They should be considered as part of the overall messaging in the product and do not recieve focus (therefore, they do not _require_ a dismiss button).\n","parent":{"relativeDirectory":"components","name":"flash"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/form-control.mdx","frontmatter":{"title":"Form control"},"rawBody":"---\ntitle: Form control\ndescription: Form control displays a labelled input and, optionally, associated validation text and/or hint text.\nreactId: form_control\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=142%3A595\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Usage\n\nUse form controls when requiring data input from the user. For example, creating a new repo configuring settings, and logging in.\n\nThis component is a helper component to keep layouts consistent and ensure the correct ARIA attributes are set. You can find some of Primer's form components listed in the [Related links](#related-links) section.\n\n## Anatomy\n\n![diagrams labeling the anatomy of a text field and a checkbox field](https://user-images.githubusercontent.com/2313998/171692166-43d45c4b-509a-4f68-9e8b-1577658b493e.png)\n\nForm controls allow users to provide data. At a minimum, they include an input and label. They may also include a caption and required field indicator.\n\nTo learn more about anatomy, input methods, forms structure, validation, and more, please refer to our [Forms guidance](/ui-patterns/forms).\n\n## Related links\n\n- [Forms](/ui-patterns/forms)\n- [Checkbox](/components/checkbox)\n- [Checkbox group](/components/checkbox-group)\n- [Radio](/components/radio)\n- [Radio group](/components/radio-group)\n- [Text input](/components/text-input)\n- [Textarea](/components/textarea)\n- [Select](/components/select)\n","parent":{"relativeDirectory":"components","name":"form-control"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/heading.mdx","frontmatter":{"title":"Heading"},"rawBody":"---\ntitle: Heading\ndescription: Heading defines the hierarchical structure and importance of the content they contain.\nreactId: heading\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=21069%3A78764&t=0oSdmKQbjXp6hwuf-1\nrails: https://primer.style/view-components/components/beta/heading\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  alt=\"An image displaying each header from h1 to h6\"\n  src=\"https://user-images.githubusercontent.com/586552/217705129-6422d0c0-dacc-4c98-90c0-9380fb001e83.png\"\n/>\n\n## Usage\n\nHeadings are used to structure the content on the page, with each heading representing a different level of importance. It is recommended to use headings in a logical manner to create a clear hierarchy and improve accessibility.\n\n- Heading should be used to communicate page organization and hierarchy.\n- Use heading as the title of a section or sub section.\n- Do not use heading for styling alone. For simply styling text, use text with relevant styling.\n\nThe heading component will render an html h2 tag without any default styling.\n\n## Accessibility\n\nWhile sighted users rely on visual cues such as font size changes to determine what the heading is, assistive technology users rely on programatic cues that can be read out. When text on a page is visually implied to be a heading, ensure that it is coded as a heading. Additionally, visually implied heading level and coded heading level should be consistent. See [WCAG success criteria: 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html).\n\nHeadings allow assistive technology users to quickly navigate around a page. Navigation to text that is not meant to be a heading can be a confusing experience. [Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/).\n","parent":{"relativeDirectory":"components","name":"heading"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/index.mdx","frontmatter":{"title":"Components"},"rawBody":"---\ntitle: Components\n---\n\n<ChildPages of=\"Components\" />\n","parent":{"relativeDirectory":"components","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/link.mdx","frontmatter":{"title":"Link"},"rawBody":"---\ntitle: Link\ndescription: Links are used to apply styles to hyperlink text.\nreactId: link\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=20953%3A78940&t=wIvqJYawyRBUeGPt-1\n---\n\nimport {Box, Text} from '@primer/react'\nimport Code from '@primer/gatsby-theme-doctocat/src/components/code'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Usage\n\nLinks enable users to navigate between pages or resources in a seamless way. Links can be used within a body of text or as a standalone element.\n\nLinks navigate you to a new place or new content. **Do not** use links for triggering an action. Instead, use [buttons](/components/button), which are designed to activate a feature.\n\nLinks should be concise and not exceed more than a few words.\n\n## Anatomy\n\nThe link component can be displayed in default, muted, or blue colors. Links can be underlined, may include a leading visual or trailing visual, and can be either the default or small size. \n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    width=\"400\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/586552/225489084-4f4357b4-4c47-4a55-8770-76e03b8c500f.png\"\n    \n  />\n  <img\n    width=\"369\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/586552/225489086-e604fbc8-e449-416e-bd26-cc80408c5d8d.png\"\n   />\n</Box>\n\n## Accessibility\n\nLinks play a key part in your experience on the web, but without proper consideration they can be frustrating to use, skipped over, or completely unnoticed.\n\nFor assistive technologies like screen readers, links and buttons are expected to function differently from each other. If a link is activated and does not do what was expected, that can be disorienting and frustrating.\n\nA common way a screen reader might navigate the page is by going through a list of all the links on the page. Without context, \"read more\" or \"click here\" links are not helpful.\n\nPeople who have low or colorblind vision may have trouble identifying links that just use color to distinguish them from plain text, this is why keeping the underline styling on links within body text is important for identification.\n\n### How to test links\n\n#### Functionality and purpose\n\nA link's function is to _navigate_ to a different page or new content. If instead a feature on the page is activated, use a `<button>`. [Learn when to use a link or button](https://accessibility-playbook.github.com/guidance/patterns/link-and-button-guidance).\n\nA link's purpose must be obvious from the link text alone. If you can't get an idea of where a link will take you based on the link text without reading the sourrounding text, the link text should be updated. [Learn how to write good link text](#writing-link-text).\n\nThis is important because screen readers allow users to browse through a list of links, where the link text is the only clue of where a link will take you.\n\n#### Visual distinction & contrast\n\nLike normal text, a link must have a `4.5:1` contrast against the background color that it is placed on. Use a [contrast checker](https://webaim.org/resources/contrastchecker/) to validate that your link meets this required contrast.\n\nIf a link is sourrounded by text, it must be underlined or pass a `3:1` contrast against the sourrounding text as well. Alternativly an icon, a background shape or an outline can demarcate a link.\n\nSome examples of this are:\n\n- links within body text\n- a headline and subline which both are individual links\n- issue numbers or usernames within a commit line\n\n### Guidelines\n\n- Visually demarcate your links by using:\n  - the `accent.fg` color in combination with `fg.default` for the sourrounding text on any of the `canvas.[...]` colors\n  - an underline for the link text\n  - an icon before or after the link text\n  - using a background shape behind the link\n  - using a link color that has a `3:1` contrast against the sourrounding text color AND a `4.5:1` against the background color\n- Make sure a link's purpose can be understood from the link text alone, without needing the surrounding context.\n- Links should look like links, not buttons, except in rare circumstances, like calls to action.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/160483376-a88eb64f-ce80-4a11-93b5-6d882b1970eb.png\"\n      alt=\"Markdown paragraph with descriptive links\"\n    />\n    <Caption>Be descriptive with your links so that they can stand alone and be understood.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/160474793-2fd3085f-0813-43ed-8b43-c1a5f14aaea9.png\"\n      alt=\"Markdown paragraph with links like 'Click here' and 'find out more'\"\n    />\n    <Caption>Don't use generic terms like 'click here' that can't be understood out of context.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/160474794-06a75b30-06d3-475e-863f-605e8a6dad72.png\"\n      alt=\"Underlined username link in issue subheading\"\n    />\n    <Box\n      sx={{\n        marginTop: 2,\n        backgroundColor: 'neutral.subtle',\n        borderRadius: 6\n      }}\n    >\n      <img width=\"550\" alt=\"Underlined links in paragraph\" src=\"https://user-images.githubusercontent.com/586552/225663474-e54cf0aa-5b1a-4f24-bd31-7502127e6046.png\" />\n    </Box>\n    <Caption>Underline links in paragraphs and sentences</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/160474800-b505369e-1730-4c14-b426-70b5bd016a6c.png\"\n      alt=\"Issue subheader with none of the links underlined\"\n    />\n    <Box\n      sx={{\n        backgroundColor: 'neutral.subtle',\n        marginTop: 2,\n        borderRadius: 6\n      }}\n    >\n      <img\n        width=\"550\"\n        alt=\"Links using underline to highlight important text instead of link\"\n        src=\"https://user-images.githubusercontent.com/586552/225663469-b8899b88-59f4-48a6-8e48-9ec3d0d45b37.png\"\n      />\n    </Box>\n    <Caption>Don't use underlines for non-link highlights or forget to demarcate links</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <Box\n      sx={{\n        backgroundColor: 'neutral.subtle',\n        borderRadius: 6\n      }}\n    >\n      <img\n        width=\"550\"\n        alt=\"Links using the accent color and a muted grey both with a 3:1 contrast against the default text color\"\n        src=\"https://user-images.githubusercontent.com/586552/225663478-c519d894-b898-42dd-b426-c6e260ac1341.png\"\n      />\n    </Box>\n    <Caption>Use a link color that has a 3:1 contrast against the text color</Caption>\n  </Do>\n  <Dont>\n    <Box\n      sx={{\n        backgroundColor: 'neutral.subtle',\n        borderRadius: 6\n      }}\n    >\n      <img\n        width=\"550\"\n        alt=\"Links using a color with a contrast smaller than 3:1 against the default text color\"\n        src=\"https://user-images.githubusercontent.com/586552/225663473-44503373-39f8-4eee-bb9e-ed82442bb47b.png\"\n      />\n    </Box>\n    <Caption>Don't use a color that has less than a 3:1 contrast against the text color for links</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <Box\n      sx={{\n        backgroundColor: 'neutral.subtle',\n        borderRadius: 6\n      }}\n    >\n      <img width=\"550\" alt=\"Links with icon or background shape to demarcate it\" src=\"https://user-images.githubusercontent.com/586552/225663476-44cc0c51-705c-4b32-98ea-4a7db9ba9876.png\" />\n    </Box>\n    <Caption>Use an icon or a background shape to demarcate a link</Caption>\n  </Do>\n  <Dont>\n    <Box\n      sx={{\n        backgroundColor: 'neutral.subtle',\n        borderRadius: 6\n      }}\n    >\n      <img width=\"550\" alt=\"Links using other text styles to demaracte it\" src=\"https://user-images.githubusercontent.com/586552/225663470-4c66fea4-2e5d-4999-bfe1-44733ba1fa2a.png\" />\n    </Box>\n    <Caption>Don't use text styles like italic or bold to demarcate links</Caption>\n  </Dont>\n</DoDontContainer>\n\n### For engineers\n\n- Use Primer link components:\n  - [Link in Primer ViewComponents](https://primer.style/view-components/components/link)\n  - [Link in Primer React](https://primer.style/react/Link)\n- Don't override the link styling provided in the components\n- Make sure links receive our global focus indicator styling when navigating the page with a keyboard (reference: [Focus management](/guides/accessibility/focus-management))\n- Don't use the `title` attribute\n  - Content within a `title` is inaccessible for many users, such as touch-only and keyboard-only users. If additional content needs to be associated with a link consider using a [tooltip](https://primer.style/view-components/components/alpha/tooltip) or [alternatives to a tooltip](/guides/accessibility/tooltip-alternatives).\n- Avoid adding side effects to link click events. Links should navigate, not affect the page.\n- Don't force links to open in a new tab/window by setting the `target` property.\n- Links should always open in a new window when clicking while holding Command/Control.\n\n### Common mistakes\n\n- Only adding an underline to a link when it has focus or is hovered over\n- Underlining every link on the page. For example, a navigation list is a list of links but navigational links don't have to be underlined because the intent is understood and an underline is not needed to identify the interactive nature of the control.\n\n### Writing link text\n\nLink text should be descriptive enough to convey the destination without relying on the surrounding text. Screen reader users often tab through links on a page to quickly find content without needing to listen to the full page.\nWhen link text is too generic like \"Read more\", the destination of the link is not conveyed.\n\nIt may be acceptable in some scenarios to provide a more descriptive link text for screen reader users by setting the `aria-label`. However, this technique will result in divergence between the label and the text and is not an ideal, future-proof solution.\nWhenever possible, prefer a single descriptive link text that is available for both sighted users and screen reader users.\n\nIf you must resort to the ARIA technique to provide a descriptive link text, follow these principles:\n\n1. The visible text is included in full as part of the accessible name to avoid a violation of [SC 2.5.3: Label in Name](https://www.w3.org/WAI/WCAG21/Understanding/label-in-name.html).\n2. The sentence that the link is a part of is well-formed and grammatical when read with both the visible text and the accessible name.\n\n<DoDontContainer>\n  <Do>\n    <Caption>\n      Accessible name fully includes the visible link text, \"Learn more\" and is well-formed with either label.\n    </Caption>\n    <Code className=\"language-html\">{`There are various plans available. \n<a href=\"...\" aria-label=\"Learn more about GitHub pricing plans\">Learn more</a>`}</Code>\n    <br />\n  </Do>\n  <Dont>\n    <Caption>\n      Accessible name results in poorly-formed sentence, \"Learn more about keyboard shortcuts allow you to access common\n      commands more quickly\".{' '}\n    </Caption>\n    <Code className=\"language-html\">{`<a href=\"...\" aria-label=\"Learn more about keyboard shortcuts\">Keyboard shortcuts</a> allow you to access common commands more quickly.`}</Code>\n  </Dont>\n</DoDontContainer>\n\nAs demonstrated in the examples, this technique adds more complexity to the code and can introduce more problems than it solves so only use this technique if absolutely necessary.\n\n### Additional resources\n\n- [Color to Distinguish Links from Text](https://dequeuniversity.com/class/visual-design/color/distinguish-links-from-text) (requires a subscription to access the content)\n- [Accessibility Insights plugin](https://accessibilityinsights.io/en/): With the Accessibility Insights plugin installed, open the plugin, visit the **Assessment** option and select **7. Links**\n- [WebAIM: Links and Hypertext - Introduction to Links and Hypertext](https://webaim.org/techniques/hypertext/)\n- [erblint-github: Avoid generic link text](https://github.com/github/erblint-github/blob/main/docs/rules/accessibility/avoid-generic-link-text-counter.md)\n\n#### Related WCAG guidelines and success criteria\n\n- [Understanding Success Criterion 4.1.2: Name, Role, Value](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html)\n- [Authoring Practices Guide - Links](https://www.w3.org/TR/wai-aria-practices-1.2/#link)\n- [Accessible Rich Internet Applications (WAI-ARIA) 1.2 (w3.org)](https://www.w3.org/TR/wai-aria-1.2/#link)\n- [Understanding Success Criterion 2.4.4: Link Purpose (In Context)](https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-in-context.html)\n","parent":{"relativeDirectory":"components","name":"link"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/page-header.mdx","frontmatter":{"title":"Page header"},"rawBody":"---\ntitle: Page header\nreactId: drafts_page_header\ndescription: Page header determines the top-level headings of a UI.\nfigma: https://www.figma.com/file/Ee0OrXuOLXMDqUW83EnDHP/PageHeader-(FY23-Q1)?node-id=0%3A1&t=8cKRbkNYhwbqEoHj-1\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Usage\n\nThe page header arranges elements that apply context and provide navigation for the current page. \n\nThe elements within page header are rearranged and displayed accordingly depending on the [viewport size](/foundations/layout#viewport-ranges) and context of the page.\n\n<img \n    src=\"https://user-images.githubusercontent.com/586552/222194474-74b72ae3-f8d4-4336-9a2c-9d5c18d91c42.png\"\n    role=\"presentation\"\n    width=\"960\"\n    alt=\"Page header component\"\n/>\n\n## Anatomy \n\nPage header can include a context bar, title bar, description, and contextual navigation (pertaining to the current page). \n\nBy default, the [context bar](#context-bar) is visible on narrow viewports only, the [title bar](#title-bar) is visible on all viewports, and the back button and trailing action are visible on regular viewports.\n\n<img\n    src=\"https://user-images.githubusercontent.com/586552/221939296-410d3b17-ccbb-48ae-b1cf-c3a8cdcfcaa5.png\"\n    role=\"presentation\"\n    width=\"993\"\n    alt=\"Page header anatomy\"\n/>\n\n## Context bar\n\nThe context bar is intended to set context for the user on smaller viewports and provide any actions that fit within the context bar. As a reminder, by default, the context bar (including its actions) is only visible on narrow viewports. \n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  justifyContent=\"space-between\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"1\">\n    <Text as=\"h3\" fontSize={2} m={0}>\n      Parent link\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n        The default way to let users navigate up in the hierarchy on narrow viewports.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/586552/222194471-dfc56e9a-a2ab-48a0-8a04-41ebb5ec4adf.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  justifyContent=\"space-between\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"1\">\n    <Text as=\"h3\" fontSize={2} m={0}>\n      Context bar actions\n    </Text>\n    <Text as=\"p\" mt=\"1\">\n        Actions that appear in the context bar specifically.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/586552/222194470-da8126b8-72c5-4078-968e-ebc5c2bf3140.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  justifyContent=\"space-between\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"1\">\n    <Text as=\"h3\" fontSize={2} m={0}>\n      Context bar area\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n        The context bar is a generic slot for any component above the title region. \n        Use it for custom breadcrumbs and other navigation elements instead of parent link.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/586552/222194469-85131849-4a7a-41e6-abca-040d042110df.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n## Title bar\n\nThe title bar can include a static page title, actions, and leading and trailing visuals.\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  justifyContent=\"space-between\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"1\">\n    <Text as=\"h3\" fontSize={2} m={0}>\n      Default title variant\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n        Most common page title size. Use for static titles in most situations.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/586552/222194467-1031b33b-81e7-429b-9201-d154fd7e9d59.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  justifyContent=\"space-between\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"1\">\n    <Text as=\"h3\" fontSize={2} m={0}>\n      Large title variant\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n        Use large for for user-generated content such as issues, pull requests, or discussions.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/586552/222194464-6c477db6-bb11-445e-b27e-41a0c7267758.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  justifyContent=\"space-between\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"1\">\n    <Text as=\"h3\" fontSize={2} m={0}>\n      Subtitle variant\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n        Use subtitle when a title is already present in the page, such as in a Split page layout.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/586552/222215097-79bb0d77-af5c-4199-81a1-65d98a7a0556.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  justifyContent=\"space-between\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"1\">\n    <Text as=\"h3\" fontSize={2} m={0}>\n      Leading visual\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n        Leading visuals are optional and appear at the start of the title. They can be octicons, avatars, and other custom visuals that fit a small area. Leading visuals remain visible on all viewports.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/586552/222194458-922bd3bf-475d-4d76-97a1-bd8cda6af6f5.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  justifyContent=\"space-between\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"1\">\n    <Text as=\"h3\" fontSize={2} m={0}>\n      Trailing visual\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n        Trailing visual and trailing text can display auxiliary information. They're placed at the right of the item, and can denote status, privacy details, etc. Trailing visuals remain visible on all viewports.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/586552/222194459-daf8c4b8-0452-40a2-bdf3-2b74be06e7ef.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  justifyContent=\"space-between\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"1\">\n    <Text as=\"h3\" fontSize={2} m={0}>\n      Leading action\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n        A back button can be used as a leading action for local navigation. On narrow viewports, use parent link instead.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/586552/222503965-dc2d7727-6a45-402a-abb0-948a58866017.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  justifyContent=\"space-between\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"1\">\n    <Text as=\"h3\" fontSize={2} m={0}>\n      Trailing action\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n        Trailing action can display subtler actions aligned directly next to the title. On narrow viewports, replace the trailing action with an item in an overflow button.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/586552/222194453-0f3e29b8-28cb-4623-8039-f546e1ae6622.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>","parent":{"relativeDirectory":"components","name":"page-header"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/popover.mdx","frontmatter":{"title":"Popover"},"rawBody":"---\ntitle: Popover\ndescription: Popover is used to bring attention to specific user interface elements.\nreactId: popover\nrails: https://primer.style/view-components/components/beta/popover\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=410%3A3890&t=ZTzX5Hzm5IuUl4m8-1\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Usage\n\nThe popover component is used to deliver context-specific information and functionality. It’s a small dialog to bring attention to specific user interface elements. It can provide additional information, options, or actions related to a specific element or task. Popovers can be helpful for flows that require light onboarding or instruction.\n\nPopovers may contain text, links, and buttons. \n\nPopover supports various caret positions, which you can specify, though the default is top. Note that the top-left, bottom-left, top-right, and bottom-right values modify the horizontal alignment of the popover.\n\n<img\n    src=\"https://user-images.githubusercontent.com/586552/227022626-625dad35-47d5-46ac-ba64-3c1285a37410.png\"\n    role=\"presentation\"\n    width=\"960\"\n    alt=\"A popover component example\"\n/>\n\n## Best practices\n\nUse sparingly to avoid cognitive overload. Though they can be used for a variety of things, they should be used sparingly to avoid cognitive overload. It's important to consider the context in which the popover appears. Are there other popovers on the page? Does it appear on page load, or require the user to open the popover?\n\nUnlike other messaging components, popovers should never include critical information (such as errors) and should always include a dismiss action.\n\n## Accessibility\n\n- Popovers should be operable using the keyboard alone, without requiring the use of a mouse or other pointing device.\n\n- Popovers should be announced by screen readers, including their content and role on the page.\n\n- When a popover is opened, focus should be moved to the popover so that keyboard users can interact with it. When the popover is closed, focus should be returned to the element that triggered it. For more on this, see the accessibility guidelines [on focus management](/guides/accessibility/focus-management).\n\n## Related links\n\n- [Feature onboarding](../ui-patterns/feature-onboarding)\n","parent":{"relativeDirectory":"components","name":"popover"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/progress-bar.mdx","frontmatter":{"title":"Progress bar"},"rawBody":"---\ntitle: Progress bar\ndescription: Progress bar visualizes one or more parts of a whole.\nreactId: progress_bar\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=16226-61588&t=K0NL1ExAmlwNDfpL-4\n---\n\nimport {Box} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/227374230-647f77d0-4e50-44de-a663-b94a0e63befe.png\"\n/>\n\n## Usage\n\nA progress bar is a simple chart that can be used to show how complete something is, or visualize parts that make up a whole.\n\n### Best practices\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/227374232-f0f8d3dd-b4da-4f8b-a528-932d82b012da.png\"\n/>\n\nWhen using multiple segments, use colors that are easy to tell apart and include a legend that identifies what each segment represents.\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/227374235-3cfc45ba-e0f6-4c50-9d73-de812b084d59.png\"\n/>\n\nDefault to pairing the progress bar with text that explicitly shows the value(s) of the filled segment(s). Text values are not explicitly required, but should only be omitted when the progress is intentionally vague.\n\n<DoDontContainer>\n  <Do>\n    <img\n      role=\"presentation\"\n      width=\"456\"\n      src=\"https://user-images.githubusercontent.com/2313998/227374238-9cc0053c-6b09-45c4-bd6a-e5abbf3a8cc2.png\"\n    />\n    <Caption>Limit the number of segments.</Caption>\n  </Do>\n  <Dont>\n    <img\n      role=\"presentation\"\n      width=\"456\"\n      src=\"https://user-images.githubusercontent.com/2313998/227374240-aa7e2faa-d7cb-4862-ac07-1d755eff50d5.png\"\n    />\n    <Caption>Don't overload a progress bar with too many segments.</Caption>\n  </Dont>\n</DoDontContainer>\n\nWhen using multiple segments, avoid overwhelming users by with too many segments. This is especially important for narrow progress bars. Consider a different kind of chart for these cases.\n\n## Options\n\n### With multiple segments\n\nA progress bar may use segments to represent multiple parts of a whole.\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/227374241-9f750ba7-993f-4ae6-aaa0-71189cea7aad.png\"\n/>\n\n### Color\n\nThe color of the filled part(s) of the progress bar may be customized. Default to using [`success.emphasis`](https://primer.style/primitives/colors#success) for a progress bar that only shows a single segment.\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/227374242-17251995-3001-4fca-b450-eb9c510bee22.png\"\n/>\n\n### Size\n\nThe size may be adjusted to adapt the progress bar to different contexts.\n\nSize options:\n\n- Small\n- Medium (default)\n- Large\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/227374243-798808a3-1cb0-40b1-827c-e06925d1d4a4.png\"\n/>\n\n### Width\n\nBy default, a progress bar will fill it's parent. However, a progress bar can be any width.\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/227374245-3e64d14f-5cf8-4710-bc34-1393bd39877a.png\"\n/>\n\n## Accessibility\n\nWhen rendering multiple segments, the segment colors should have a 3:1 contrast ratio with colors of adjacent segments.\n\nProgress bars can only be interpreted by sighted users. Include a text description to support assistive technologies like screen readers.\n\nFor example, \"tasks: 8 of 10 complete\" for a single segment, or \"tasks: 80 done, 14 in progress, 6 open\" for multiple segments.\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/227374246-1e06193f-34e8-411f-9aee-6eb212923059.png\"\n/>\n\nIf the progress bar value is already shown as text adjacent to the progress bar, don't use a redundant label for the progress bar.\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/227374248-4c1fdb50-903a-4725-93e9-40eabb11baca.png\"\n/>\n","parent":{"relativeDirectory":"components","name":"progress-bar"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/radio-group.mdx","frontmatter":{"title":"Radio group"},"rawBody":"---\ntitle: Radio group\ndescription: Radio group is used to render a short list of mutually exclusive options.\nreactId: radio_group\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=15341%3A47574\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224133512-4e6bd321-5ad4-4c5e-865e-9e7f6b444cbf.png\"\n/>\n\n## Usage\n\nUse radio group to allow users to select a single option from a short list of related options.\n\n### Orientation\n\nA vertical orientation makes options easier to visually scan. A horizontal orientation is not yet supported.\n\n### Anatomy\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224133509-5df6e212-ca18-4950-87c8-7c90236ce29e.png\"\n/>\n\n**Label:** A title that labels the group of options and helps users understand the relationship between the options in the group\n\n**Required indicator:** Indicates that a selection is required\n\n**Caption:** May be used to provide additional context about the radio group when the label alone is not sufficient\n\n**Options:** A list of mutually exclusive options represented using [radio buttons](/components/radio)\n\n**Validation message:** A message explaining why the selection failed validation. See the [form pattern documentation](../ui-patterns/forms#validation) for more information on form validation patterns.\n\n### Best practices\n\n- Put radio buttons in a logical order\n- Only use a radio group for a short list of options: aim for 6 or less options. For longer sets of options, consider using a `<select>` input <!-- TODO: update \"`<select>` input\" with a link to the Select component doc once it's created -->, an [action menu](/components/action-menu), or an [autocomplete input](/components/autocomplete).\n- Radio buttons cannot be unchecked, so only use a radio group when a selection is required. Consider the following alternatives:\n  - use a radio group, but with one option that equates to \"none of these options\"\n  - use a [checkbox group](/components/checkbox-group) that fails validation if more than one option is selected\n- If there is an option that's the most likely option to be checked, that option should be checked by default\n\n## Accessibility\n\n- Once a user checks an option from a radio group, the result should not be saved or applied until the user has explicitly submitted their input using a \"save\" or \"submit\" button. A radio group is a single tab stop, and the options can be navigated using the arrow keys: this means assistive technologies like a screen reader cannot \"read\" an option without selecting it. See the [saving pattern guidelines](../ui-patterns/saving) for more information.\n  - Alternative: you can use a [segmented control](/components/segmented-control) to immediately apply the selection as long as it's not in the context of a bigger form that applies other input values when submited\n- Radio groups must be labeled. The label may be visually hidden, but visible labels are preferred.\n\n## Related links\n\n- [Forms](../ui-patterns/forms)\n- [Form control](/components/form-control)\n- [Saving](../ui-patterns/saving)\n- [Radio](/components/radio)\n- [Checkbox](/components/checkbox)\n- [Checkbox group](/components/checkbox-group)\n","parent":{"relativeDirectory":"components","name":"radio-group"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/radio.mdx","frontmatter":{"title":"Radio"},"rawBody":"---\ntitle: Radio\ndescription: Radio button is a form control for making a single selection from a short list of options.\nreactId: radio\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=15341%3A47574\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Usage\n\nUse a radio button in a [radio group](/components/radio-group) to allow users to select one option from a short list of options.\n\nSee the [radio group guidelines](/components/radio-group) for more information about usage.\n\n### States\n\nRadio buttons have static dimensions and three different states when checked or unchecked: rest (default), focus, and disabled.\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224133514-c583baf4-6dfc-444d-8714-dfc88cc00ff9.png\"\n/>\n\n### Best practices\n\n- A radio button may not be used on it's own: it _must_ be rendered in a group of related radio buttons using a [radio group](/components/radio-group).\n- Radio buttons cannot be unchecked, so only use radio buttons when a selection is required\n- An individual radio should not have its own validation message or style. Instead, show a validation message on the [radio group](/components/radio-group). For more information, see the [Validation Message](../ui-patterns/forms#validation) section in the Forms documentation.\n- An individual radio button cannot be marked as required. Instead, make a selection required using the [radio group](/components/radio-group). For more information, see the [Required field indicator](../ui-patterns/forms/#required-field-indicator) in the Forms documentation.\n\n## Related links\n\n- [Forms](../ui-patterns/forms)\n- [Form control](/components/form-control)\n- [Checkbox](/components/checkbox)\n- [Radio group](/components/radio-group)\n","parent":{"relativeDirectory":"components","name":"radio"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/segmented-control.mdx","frontmatter":{"title":"Segmented control"},"rawBody":"---\ntitle: Segmented control\ndescription:\n  Segmented control is used to pick one choice from a linear set of closely related choices, and immediately apply\n  that selection.\nreactId: segmented_control\nrails: https://primer.style/view-components/components/alpha/segmentedcontrol\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=16121%3A61220\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Anatomy\n\n![A diagram of a segmented control with three buttons. The labeled parts of the segmented control are: the selected third button, the icon in the second button, and the text label in the second button.](https://user-images.githubusercontent.com/2313998/182705417-c0e1dddb-6c6b-4746-9a02-0e3a9eb17017.png)\n\n## Usage\n\nA segmented control should only be used to change a value; it's similar to a group of radio inputs.\n\nA segmented control should not be used as a form of navigation: use tabs instead. If your primary use case is to hide or show content, that's a good hint that you should reach for tabs or another navigation pattern instead.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/200646211-c7dd9308-76f8-46b5-a189-4ff332e3921f.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Use tabs for navigation or toggling content visibility.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/200646212-f17f7da8-276a-4f0e-80eb-d561fe250caf.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Don't use a segmented control for navigation or toggling content visibility.</Caption>\n  </Dont>\n</DoDontContainer>\n\n## Content\n\n### Buttons\n\nA segmented control should have 2–5 choices with text labels, or up to 6 icon-only buttons. Too many choices can be difficult to parse and take up too much horizontal space. If there are more than 5 choices, use another choice selection pattern such as a group of radio inputs or a dropdown menu.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705421-fb58f024-323f-48b8-81ae-70db5fc0aed1.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Use a segmented control for picking from 5 (6 for icon-only buttons) or fewer options.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705422-2cb47d94-952c-4a7a-8f2f-627cc1ef3204.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Don't use a segmented control for more than 5 options.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705424-d85bee5f-3996-4078-9185-6c494e7d6067.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>\n      Use a segmented control for selecting from a list of static values. You may use an auxiliary dropdown adjacent to\n      the segmented control.\n    </Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705425-c79d6522-1f0e-40d9-8c4d-78bef58cceae.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Don't use a segmented control with a choice that is a dropdown.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Button icons\n\n<Box\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Text as=\"p\" mt=\"0\">\n    An icon can be rendered in a segmented control button as a visual cue to help users understand the choice that\n    button represents.\n  </Text>\n  <img\n    src=\"https://user-images.githubusercontent.com/2313998/182705434-baf679ea-14de-4b62-b83f-f833c1058694.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n#### Effective visual cues\n\nBe consistent with the way visual cues are used in each button of the segmented control. Use either all icons, all text labels, or all text labels with icons.\n\nDo not change icons to communicate state.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705431-fe063f8f-6678-44b7-81a4-9ed3a6968a1e.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Use icons as a visual cue to communicate what the choice does.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705433-d5533bac-8f7c-4a9d-8501-a304cdba4619.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Change or add icons to indicate whether the choice is selected.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182711267-c71a91e0-7bde-435b-a0e3-72ca4ea34e55.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Keep the visual cues in each button consistent.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182711268-f61ec450-fb10-41ba-b736-5fe1e5bddc87.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Don't mix visual cues between buttons.</Caption>\n  </Dont>\n</DoDontContainer>\n\n#### Icon-only buttons\n\nUse icons without a visible text label sparingly, and only with icons that are easily understood by an average GitHub user. When a segment has an icon without a visible text label, the text label should be shown in a tooltip.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705427-29e7dfe2-b714-4baf-96d9-2871b46eaf05.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Use icons without a visible label when the icon's meaning is obvious.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705428-112e7ebf-d483-49f1-aabf-44866c31b7f9.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Don't use obscure icons without a visible label.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Button label text\n\nSegmented control button labels should be nouns or noun phrases that succinctly describe the choice. Button labels may not wrap to multiple lines.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705434-baf679ea-14de-4b62-b83f-f833c1058694.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Phrase choice labels as nouns or noun phrases with as few characters as possible.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705435-e5ee0c9e-d4e7-4db5-b865-7f1001fb3e3e.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Phrase choice labels as an action or with unnecessarily long strings of text.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Contextual information\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"0\">\n    <Text as=\"h4\" fontSize={2} fontWeight=\"bold\" m={0}>\n      Label\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n      Segmented controls must have a text label, even if the label is only accessible to screen readers. A visible label\n      is the most direct way to identify what the control is used for, but the location and surrounding elements of the\n      control often give enough context to visually hide the label.\n    </Text>\n    <Text as=\"h4\" fontSize={2} fontWeight=\"bold\" m={0}>\n      Caption\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n      An optional caption may be used to provide additional context to help users make a selection or explain what\n      effect the selection will have. Caption text should be as short as possible.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/2313998/182711443-bf68d139-dfd9-477f-853e-de217a96f5d8.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\nSee the [layout](#layout) section for ways to compose a segmented control with a label.\n\n## Interaction\n\nSelections are mutually exclusive. Once a selection has been made, it can only be deselected by making a new selection.\n\nA segmented control does not require a \"Save\" button to apply the selection. When a choice is selected, the selection immediately affects an object, state, or view.\n\n## Layout\n\n### Composing the control with a label and caption\n\n#### Single-column\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Box as=\"figcaption\" mt=\"0\">\n    <Text as=\"h4\" fontSize={2} fontWeight=\"bold\" m={0}>\n      Single-column\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n      A single-column layout is the same way form controls (for example, text inputs) are layed out. The single-column\n      layout is useful for preserving horizontal space.\n    </Text>\n  </Box>\n  <img\n    src=\"https://user-images.githubusercontent.com/2313998/182710235-f26b3fa2-fac5-47ff-8334-034d62abb021.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\nA single-column layout is the same way form controls (for example, text inputs) are layed out. The single-column layout is useful for preserving horizontal space.\n\n#### Two-column\n\n<Box display=\"flex\" mb={3} flexWrap=\"wrap\" sx={{gap: 3}}>\n  <img\n    src=\"https://user-images.githubusercontent.com/2313998/182705438-d16f8eeb-8809-4d48-9c3c-528b637d7c2c.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n  <img\n    src=\"https://user-images.githubusercontent.com/2313998/182705440-b08a9a2c-0782-4468-9d83-1d8a7f8f77a9.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\nA two-column layout can be used to:\n\n- Align the control with adjacent elements\n- Conserve vertical space\n- Group related controls in a way that is easy to scan\n\n### Fill available width\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <Text as=\"p\" mt=\"0\">\n    A segmented control's width can stretch each button evenly to fill the width of the control's parent. This option is\n    intended to make the segmented control easier to adapt into different layouts.\n  </Text>\n  <img\n    src=\"https://user-images.githubusercontent.com/2313998/182705451-8eb238e0-7a4e-4c6c-a9ed-291e35ce1bf1.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n### Responsive design\n\nThere are cases where a segmented control needs to be placed in a spot that is too narrow to accommodate all of its options. In these cases, the control can be adapted to fit in the narrow area without sacrificing usability.\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"center\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n  <figcaption>\n    <Text as=\"h4\" fontSize={2} fontWeight=\"bold\" m={0}>\n      Convert to an action menu\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n      Swapping out the segmented control for an action menu is especially helpful when:\n      <Box as=\"ul\" mt={1} pl=\"1rem\">\n        <li>The icons cannot be understood without visible text labels</li>\n        <li>The control is still too wide when text labels are hidden</li>\n      </Box>\n    </Text>\n  </figcaption>\n  <img\n    src=\"https://user-images.githubusercontent.com/2313998/182705449-0b054ec5-26e3-4bff-b5c0-313966badadf.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"center\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  m={0}\n  mb={5}\n  sx={{gap: 3}}\n>\n  <figcaption>\n    <Text as=\"h4\" fontSize={2} fontWeight=\"bold\" m={0}>\n      Only show icons\n    </Text>\n    <Text as=\"p\" mt=\"0\">\n      If your segmented control uses icons that can be understood without a visible text label, then you can hide the\n      text labels and rely only on icons. The text from the hidden label will still be visible in a tooltip.\n    </Text>\n  </figcaption>\n  <img\n    src=\"https://user-images.githubusercontent.com/2313998/182705450-6a68767c-f7e5-4e3d-972f-38d30267df71.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705447-1f9ef99d-b6f2-4a98-af13-d34654236d30.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>\n      Replace the segmented control with an action menu or use icons that are easily understood without text labels.\n    </Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/2313998/182705446-bfa04d0b-dbfa-4d1b-b732-c50503d65735.png\"\n      role=\"presentation\"\n      width=\"456\"\n    />\n    <Caption>Wrap the buttons to multiple lines, use an overflow button, or remove buttons</Caption>\n  </Dont>\n</DoDontContainer>\n\n## Accessibility\n\nA segmented control is treated like a [list](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul) where each [list item](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li) contains a button.\n\nDo not treat a segmented control like any of the following ARIA roles:\n\n- [`radiogroup`](https://developer.mozilla.org/en-US/docs/web/accessibility/aria/roles/radiogroup_role), which would require a save button to apply the changes.\n- [`tablist`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tablist_role), which is used to switch between [tab panels](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tabpanel_role) of different content.\n- [`toolbar`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/toolbar_role), which is a collection of function buttons.\n\nThese other roles have their own keyboard navigation rules and are treated differently by screen readers and other assistive technologies. Designs that treat segmented controls like tabs or radio buttons would be confusing for users who interact with the web using assistive technologies.\n\n### Keyboard navigation\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n\n<div>\n\n#### `Tab`\n\n`Tab` behaves just like it would in a list of focusable elements.\n\nWhen tabbing into the segmented control from an adjacent focusable element, the first or last button receives focus.\n\n- Focus will be brought to the first segmented control button if focus is being moved from _before_ the segmented control.\n- Focus will be brought to the last segmented control button if focus is being moved from _after_ the segmented control.\n\n#### `Enter` or `Space`\n\nPressing `Enter` or `Space` while focused on a deselected button selects that button. This is the default behavior for buttons.\n\nIf the focused button is already selected, pressing `Enter` or `Space` should not deselect the button.\n\n#### `Arrow Left` or `Arrow Right`\n\nUnlike radio groups and toolbars, the left and right arrow keys do not change the focus or selection.\n\n</div>\n\n<Box flexShrink={0}>\n  <CustomVideoPlayer\n    width=\"456\"\n    autoplay\n    loop\n    src=\"https://user-images.githubusercontent.com/2313998/183119490-af7db406-63e5-4395-ba2f-76941691b497.mp4\"\n  />\n</Box>\n</Box>\n\n### Touch targets\n\n<Box\n  as=\"figure\"\n  display=\"flex\"\n  flexDirection={['column-reverse', 'column-reverse', 'column-reverse', 'column-reverse', 'row']}\n  m={0}\n  mb={3}\n  sx={{gap: 3}}\n>\n\n<Text as=\"p\" mt=\"0\">Ensure segmented control buttons have a large enough touch target size. On devices that have a pointer with limited accuracy (such as touchscreen phones), provide a larger touch target area. The buttons should respond to hovers, clicks, and taps anywhere in the touch target area, even if it isn't directly on the control.</Text>\n  <img\n    src=\"https://user-images.githubusercontent.com/2313998/182705453-f0a68ed8-4e07-4ce3-8c09-0ead2d08b816.png\"\n    role=\"presentation\"\n    width=\"456\"\n  />\n</Box>\n","parent":{"relativeDirectory":"components","name":"segmented-control"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/select.mdx","frontmatter":{"title":"Select"},"rawBody":"---\ntitle: Select\ndescription: Select is an input for selecting a single option from a menu.\nreactId: select\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=15341%3A47478&t=yjafRlkLawGne3PG-1\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/226014184-d7b0bf58-1ea0-4ce7-b79a-f0bdacdb49de.png\"\n/>\n\n## Usage\n\nUse select to allow users to pick a single option from a dropdown menu of predetermined options.\n\n### States\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/226014188-07ffaaaf-e5a8-4e63-930f-86f95f83c018.png\"\n/>\n\n**Focused:** The input has been navigated to and is ready to accept input.\n\n**Disabled:** The input cannot accept input or become focused.\n\n**Invalid:** The value failed validation.\n\n**Valid:** The value passed validation.\n\nFor more information about the \"valid\" and \"invalid\" states, see the [validation section](https://primer.style/design/ui-patterns/forms#validation) of the form design pattern guidelines.\n\n### Best practices\n\n- Use a select input for longer lists of options. If there are 6 or fewer options and you don't need to conserve vertical space, consider using a [radio group](/components/radio-group) instead.\n- Provide a default selected option when possible\n- Order the menu options in a logical order to make it easier for users to find the option they're looking for. Default to alphabetical order.\n\n## Anatomy\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/226014190-e6c9f284-c3b7-4037-8967-3d2fe075a509.png\"\n/>\n\n**Label (required):** A short title that labels the group of options and helps users understand the relationship between the options in the group\n\n**Required indicator:** Indicates that a selection is required\n\n**Input (required):** Displays the selected value and is used to toggle the dropdown menu\n\n**Caption:** May be used to provide additional context about the options when the label alone is not sufficient. Caption text should be as short as possible. Caption text may be displayed at the same time as a validation message, or it may be hidden if it only provides redundant information.\n\n**Validation message:** A single validation message may be displayed to provide helpful information for a user to complete their task. It is most commonly used to explain why a value is invalid so they can correct it and submit the form.\n\n## Options\n\n### Sizes\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/226014192-ccc2b121-2d94-4f1e-a3fe-2eab07369744.png\"\n/>\n\nA text input can be made smaller or larger depending on the context it's being used in.\n\nYou could make an input smaller if it is being used in a tight space with other small elements. You could make an input larger if it's in an open space or it feels out of proportion with adjacent large elements.\n\n### Width\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/226014194-14b3273f-f16c-4795-bce7-a449eb5bb5ad.png\"\n/>\n\nBy default, a select input will be as wide as the text of it's longest option.\n\nYou can render a select input to fill the width of it's parent element.\n\n### With a placeholder\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/226014196-d2cf9c41-3366-4c79-a56f-a8646a769f2b.png\"\n/>\n\nYou may show placeholder text when no option is selected. The placeholder option is hidden from the dropdown menu when a selection is required.\n\n## Interactions\n\nThis is just a native [select](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select), so the interactions will match the paradigms of the user's OS and browser.\n\n## Accessibility\n\nSelect placeholders cannot be used in place of labels and should be used sparingly. They also should not convey critical information.\n\nSelect options should not be prefixed with emoji, as that disrupts typeahead behavior.\n\n## Related links\n\n- [Forms](../ui-patterns/forms)\n- [Action menu](/components/action-menu)\n- [Autocomplete](/components/autocomplete)\n- [Checkbox group](/components/checkbox-group)\n- [Radio group](/components/radio-group)\n","parent":{"relativeDirectory":"components","name":"select"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/text-input-with-tokens.mdx","frontmatter":{"title":"Text input with tokens"},"rawBody":"---\ntitle: Text input with tokens\ndescription: Text input with tokens is an input for a value that is a list.\nreactId: text_input_with_tokens\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=10400%3A38612&t=sr8N32f7rXqjxzcn-4\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nimport {Box} from '@primer/react'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224812709-4bc4d525-92e5-49e8-9a36-264af2ac1c0c.png\"\n/>\n\n## Usage\n\nUse a text input with tokens for a value that is a list. Items can be added or removed from the list, but the individual items cannot be edited inline.\n\nThis kind of input is most commonly used with an [autocomplete](/components/autocomplete) to let users select items from a predetermined list of options.\n\n## Anatomy\n\nSame as the [text input](/components/text-input), but the input's value is a list instead of a single string of text.\n\n## Options\n\nThe text input can be configured with all of the same options as the regular [text input](/components/text-input) component.\n\n### Wrapping\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224812712-c3552b98-3064-4cac-83f0-7a83eb3e2a11.png\"\n/>\n\nThe list of tokens can be constrained to a single line or be wrapped to multiple lines. When wrapping is disabled and the list exceed the width of the input, the input will scroll horizontally.\n\n### Max height\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224812714-c349ff71-7cf8-400f-b2be-01ef1e8cf997.png\"\n/>\n\nWhen tokens wrap, the height of the input can be constrained to a maximum height. Once the rows exceed the maximum height, the input will scroll vertically.\n\n### Truncation\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224812715-7382f758-3122-4da7-b742-34180876042f.png\"\n/>\n\nYou may choose to limit the number of tokens that are visible. However, all tokens will be visible while the text input is focused.\n\n### Token variants\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224812717-20c412d7-24c0-4b94-a32a-7d3e7bc60468.png\"\n/>\n\nYou may choose any of Primer's token components, but you cannot mix different token components in a single input. You may also choose the size of the tokens and whether or not the token's remove button is shown.\n\n## Interactions\n\n### Move focus between tokens\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n  <Box flex={1}>\n\nWhen tabbing to the input, the `<input />` element receives focus. Then, when the text cursor is at the beginning of\nthe input, users can use the `Left Arrow` key to move focus to the last token. Once any token has focus, users can\nuse the `Right Arrow` and `Left Arrow` key to move focus to the previous or next token.\n\n  </Box>\n  <CustomVideoPlayer\n    width=\"456\"\n    loop\n    src=\"https://user-images.githubusercontent.com/2313998/225961225-12d6e608-5c7d-46eb-bb28-dffb813d0914.mp4\"\n  />\n</Box>\n\n### Remove tokens\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n  <Box flex={1}>\n\nA token may be removed by focusing it and pressing the `Backspace` key, or by clicking the token's remove button.\n\nIf a user keys `Backspace` and the text cursor is at the begining of the input, the last token will be removed but\nthe input will be populated with it's text value.\n\n  </Box>\n  <CustomVideoPlayer\n    width=\"456\"\n    loop\n    src=\"https://user-images.githubusercontent.com/2313998/225962383-166e55f4-9616-495a-a166-485c51e71b95.mp4\"\n  />\n</Box>\n\n## Related links\n\n- [Forms](../ui-patterns/forms)\n- [Autocomplete](/components/autocomplete)\n- [Text input](/components/text-input)\n- [Tokens](/components/tokens)\n","parent":{"relativeDirectory":"components","name":"text-input-with-tokens"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/text-input.mdx","frontmatter":{"title":"Text input"},"rawBody":"---\ntitle: Text input\ndescription: Text input is used to set a value that is a single line of text.\nreactId: text_input\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=15341%3A47266&t=dvM9ZncRKLs7jQNq-4\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224445194-dceef3a4-25f3-4d0e-a1f4-fdaf868f6179.png\"\n/>\n\n## Usage\n\nUse a text input to allow users to input short free-form text. It may also be used as a number input when `type=\"number\"` is passed to the component.\n\n### States\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224445195-5a403459-ad36-452c-a6c6-7534eb78f3df.png\"\n/>\n\n**Focused:** The input has been navigated to and is ready to accept input.\n\n**Disabled:** The input cannot accept input or become focused.\n\n**Loading:** Some process has been initiated by the input but has not finished.\n\n**Invalid:** The value failed validation.\n\n**Valid:** The value passed validation.\n\nFor more information about the \"valid\" and \"invalid\" states, see the [validation section](https://primer.style/design/ui-patterns/forms#validation) of the form design pattern guidelines.\n\n### Best practices\n\n- Only use placeholder text to show an example of the expected input. Never use placeholder text for critical information.\n- Use the width of the text input to give users a hint about how long the value is expected to be\n- If your field accepts free-form text _or_ an option from a predetermined list, consider using an [autocomplete input](/components/autocomplete)\n\n## Anatomy\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224447079-f95c75d2-5a3a-4175-bf9f-8725ad127a08.png\"\n/>\n\n**Label (required):** The input's title. It should be as concise as possible and convey the purpose of the input. The label may be visually hidden in rare cases, but a label must be defined for assistive technologies such as a screen reader.\n\n**Required indicator:** Indicates that a value is required. Must be shown for any required field, even if all fields in the form are required.\n\n**Input (required):** Accepts user free-form text input\n\n**Leading visual:** An icon or short piece of text to reinforce the purpose of the input. Appears before the input's value.\n\n**Trailing visual:** The same as a leading visual, but appears after the input's value.\n\n**Trailing action:** An action that affects the input. Most commonly used for a button that clears the input.\n\n**Caption:** Provides additional context about the field to help users fill in the correct data or explain how the data will be used. Caption text should be as short as possible. Caption text may be displayed at the same time as a validation message, or it may be hidden if it only provides redundant information.\n\n**Validation message:** A single validation message may be displayed to provide helpful information for a user to complete their task. It is most commonly used to explain why a value is invalid so they can correct it and submit the form.\n\n## Options\n\n### Sizes\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224445197-4b71262c-e1cc-4495-88d5-e46c6474d3cc.png\"\n/>\n\nA text input can be made smaller or larger depending on the context it's being used in.\n\nYou can make an input smaller if it is being used in a tight space with other small elements. You can make an input larger if it's in an open space or feels out of proportion with adjacent large elements.\n\n### Width\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224445198-7217e528-ed15-4fe9-aba9-264c7bc62e1b.png\"\n/>\n\nBy default, a text input will be given a default width by the browser.\n\nHowever, you can render a text input to fill the width of its parent element, or set the width to whatever makes sense for your use-case. When setting a custom width, consider the length of the expected value.\n\n### Monospace\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224445199-c8f27a2b-18e3-4ac7-9764-1d32b1fdc9c7.png\"\n/>\n\nThe value of the text input may be rendered in a monospace font. Use this variant for inputs related to code. For example, setting a personal access token in a configuration.\n\n### With a trailing action\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224445201-7f81cf2c-992c-470b-b702-4b45d57c3234.png\"\n/>\n\nA trailing action may be used to render a single action that affects the input. A trailing action is most commonly used for a button that clears the input.\n\nIdeally the trailing action button is an icon without a text label. It is also possible to render the button with a text label, but it should be avoided whenever possible.\n\nAvoid using a trailing action with a trailing visual.\n\n### With leading and trailing visuals\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224445202-42904c00-1eff-4f57-98ae-045020688b11.png\"\n/>\n\nLeading and trailing visuals are typically shown as an icon to reinforce the purpose of the input.\n\nIcons are preferred, but you may also use a short piece of text in the leading or trailing visual slots when appropriate. For example, text may be used to show a unit such as \"minutes\", \"$\", or \"%\"\n\nAvoid overwhelming the text input by using both a leading and trailing visual. If you're trying to provide more context about the input, consider using text in the input caption.\n\n#### Effects of loading state\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/224445204-0a43967d-fcd7-4cb6-92dd-51fcd25d95d7.png\"\n/>\n\nWhen a text input is processing some action like performing a search, a loading indicator is shown. To avoid a layout shift, either the leading or trailing visual will be replaced with the loading indicator. The text input component has internal logic to decide which visual to replace, but it can be overridden and explicitly set to show at the start or end of the input.\n\n### With tokens\n\nSee [text input with tokens](/components/text-input-with-tokens)\n\n## Accessibility\n\n- Text inputs must be labeled. The label may be visually hidden, but visible labels are preferred.\n- Placeholder text is **never** an acceptable substitute for a label because:\n  - The placeholder text disappears as soon as the input has a value\n  - Placeholder text colors are typically too light to meet the minimum color contrast ratio required for accessibility\n  - Screen readers do not read placeholder text as a label\n\n## Related links\n\n- [Forms](../ui-patterns/forms)\n- [Autocomplete](/components/autocomplete)\n- [Text input with tokens](/components/text-input-with-tokens)\n","parent":{"relativeDirectory":"components","name":"text-input"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/textarea.mdx","frontmatter":{"title":"Textarea"},"rawBody":"---\ntitle: Textarea\ndescription: Textarea is used to set a value that is multiple lines of text.\nreactId: textarea\nfigma: https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=15341%3A47266&t=dvM9ZncRKLs7jQNq-4\n---\n\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/226424284-25f5e2d1-4986-48b3-b856-20a227925eae.png\"\n/>\n\n## Usage\n\nUse a textarea to allow users to input a long string of free-form text.\n\n### States\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/226424285-ba0f63cb-f1fe-42bb-b5f4-1a77ec8f69f5.png\"\n/>\n\n**Focused:** The input has been navigated to and is ready to accept input.\n\n**Disabled:** The input cannot accept input or become focused.\n\n**Invalid:** The value failed validation.\n\n**Valid:** The value passed validation.\n\nFor more information about the \"valid\" and \"invalid\" states, see the [validation section](https://primer.style/design/ui-patterns/forms#validation) of the form design pattern guidelines.\n\n### Best practices\n\n## Anatomy\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/226424286-6cf3c07b-140c-4e86-bfeb-5857509a12c0.png\"\n/>\n\n**Label (required):** The input's title. It should be as concise as possible and convey the purpose of the input. The label may be visually hidden in rare cases, but a label must be defined for assistive technologies such as a screen reader.\n\n**Required indicator:** Indicates that a value is required. Must be shown for any required field, even if all fields in the form are required.\n\n**Input (required):** Accepts user free-form text input\n\n**Caption:** Provides additional context about the field to help users fill in the correct data or explain how the data will be used. Caption text should be as short as possible. Caption text may be displayed at the same time as a validation message, or it may be hidden if it only provides redundant information.\n\n**Validation message:** A single validation message may be displayed to provide helpful information for a user to complete their task. It is most commonly used to explain why a value is invalid so they can correct it and submit the form.\n\n## Options\n\n### Width\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/226424288-001f5f16-94d3-445e-8e61-d7f18acd39b5.png\"\n/>\n\nBy default, a textarea will the width of a line of 30 characters.\n\nYou can change this to be any number of characters, or render the textarea to fill the width of its parent element.\n\n### Height\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/226424290-d32d48a0-9b6b-4899-8c45-2031bbd09a1f.png\"\n/>\n\nBy default, a textarea will the height of 7 lines of text.\n\nYou can change this to be any number of lines. Consider the length of the expected value to set a height.\n\nIf the height of the content exceeds the height of textarea, users can scroll the content or resize the textarea.\n\n### Resizing\n\nBy default, a textarea can be resized vertically and horizontally.\n\nYou can limit a user's resizing options to:\n\n- no resizing\n- only resize vertically\n- only resize horizontally\n\n## Accessibility\n\n- Textareas must be labeled. The label may be visually hidden, but visible labels are preferred.\n- Placeholder text is **never** an acceptable substitute for a label because:\n  - The placeholder text disappears as soon as the input has a value\n  - Placeholder text colors are typically too light to meet the minimum color contrast ratio required for accessibility\n  - Screen readers do not read placeholder text as a label\n\n## Related links\n\n- [Forms](../ui-patterns/forms)\n- [Text input](/components/text-input)\n","parent":{"relativeDirectory":"components","name":"textarea"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/toggle-switch.mdx","frontmatter":{"title":"Toggle switch"},"rawBody":"---\ntitle: Toggle switch\ndescription: Toggle switch is used to immediately toggle a setting on or off.\nreactId: toggle_switch\nrails: https://primer.style/view-components/components/alpha/toggleswitch\n---\n\nimport {Box} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Anatomy\n\n![Diagram of toggle switch with its parts labeled](https://user-images.githubusercontent.com/2313998/226448730-9e4233ec-feff-4982-acce-9aa8ca5beac2.png)\n\n- **Track**: The clickable area where the toggle switch moves back and forth\n- **Knob**: Changes color and position depending on whether the switch is on or off\n- **Status**: A text label showing whether the switch is on or off\n\n## Options\n\n### Label and description\n\n<Box\n  mb={5}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <div>\n    <Box as=\"p\" mt=\"0\">\n      Every toggle switch should have a label that says what is being turned on or off. Optionally, you may include a\n      description about the setting that is being turned on or off.\n    </Box>\n    <Box as=\"p\" mt=\"0\">\n      Labels should be succinct, and can describe an object or an action (for example: \"Discussions\" or \"Automatically\n      watch repositories\"). Don't use phrases that describe the switch's state in your label.\n    </Box>\n  </div>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/2313998/226448731-96a9bc7d-6c4f-4f30-8e32-ff73d0a76474.png\"\n  />\n</Box>\n\n<DoDontContainer>\n  <Do>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/226448719-fd65a0ea-bbfb-4b53-a00d-2ca0db8f0991.png\"\n    />\n    <Caption>Use succinct phrases with verbs or nouns</Caption>\n  </Do>\n  <Dont>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/226448723-86d146d8-1a92-4506-8a5e-106a8bc0b8a7.png\"\n    />\n    <Caption>Don't use phrases that describe the switch's state</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Layout\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <div>\n    <Box as=\"p\" mt=\"0\">\n      By default, lay out a toggle switch horizontally justified with its label and optional description.\n    </Box>\n    <Box as=\"p\" mt=\"0\">\n      You may use a vertical layout when a toggle switch is layed out inline with other content, or if a horizontal\n      layout would put the switch too far from its label. If the vertical layout is left-aligned, the \"on\"/\"off\" text\n      may be moved to the right of the switch.\n    </Box>\n  </div>\n  <Box display=\"flex\" flexDirection=\"column\" sx={{gap: 2, flexGrow: 1, flexShrink: 0}}>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/226448731-96a9bc7d-6c4f-4f30-8e32-ff73d0a76474.png\"\n    />\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/226448741-72a264f6-3269-4d09-8afe-75042a189a54.png\"\n    />\n  </Box>\n</Box>\n\n### Size\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box as=\"p\" mt=\"0\">\n    A small variant is provided to maintain visual hierarchy, or for dense areas where the default size will not fit.\n  </Box>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/2313998/226448738-1dff6c1c-eac3-4a0a-850e-02d579272a11.png\"\n  />\n</Box>\n\n### Loading\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box as=\"p\" mt=\"0\">\n    When a toggle switch is waiting for something to load before toggling, a loading indicator should be displayed. The\n    switch should not prematurely toggle from \"on\" to \"off\". Wait until loading is complete before showing a change.\n  </Box>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/2313998/226448735-1e9f8d24-a084-4cee-ae59-fbabce944d7a.png\"\n  />\n</Box>\n\n### Progressive disclosure\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box as=\"p\" mt=\"0\">\n    The <a href=\"/design/ui-patterns/progressive-disclosure\">progressive disclosure pattern</a> may be used to hide or\n    show content based on whether a toggle switch is on. Content revealed on toggle switch activation should always come{' '}\n    <em>after</em> the toggle switch.\n  </Box>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/2313998/226448736-db898a3c-8b68-4e5e-a4e8-ad1f6d549062.png\"\n  />\n</Box>\n\n## Accessibility\n\n### Keyboard navigation\n\nToggle switches should have the same keyboard navigation features as a button. A toggle switch may be focused using the `Tab` key, and pressing the `Enter` or `Space` key will toggle the switch.\n\n### Touch target\n\nWhen the UI is rendered on a touch-screen device, ensure that the toggle switch has a large enough touch target size. The toggle switch should respond to hovers, clicks, and taps anywhere in the touch target area, even if it isn't directly on the control.\n\n![Diagram showing touch target size on medium and small toggle switches](https://user-images.githubusercontent.com/2313998/226448740-1506ddb5-3cdb-4aef-9a3b-0d66839e7d11.png)\n\n## Mixed values\n\nSince a toggle switch can only be \"on\" or \"off\", it could be confusing to use a switch to represent mixed values.\n\nIf you have a group of configuration options that can be disabled, use a button instead of a toggle switch. Disabling the group turns off all configuration options, but remembers their previous state when the user wants to turn that section back on. While the section is disabled, the configuration options are hidden.\n\n![Configuration options section that can be enabled or disabled. Configuration controls are hidden when it is disabled.](https://user-images.githubusercontent.com/2313998/226448737-ed98e831-ecbc-476e-809a-6799bf73a5f7.png)\n\n<DoDontContainer>\n  <Do>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/226448725-d7cb6db8-9738-4097-89f4-9279fec7400a.png\"\n    />\n    <Caption>Use a button to affect multiple related toggles</Caption>\n  </Do>\n  <Dont>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/226448727-20d008fa-866b-4c6d-849a-81941e5d09eb.png\"\n    />\n    <Caption>Don't use a toggle switch to represent mixed values</Caption>\n  </Dont>\n</DoDontContainer>\n\n## Toggle switch vs checkbox\n\nToggle switches are buttons that change and save a boolean configuration option when they are toggled.\nCheckboxes are form inputs that are used to select one or more items from a list, and are not saved without explicit confirmation such as pressing a **Save** button.\n\nA toggle switch should never be used as a replacement for a checkbox. See [saving patterns](/ui-patterns/saving) for more details.\n\n<DoDontContainer>\n  <Do>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/226448728-73c5ca2d-82c4-4d8a-b043-d200dff3ae16.png\"\n    />\n    <Caption>Use a toggle switch like a button</Caption>\n  </Do>\n  <Dont>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/226448729-46e2b1e1-61ed-4773-bdba-29f7c0174052.png\"\n    />\n    <Caption>Don't use a toggle switch as a replacement for a checkbox</Caption>\n  </Dont>\n</DoDontContainer>\n","parent":{"relativeDirectory":"components","name":"toggle-switch"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/token.mdx","frontmatter":{"title":"Token"},"rawBody":"---\ntitle: Token\ndescription: Token is a compact representation of an object, and is typically used to show a collection of related metadata.\nreactId: token\n---\n\nimport {Box} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Overview\n\nTokens almost always appear in a group. A group of tokens may be read-only, or they may be used as a way to input data.\n\nA read-only group of tokens organizes information in a way that helps users quickly scan and understand the view they're on. For example, a list of topics associated with a repository.\n\nTokens may be used for data input to quickly add and remove items to a list of related attributes. For example, defining a list of GitHub users who can access a private repo.\n\n## Anatomy\n\n<Box\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 2}}\n>\n  <img\n    width=\"456\"\n    alt=\"token anatomy diagram\"\n    src=\"https://user-images.githubusercontent.com/2313998/137778682-ee35f8e0-72de-4a24-b1bd-e4ea02e2ac49.png\"\n  />\n  <Box as=\"ul\" mt=\"0\">\n    <Box as=\"li\" mt=\"0\">\n      <strong>Leading visual</strong> (optional): Provides additional context (e.g.: user avatar)\n    </Box>\n    <Box as=\"li\">\n      <strong>Label</strong> (required): Concise text label\n    </Box>\n    <Box as=\"li\">\n      <strong>Remove button</strong> (optional): Removes the token from an editable group of tokens\n    </Box>\n  </Box>\n</Box>\n\n## Interactivity\n\nTokens are almost always interactive. When a token is interactive, it will react to cursor hover and keyboard focus.\n\nWhile tokens may have the same interactivity as a button or a link, a token should not be used as a replacement for a button.\n\nIf a token is a link or button _and_ it has a remove button, keyboard focus will only go to the link/button. Keyboard users can remove a token by focusing the link/button and pressing \"Backspace\" or \"Delete\". When a screen reader is focused on a removable token, it will read the token's label and tell users to press \"Backspace\" or \"Delete\" to remove it.\n\nExamples of interactions:\n\n- An issue label token that links to a list of issues with that label\n- A user token that shows a profile summary dialog on hover\n\n## Sizing\n\n<Box\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"tokens rendered at all sizes\"\n    src=\"https://user-images.githubusercontent.com/2313998/137771748-ee4d796a-7bf0-4384-bb75-a239f358ede6.png\"\n  />\n  <Box>\n    <Box as=\"p\" mt=\"0\">\n      Different token sizes can be used to maintain visual harmony with the other content on the screen or to maintain a\n      comfortable touch target for interactive tokens.\n    </Box>\n    <Box as=\"p\">\n      Keep visual hierarchy in mind. Large tokens should not visually compete with elements that have a higher priority.\n    </Box>\n    <Box as=\"p\">A group of tokens should not have tokens of different sizes.</Box>\n  </Box>\n</Box>\n\n## Grouping tokens\n\n<Box\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"a group of tokens flowing over multiple lines\"\n    src=\"https://user-images.githubusercontent.com/2313998/137771744-ee968841-8b5c-437c-83cc-9f693e35e5f0.png\"\n  />\n  <Box>\n    <Box as=\"p\" mt=\"0\">\n      A group of tokens should flow like words in a paragraph, not a vertical list. This keeps the group compact to\n      improve scannability.\n    </Box>\n    <Box as=\"p\">Tokens that represent different types of data should not be grouped together.</Box>\n    <Box as=\"p\">Interactive tokens should not be grouped with non-interactive tokens.</Box>\n  </Box>\n</Box>\n<Box\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"a group of tokens restricted to one line with a counter for hidden tokens\"\n    src=\"https://user-images.githubusercontent.com/813754/224695100-072f966a-b797-4224-a2fd-8db8cd526f74.png\"\n  />\n  <Box>\n    <Box as=\"p\" mt=\"0\">\n      When space is limited, like in a table, some tokens in a group may be hidden. The amount hidden tokens is added in a text label, e.g. `+3`. Make sure to add an accessible label like `3 more tokens` to make this screen reader accessible.\n    </Box>\n    <Box as=\"p\">It is important to make sure that the detail view of the list item allows users to access all tokens.</Box>\n  </Box>\n</Box>\n\n### Within a text input field\n\n<Box\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"tokens rendered at all sizes\"\n    src=\"https://user-images.githubusercontent.com/2313998/137771745-049129e6-5a79-4940-bf1b-633e0c203109.png\"\n  />\n  <Box>\n    <Box as=\"p\" mt=\"0\">\n      By default, tokens wrap to the next line and expand the height of the input. This allows users to see many tokens\n      at once.\n    </Box>\n    <Box as=\"p\">\n      To limit how large the input can grow, a maximum height can be defined. After the input grows past that maximum\n      height, it will scroll vertically.\n    </Box>\n  </Box>\n</Box>\n\n<Box\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"tokens rendered at all sizes\"\n    src=\"https://user-images.githubusercontent.com/2313998/137771747-6ed54c3b-ddc7-42d2-ad55-db702c8d8093.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    If the input is being used in a spot where the input height cannot grow, tokens can be forced to a single line that\n    scrolls horizontally.\n  </Box>\n</Box>\n\n## Tokens as a way to enter information\n\n<Box\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 4}}\n>\n  <img\n    width=\"456\"\n    alt=\"text input with tokens inside with an autocomplete menu below it\"\n    src=\"https://user-images.githubusercontent.com/2313998/137771742-0d6553f2-1d34-44c2-bfcb-f39c56b5b3d1.png\"\n  />\n  <Box>\n    <Box as=\"p\" mt=\"0\">\n      If tokens are being used for data input, it should be obvious that the user is in an edit or creation context.\n    </Box>\n    <Box as=\"p\">\n      Tokens can be added or removed from a group in the way that makes the most sense for your use case. We recommend\n      using an <a href=\"/design/components/autocomplete\">autocomplete</a> component to allow users to sort through a\n      list to pick options.\n    </Box>\n    <Box as=\"p\">\n      The remove button is the recommended way for removing a token from a group, but you can hide it if there is a\n      simple alternative that makes more sense for your use case. You can also keep the remove button visible while\n      still providing other ways to remove the button from a group.\n    </Box>\n  </Box>\n</Box>\n\n## Accessibility\n\nTo make tokens accessible to keyboard users and those who require accessible contrasts, make sure to fulfill the requirements below.\n\n- `4.5:1` contrast between the label (text and icon) of the token and it's background\n- when in focus a token must have a visible focus outline\n- if a token can be removed, the keyboard focus must be moved to the previous token after deletion. If no token remains, it must focus on the input itself.\n- if a close button is used, it’s name should use the token’s label to make it unique","parent":{"relativeDirectory":"components","name":"token"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/color.mdx","frontmatter":{"title":"Color"},"rawBody":"---\ntitle: Color\ndescription:\n  Color is a fundamental piece in the Primer visual language. In this guide you will learn about the principles,\n  patterns, and abstractions that make Primer’s color system.\n---\n\nimport {Box, Heading} from '@primer/react'\n\n## Get started\n\n<img\n  width=\"960\"\n  alt=\"Image showing the two different types of color modes: light mode and dark mode\"\n  src=\"https://user-images.githubusercontent.com/6951037/146927448-cb518377-114a-4ab8-a37e-1eeffc8732c7.png\"\n/>\n\nGitHub's UI offers a variety of different color modes. Every pattern in Primer is built to work across all color modes out of the box.\n\nWhen designing product interfaces in Figma, we recommend using light mode. This is best because the Primer Figma components are only available in light mode.\nTo preview your work in other modes, use the [Figma color mode plugin](https://www.figma.com/community/plugin/992128487074360945/Change-Color-Mode).\n\n## How to use color for product UI\n\nPrimer delivers colors in the form of [design tokens](https://primer.style/primitives/colors). Design tokens are a layer of abstraction that allows better maintainability, consistency and easy theming.\n\nFor example use `bg-default` for the background of the page and `fg-default` for the text color. If the user changes to dark mode, the underlying color that those tokens reference change, but the token names stay the same.\n\n<img\n  width=\"960\"\n  alt=\"Same component shown in light mode and dark mode color palettes\"\n  src=\"https://user-images.githubusercontent.com/813754/187436947-875dbf46-1b26-42da-b96f-e7cbe315f0eb.png\"\n/>\n\n### Color design tokens are grouped based on their purpose:\n\n- **Presentational:** To represent a color. For example, the color steps in the Primer scale are named by color and lightness, such as `scale.blue.5`. These design tokens don't support color modes.\n- **Functional:** To convey a meaning or a state. For example, from a functional perspective the color green is used to reinforce positive messaging. In a functional system, green design tokens are named with the suffix `.success`.\n- **Component:** To represent a specific use case. For example, `button.bg` references from the system to be used as the background of a button component.\n\nAs the system grows, it will provide more APIs that fit different color needs. Check the [Primer Primitives](https://github.com/primer/primitives/releases/) repository to follow along as we release new design tokens and systems.\n\n### Functional system\n\nThe functional system is based on the meaning, or purpose, that colors have in the interface. Use functional design tokens in designs and code to build product interfaces.\n\nBy using Primer's functional color system you make sure that your interface:\n\n- supports color modes out of the box\n- gets all future themes updates \"for free\"\n- uses [accessible color combination](#combining-colors) across themes\n\nThe functional system is structured into two groups of design tokens:\n\n- **Foundations:** Foregrounds (text and icons), backgrounds, and borders that make up most of a product interface.\n\n<img\n  width=\"960\"\n  alt=\"Dark gray, midtone gray and light gray swatches as example of foundational colors\"\n  src=\"https://user-images.githubusercontent.com/6951037/146926823-b8489e82-978d-4aed-b186-2dcc70691fc7.png\"\n/>\n\n- **Color roles:** Foregrounds (text and icons), backgrounds, and borders that highlight affordance or the meaning of elements in the UI.\n\n<img\n  width=\"1200\"\n  alt=\"Accent: blue, Success: green, Attention: yellow, Danger: red, Severe: orange, Open: green, Closed: red, Done: purple\"\n  src=\"https://user-images.githubusercontent.com/378023/156498624-0e71a46b-9e1d-40c0-9f4a-18e37184b06e.png\"\n/>\n\n### Foregrounds\n\nForeground elements are **text and icons**. You can apply color to them by using any of the `fg` (short for foreground) design tokens.\n\n| Foundations                                                                         | Usage                                                                                                                                |\n| :---------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------- |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=fg.default) `fg.default`       | Primary color for text and icons in any given interface. It should be used for body content, titles and labels.                      |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=fg.muted) `fg.muted`           | Use for content that is secondary or that provides additional context but is not critical to understanding the flow of an interface. |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=fg.subtle) `fg.subtle`         | Use for placeholder text, icons or decorative foregrounds.                                                                           |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=fg.onEmphasis) `fg.onEmphasis` | On emphasis is the text color designed to combine with `.emphasis` backgrounds for optimal contrast.                                 |\n\n| Color roles                                                                       | Usage                                                               |\n| :-------------------------------------------------------------------------------- | :------------------------------------------------------------------ |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=accent.fg) `fg.accent`       | Use for interactive text or icons like links or buttons.            |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=success.fg) `fg.success`     | Use to emphasize a positive message.                                |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=attention.fg) `fg.attention` | Use to highlight text or icons that require the user's attention.   |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=danger.fg) `fg.danger`       | Use to emphasize an error or a blocking status. Action is required. |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=severe.fg) `fg.severe`       | Use to emphasize a level of severity between attention and danger.  |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=open.fg) `fg.open`           | Use to style text that refers to open tasks or workflows.           |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=closed.fg) `fg.closed`       | Use to style text that refers to closed tasks or workflows.         |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=done.fg) `fg.done`           | Use to style text that refers to completed tasks or workflows.      |\n\n### Backgrounds\n\nBackground colors apply to surfaces of components or UI elements, such as pages, boxes, and overlays.\n\n| Foundations                                                                              | Usage                                                                                                              |\n| :--------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------- |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=neutral.emphasisPlus) `bg.emphasis` | Provides the highest contrast against the default background, such as in tooltips.                                 |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=canvas.default) `bg.default`        | Primary background color.                                                                                          |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=canvas.subtle) `bg.subtle`          | Provides visual rest and contrast against the default background.                                                  |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=canvas.inset) `bg.inset`            | Can be used instead of the default background to create a focal point, such as in conversations or activity feeds. |\n\n| Color roles                                                                                        | Usage                                                                          |\n| :------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------- |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=accent.subtle) `bg.accent`                    | Use to accentuate interactive areas in the UI like selected elements.          |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=success.subtle) `bg.success`                  | Use to highlight a positive message.                                           |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=attention.subtle) `bg.attention`              | Use to highlight elements that require a user's attention or pending statuses. |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=danger.subtle) `bg.danger`                    | Use to emphasize an error or a blocking status, where action is required.      |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=severe.subtle) `bg.severe`                    | Use to emphasize an extra level of severity between attention and danger.      |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=open.subtle) `bg.open`                        | Use to style text that refers to open tasks or workflows.                      |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=closed.subtle) `bg.closed`                    | Use to style text that refers to closed tasks or workflows.                    |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=done.subtle) `bg.done`                        | Use to style text that refers to completed tasks or workflows.                 |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=accent.emphasis) `bg.[ANY_OF_ABOVE].emphasis` | Use to highlight the most important item of a view or an interface.            |\n\n### Borders\n\nBorders can be used to group content or to create a visible separation between sections or items. They’re most commonly used on tables, side sections, and cards.\n\n| Foundations                                                                           | Usage                                                                                                                                 |\n| :------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------ |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=border.default) `border.default` | Use to create bounds around content, for example elements inside a card. Default borders are critical to understanding a page layout. |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=border.muted) `border.muted`     | Use for dividers to emphasize the separation between items, columns or sections.                                                      |\n\n| Color roles                                                                                    | Usage                                                                         |\n| :--------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=accent.muted) `border.accent`             | Use to accentuate interactive areas in the UI like selected elements.         |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=success.muted) `border.success`           | Use to highlight a positive message.                                          |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=attention.muted) `border.attention`       | Use to highlight elements that require a users attention or pending statuses. |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=danger.muted) `border.danger`             | Use to emphasize an error or a blocking status. Action is required.           |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=severe.muted) `border.severe`             | Use to emphasize an extra level of severity between attention and danger.     |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=open.muted) `border.open`                 | Use to style text that refers to open tasks or workflows.                     |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=closed.muted) `border.closed`             | Use to style text that refers to closed tasks or workflows.                   |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=done.muted) `border.done`                 | Use to style text that refers to completed tasks or workflows.                |\n| ![\"\"](https://swatch-sid.vercel.app?mode=light&token=accent.emphasis) `border.[ROLE].emphasis` | Use to highlight the most important item of a view or an interface.           |\n\n## Functional system in action\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <Box>\n    <img\n      width=\"464\"\n      alt=\"Table component showing the combination of bg.subtle with border.default, and border.muted\"\n      src=\"https://user-images.githubusercontent.com/6951037/145223860-4db73d78-8791-44db-b94d-c7966ce13fab.png\"\n    />\n    <Caption>Example of pairing foundation tokens: bg.subtle with border.default, and border.muted.</Caption>\n  </Box>\n  <Box>\n    <img\n      width=\"464\"\n      alt=\"UI demonstration of what bg.inset looks like. It darkens the background of the whole UI\"\n      src=\"https://user-images.githubusercontent.com/6951037/145223862-2ea9027c-1474-47d0-8caf-8ab8d93a841b.png\"\n    />\n    <Caption>\n      Thinking in terms of elevation, bg.inset would represent an underground level. It's meant to create a feeling of\n      focus or depth.\n    </Caption>\n  </Box>\n</Box>\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <Box>\n    <img\n      width=\"464\"\n      alt=\"Example of a hover style on a list where the background uses bg.accent.emphasis and the text uses fg.onEmphasis.\"\n      src=\"https://user-images.githubusercontent.com/6951037/141304060-1e3d5285-f80f-4363-8c07-e5865c6fe073.png\"\n    />\n    <Caption>\n      fg.onEmphasis pairs with bg.[ANY_COLOR_ROLE].emphasis tokens. This example shows fg.onEmphasis paired with\n      bg.accent.emphasis.\n    </Caption>\n  </Box>\n  <Box>\n    <img\n      width=\"464\"\n      alt=\"Green success alert with check icon, pairing bg.success, fg.success, and border.success color tokens\"\n      src=\"https://user-images.githubusercontent.com/6951037/141304173-5f919074-b5ae-4c0b-b5d2-8a2cd6ea2d03.png\"\n    />\n    <Caption>An example of an alert that pairs bg.success, fg.success, and border.success.</Caption>\n  </Box>\n</Box>\n\n## Combining colors\n\nNot all colors pair well with each other. There are combinations of backgrounds and foregrounds that guarantee compliance with WCAG contrast guidelines and a wide range of hierarchical relationships between elements. Never use color on its own to convey a message or meaning. Pair it with explicit text and icons instead.\n\n### Pairing color roles\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/6951037/146400758-3f487fe3-c07a-4b5c-b190-99f81f0efdb2.png\"\n      alt=\"\"\n    />\n    <Caption>Pair color role foregrounds with their background counterparts or with bg.default and bg.subtle.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/6951037/146400887-e9340e29-688f-4320-b633-e9f02b93cde5.png\"\n      alt=\"\"\n    />\n    <Caption>Never pair emphasis foregrounds with emphasis background.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Color roles and foregrounds\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/6951037/146401147-33bef1f2-a53c-4d06-b20d-3dc32eb1879f.png\"\n      alt=\"\"\n    />\n    <Caption>Only use fg.muted with bg.default, bg.subtle, and bg.inset.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/6951037/146401229-60f13aa3-e3c4-4125-8879-829a769c7365.png\"\n      alt=\"\"\n    />\n    <Caption>Never use fg.muted on bg.emphasis or any of the color roles backgrounds.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Color roles recipes\n\n<img\n  width=\"1200\"\n  alt=\"Combination of design tokens 1: bg.[COLOR-ROLE] + border.[COLOR-ROLE] + fg.[COLOR-ROLE]\"\n  src=\"https://user-images.githubusercontent.com/378023/156498633-d6e47cb1-64b4-46fb-90d6-65a5c4c6a2bc.png\"\n/>\n<img\n  width=\"1200\"\n  alt=\"Combination of design tokens 2: bg.[COLOR-ROLE] + border.[COLOR-ROLE].emphasis + fg.[COLOR-ROLE]\"\n  src=\"https://user-images.githubusercontent.com/378023/156498642-f86a24b7-53ea-4b1e-ab47-0529587b08ef.png\"\n/>\n<img\n  width=\"1200\"\n  alt=\"Combination of design tokens 3: bg.default + border.[COLOR-ROLE].emphasis + fg.[COLOR-ROLE]\"\n  src=\"https://user-images.githubusercontent.com/378023/156498649-e81a19bf-c94e-436e-9efc-258a1fd3be57.png\"\n/>\n<img\n  width=\"1200\"\n  alt=\"Combination of design tokens 4: bg.[COLOR-ROLE] + border.[COLOR-ROLE] + fg.default\"\n  src=\"https://user-images.githubusercontent.com/378023/156498652-b1121c86-a670-4a92-9a8d-9db3c7e0ed9a.png\"\n/>\n\n## Accessibility\n\nWhen designing with colors consider the following to make your UI visually accessible.\n\n### Assure adequate color contrast\n\nColor contrast between text and its background must meet [required WCAG standards](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n\nThe contrast requirements are:\n\n- 4.5:1 for normal text\n- 3:1 for large text (>24px)\n- 3:1 for UI elements and graphics\n- No contrast requirement for decorative and disabled elements\n\nUse an [online contrast checker](https://webaim.org/resources/contrastchecker/) or a [Figma plugin](/guides/accessibility/tools#contrast-plugin) to test your contrast.\n\nIf you work with the [functional colors](#color-roles-recipes), this work has already been done for you. We checked all recommended combinations, so you are all set.\n\n### Don't rely on color alone\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  alignItems=\"center\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box as=\"p\" mt=\"0\">\n    <Heading sx={{mt: 0, mb: 3, fontSize: 2}} as=\"h4\">\n      Show state with more than color\n    </Heading>\n    Color vision deficiency is different for different people. To make sure everyone can understand and use your UI you should\n    show state with more than a change in color. For example by using icons or changing the content.\n  </Box>\n  <img\n    width=\"456\"\n    alt=\"Example icon that uses a distinct shape in addition to color to indicate an error.\"\n    src=\"https://user-images.githubusercontent.com/813754/187186864-8a825434-978b-4e21-bac2-9c1235d75e2c.png\"\n  />\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  alignItems=\"start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box as=\"p\" mt=\"0\">\n    <Heading sx={{mt: 0, mb: 3, fontSize: 2}} as=\"h4\">\n      Connect labels to graphs with lines or patterns\n    </Heading>\n    For charts and graphs you can position the labels on top or close to each section. You can also use patterns to distinguish\n    different parts.\n  </Box>\n  <img\n    width=\"456\"\n    alt=\"Two graphs. One is a line graph and one is a pie graph. The line graph is demonstrating using unique shapes for each comparison line's plot symbol. The pie chart is demonstrating how each slice's label can use a line to point to its corresponding slide.\"\n    src=\"https://user-images.githubusercontent.com/813754/187186931-84bcc541-7cea-45f2-a686-21c5428e0620.png\"\n  />\n</Box>\n\n## Color outside the functional system\n\nPrimer does not currently provide a presentational or data visualization color system. If you or your team at GitHub are working on a feature that has color needs beyond the functional system, please open an issue in the [github/primer](https://github.com/github/primer/issues) repository (only available to GitHub staff).\n\n## How to use colors in Primer libraries?\n\nPrimer colors exist in different formats and are made available throughout the Primer libraries and tools. Not all colors exist everywhere and the naming depends on the Primer library. Below a list to help find the right Primer color documentation that is specific to that role and environment.\n\n| I am                                                   | Documentation                                                                            | Example color usage     |\n| ------------------------------------------------------ | ---------------------------------------------------------------------------------------- | ----------------------- |\n| A product **designer** working in **Figma**            | [Primer Primitives](https://www.figma.com/file/B5XPE8IwGPIZDAvN7jqWqx/Primer-Primitives) | `bg/accent`             |\n| An **engineer** using **Primer ViewComponents**        | [color system arguments](https://primer.style/view-components/system-arguments#color)    | `bg: :accent`           |\n| An **engineer** using **Primer React**                 | [sx props](https://primer.style/react/overriding-styles)                                 | `accent.subtle`         |\n| An **engineer** creating **custom UI**                 | [Primer CSS color utilities](https://primer.style/css/utilities/colors)                  | `color-bg-accent`       |\n| A Primer **React maintainer** creating a **component** | [Primer Primitives js properties](https://primer.style/primitives/colors)                | `accent.subtle`         |\n| A Primer **CSS maintainer** creating a **component**   | [Primer Primitives css variables](https://primer.style/primitives/colors)                | `--color-accent-subtle` |\n\nStuck choosing the right color? Feel free to reach out in the [#primer](https://github.slack.com/archives/CSGAVNZ19) Slack channel.\n","parent":{"relativeDirectory":"foundations","name":"color"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/tree-view.mdx","frontmatter":{"title":"Tree view"},"rawBody":"---\ntitle: Tree view\ndescription:\n  Tree view is a hierarchical list of items that may have a parent-child relationship where children can be toggled\n  into view by expanding or collapsing their parent item.\nreactId: tree_view\n---\n\nimport {Box} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n## Anatomy\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  src=\"https://user-images.githubusercontent.com/2313998/187719332-3ef9aa9e-476f-4e5a-93fa-5fbd203ece4a.png\"\n/>\n\n1. **Parent node**: A node that hides and shows child nodes by expanding and collapsing\n2. **End node**: A node with no children\n3. **Nesting level indicator lines**: Each line represents a level of nesting depth\n4. **Chevron**: Toggles a parent node expanded or collapsed and indicates expanded/collapsed state\n5. **Leading visual (optional)**: A visual cue for additional context\n6. **Node label**: The text label for the node\n7. **Trailing visual (optional)**: Same as a leading visual, but at the end\n\n## Content\n\n### Node label\n\nNode labels should be a succinct title for whatever entity the node represents. For example, a file name.\n\nBy default, labels are truncated to a single line. However, node labels may be wrapped to multiple lines in cases where the entire label must always be visible.\n\nWhen a node's text is truncated, it should still be accessible to users via a browser-native tooltip.\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n  <Box as=\"figure\" role=\"presentation\" m={0}>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"2 1 singleLineTruncation\"\n      src=\"https://user-images.githubusercontent.com/2313998/187719335-efd76d7a-40dc-4bc8-8053-64211dd97b51.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Single line truncation\n    </Caption>\n  </Box>\n  <Box as=\"figure\" role=\"presentation\" m={0}>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"2 2 multiLineLabel\"\n      src=\"https://user-images.githubusercontent.com/2313998/187719336-d85f8886-75d1-4b74-9e7a-766dd1fbc29d.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Wrapping node label text\n    </Caption>\n  </Box>\n</Box>\n\n### Leading and trailing visuals\n\nLeading and trailing visuals may be used as visual cues that communicate more information about a node.\n\nIf the leading or trailing visual contains useful information, make sure it has a screen-reader accessible text label. Note that the file and folder icons are not considered useful information, as the TreeView's underlying markup will communicate their presence.\n\nEither all nodes have leading visuals, or no nodes have leading visuals. Leading visuals must be accompanied by a text label.\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"3 1 DO-consistentLeadingViz\"\n      src=\"https://user-images.githubusercontent.com/2313998/187719338-9f860dfa-2110-4cf7-8d3b-583ff569605f.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Render all nodes with leading visuals and text labels or just with text labels\n    </Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"3 2 DONT-mixLeadingViz\"\n      src=\"https://user-images.githubusercontent.com/2313998/187719339-83fd7065-5b85-427f-8650-7fc0cae7214d.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">\n      Don't have a tree where only some nodes have leading visuals\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\n## Interaction\n\nKeyboard users can expand or collapse nodes without activating them by using the left and right arrow keys.\n\nTo give cursor users an equivalent experience, there are two click areas:\n\n- clicking the chevron only expands or collapses the node\n- clicking anywhere else will activate the node\n\nIf the node cannot be activated, clicking anywhere on the node will expand it.\n\n<Box\n  display=\"flex\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box as=\"figure\" role=\"presentation\" m={0}>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"4 1 hoverActivatable\"\n      src=\"https://user-images.githubusercontent.com/2313998/187719340-6f62c500-cd70-48b2-8fcf-18a7b6ef3151.png\"\n    />\n    <Caption role=\"presentation\" color=\"fg.subtle\">Two click areas - toggle expanded or activate link</Caption>\n  </Box>\n\n  <Box as=\"figure\" role=\"presentation\" m={0}>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"4 2 hoverOnlyExpandable\"\n      src=\"https://user-images.githubusercontent.com/2313998/187719342-d4f9f6e9-6446-4479-846f-6d7c31fd832b.png\"\n    />\n    <Caption color=\"fg.subtle\">One click area - toggle expanded</Caption>\n  </Box>\n</Box>\n\nNodes may not contain any other interactive elements besides the chevron. Activating a node can only perform one action. For example, following a link.\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"5 1 DO-singleActionPerNode\"\n      src=\"https://user-images.githubusercontent.com/2313998/187719344-abc7cfeb-82b0-4279-96df-ae732828c063.png\"\n    />\n    <Caption color=\"fg.subtle\">Limit nodes to a single action</Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"5 2 DONT-multiActionsPerNode\"\n      src=\"https://user-images.githubusercontent.com/2313998/187719346-0a3ad806-17a0-4414-a82b-7a1d78be7902.png\"\n    />\n    <Caption color=\"fg.subtle\">Don't put other interactive elements in a node</Caption>\n  </Dont>\n</DoDontContainer>\n\nWe have investigated the feasibility of supporting a context menu for each node, and that could be something we support in the future if we find we need it.\n\n### States\n\n<img\n  width=\"960\"\n  role=\"presentation\"\n  alt=\"6 nodeStates\"\n  src=\"https://user-images.githubusercontent.com/2313998/187719347-b795a78e-a09e-4c19-9b90-1f181927e936.png\"\n/>\n\nNodes have different visual treatments to indicate their state and hint what kind of user input they're ready to receive. These styles are inherited from the [action list](/components/action-list) component.\n\n## Nesting\n\nNodes are visually nested using whitespace and alignment.\n\n### Align leading icons\n\n<Box as=\"figure\" display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} m={0} sx={{gap: 3}}>\n  <Box flex={1}>\n    Icons at the same level are center-aligned. The chevron should not break the alignment: parent nodes and child nodes\n    keep their leading visuals aligned.\n  </Box>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    alt=\"19 leadingVizAlignment\"\n    src=\"https://user-images.githubusercontent.com/2313998/187768704-08fac391-f331-4a47-9181-073f1360677c.png\"\n  />\n</Box>\n\n### Indentation\n\n<Box as=\"figure\" display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} m={0} sx={{gap: 3}}>\n  <Box flex={1}>Each level of nesting increments the size of the indentation.</Box>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    alt=\"20 nodesWithIndentations\"\n    src=\"https://user-images.githubusercontent.com/2313998/187768706-1910025a-f69b-487f-987b-319f3022cd09.png\"\n  />\n</Box>\n\n### Nesting level indicator lines\n\nOn devices with `:hover` support, the nesting indicator lines fade in when the user mouses over the entire component, or when there's focus inside the component.\n\nOn devices without `:hover`, the nesting indicator lines appear at all times.\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    alt=\"21 1 showLinesOnHover\"\n    src=\"https://user-images.githubusercontent.com/2313998/187768708-805527f9-3b7c-4f6b-ae37-e232f83916b6.png\"\n  />\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    alt=\"21 2 alwaysShowLinesOnTouch\"\n    src=\"https://user-images.githubusercontent.com/2313998/187768711-2702a7aa-e902-4568-ab99-4570e28bf646.png\"\n  />\n</Box>\n\n### Handling deeply nested nodes\n\nNavigating through deeply nested nodes can be cumbersome and visually clunky. If accessing nodes deeper than 10 levels deep is a common interaction for your use-case, reconsider whether a tree view is the best pattern.\n\nTree views are designed to be horizontally compact in order to support many levels of nesting and long node labels. This makes content truncation and horizontal overflow less likely to occur for deeply nested nodes, but infinite nesting makes those cases impossible to prevent entirely.\n\nThere are some strategies to avoid a tree view that horizontally overflows it's container:\n\n- Allow the tree view's container to be manually resized\n- Once a certain depth is reached, start the tree view from a deeper parent node and provide a way to navigate back up the tree\n- Remove leading and trailing visuals\n\nIf a tree view is truly the best pattern for your use-case and none of the suggested strategies prevent horizontal overflow, opt for horizontal scrolling as a last resort instead of hiding overflowing content.\n\n## Usage\n\n### Tree views are only for hierarchical lists\n\nA tree view solves a very specific problem. It's not a multi-purpose tool like an [action list](/action-list).\n\n<Text as=\"p\" m={0}>\n  Before reaching for a tree view, first make sure that:\n</Text>\n\n<Box as=\"ul\" mt={0}>\n  <li>the items in the tree view represent a list</li>\n  <li>the list items are likely to have a parent-child relationship with more than 1 level of nesting</li>\n  <li>the expand and collapse behavior aids in navigation instead of just making it more complex</li>\n</Box>\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n\n<Box flex={1}>\n  <Text as=\"p\" m={0}>\n    Some good cases for a tree view are:\n  </Text>\n  <Box as=\"ul\" mt={0}>\n    <li>navigating the file structure of a repo</li>\n    <li>navigating a codebase's symbols (types, constants, functions, etc) organized by their scope hierarchy</li>\n  </Box>\n</Box>\n\n<Box flex={1}>\n  <Text as=\"p\" m={0}>\n    A tree view would <strong>not</strong> be appropriate for:\n  </Text>\n  <Box as=\"ul\" mt={0}>\n    <li>global sidebar navigation</li>\n    <li>an FAQ that collapses answers under question headings</li>\n  </Box>\n</Box>\n\n</Box>\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"7 1 DO-useForList\"\n      src=\"https://user-images.githubusercontent.com/2313998/187719349-c028a00f-0a27-4be2-bf67-815c2a036916.png\"\n    />\n    <Caption color=\"fg.subtle\">Use a tree view for a list</Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"7 2 DONT-useForAccordion\"\n      src=\"https://user-images.githubusercontent.com/2313998/187719350-de23e9ac-fd10-4e56-b2a4-aca93255adb7.png\"\n    />\n    <Caption color=\"fg.subtle\">Don't use a tree view for expanding and collapsing sections of content</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Expanding and collapsing nodes\n\nA tree view can be a frustrating pattern if it forces users to spend a lot of time expanding and collapsing nodes to find what they're looking for.\n\n#### Expanded by default\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n  <figcaption>\n    <p>When a child node is active, all of it's parent nodes should be expanded.</p>\n    <p>If it's likely that a user will want to interact with all or most of the nodes in the tree, render the tree with all parent nodes expanded to start. For example: when reviewing a pull request, all of the changed files are shown to make it easy for reviewers to scan and navigate the changed files.</p>\n  </figcaption>\n\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    alt=\"8 openActiveParentNodes\"\n    src=\"https://user-images.githubusercontent.com/2313998/187719353-6708e315-28fb-422a-b65a-942ec963c36d.png\"\n  />\n</Box>\n\n#### Preserve expanded state when parent node is collapsed\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n  <Box flex={1}>\n    If a user expands nested parent nodes and then collapses a parent node higher in the hierarchy, persist the expanded\n    parent nodes lower in the hierarchy. It could be frustrating to have to re-expand the nodes that were already\n    opened.\n  </Box>\n  <CustomVideoPlayer\n    width=\"456\"\n    loop\n    src=\"https://user-images.githubusercontent.com/2313998/187719354-305a5e91-0ea5-444a-a670-3903bdba3761.mp4\"\n  />\n</Box>\n\n#### Optionally combine parent nodes\n\n<Box as=\"figure\" role=\"presentation\" m={0}>\n  <Box as=\"figcaption\" mb={3}>\n    If no end nodes are in the ancestry and the parent nodes cannot be activated, you may combine parent nodes into a\n    single parent node to reduce the levels of nesting. Less levels of nesting make for a more compact tree and less\n    nodes for the user to expand to get to child nodes.\n  </Box>\n\n  <img\n    width=\"960\"\n    role=\"presentation\"\n    alt=\"10 combiningParentNodes\"\n    src=\"https://user-images.githubusercontent.com/2313998/187768688-4aeb4c79-5393-4e30-9da7-3a74b9d42257.png\"\n  />\n</Box>\n\n### Asynchronously loading child nodes\n\n#### Show placeholder nodes (preferred)\n\n<Box as=\"figure\" role=\"presentation\" m={0}>\n  <Box as=\"figcaption\" mb={3}>\n    When we know the number of loading child nodes, show \"skeleton\" nodes until the nodes finish loading. This reassures\n    the user that their request is in progress and provides a minimal preview of what's loading.\n  </Box>\n  <img\n    width=\"960\"\n    role=\"presentation\"\n    alt=\"11 skeletonLoadingNodes\"\n    src=\"https://user-images.githubusercontent.com/2313998/187719358-d3021980-4769-455d-9b7e-b295ffe5ccc6.png\"\n  />\n</Box>\n\n#### General loading indicator (fallback)\n\n<Box as=\"figure\" role=\"presentation\" m={0}>\n  <Box as=\"figcaption\" mb={3}>\n    When we don't know the number of loading child nodes, show a generic loading indicator.\n  </Box>\n  <img\n    width=\"960\"\n    role=\"presentation\"\n    alt=\"12 genericLoadingNodes\"\n    src=\"https://user-images.githubusercontent.com/2313998/187719359-bff335dc-fae5-4a82-9de9-752919309f61.png\"\n  />\n</Box>\n\n#### Handling loading errors\n\n<Box m={0}>\n  <div>\n    <p>\n      Inform users why the data cannot be retrieved and give them a path to resolve it. The error message cannot appear\n      in the tree view because it is not semantically a node in the tree. Instead, the error message should appear in a{' '}\n      <a href=\"/design/components/dialog\">dialog</a> with an optional call-to-action that can resolve the error.\n    </p>\n    <p>\n      If the user dismisses the dialog, focus should be moved back to the collapsed parent node. If the user clicks a\n      call-to-action that attempts to load the child nodes again, focus should be moved to the node in the tree that\n      communicates the child nodes are loading.\n    </p>\n    <p>\n      If we don't have enough information to write a useful error message, it's ok to write something generic like\n      \"Couldn't load\".\n    </p>\n  </div>\n  <img\n    width=\"960\"\n    role=\"presentation\"\n    alt=\"13 errorHandling\"\n    src=\"https://user-images.githubusercontent.com/2313998/188977489-cf88908a-2995-4c18-8f53-aa80a49ff724.png\"\n  />\n</Box>\n-\n\n### Composition\n\n<Box as=\"figure\" role=\"presentation\" m={0} mb={4}>\n  <Box as=\"figcaption\" mb={3}>\n    A common pattern is to render a tree view in a split page layout where the tree view is in the left pane, and a view\n    for the selected file is rendered in the main content area.\n  </Box>\n  <img\n    width=\"960\"\n    role=\"presentation\"\n    alt=\"14 treeSplitPgLayout\"\n    src=\"https://user-images.githubusercontent.com/2313998/187719363-72304389-9464-42c3-9ff2-c2ef9cbef5ed.png\"\n  />\n</Box>\n\n<Box as=\"figure\" role=\"presentation\" m={0}>\n  <Box as=\"figcaption\" mb={3}>\n    However, a tree view can also be rendered on it's own.\n  </Box>\n  <img\n    width=\"960\"\n    role=\"presentation\"\n    alt=\"15 treeStandalone\"\n    src=\"https://user-images.githubusercontent.com/2313998/187719365-e179970c-808c-498c-908b-bd98df9442f8.png\"\n  />\n</Box>\n\n#### Examples\n\n<Box as=\"figure\" role=\"presentation\" m={0} mb={5}>\n  <img\n    width=\"960\"\n    role=\"presentation\"\n    alt=\"16 treeViewAsFileExplorer\"\n    src=\"https://user-images.githubusercontent.com/2313998/188683239-692e680a-673c-42a3-a532-42d5a0df51c3.png\"\n  />\n  <Caption as=\"figcaption\" color=\"fg.subtle\">\n    A tree view being rendered in a split page layout.\n  </Caption>\n</Box>\n\n<Box as=\"figure\" role=\"presentation\" m={0}>\n  <img\n    width=\"960\"\n    role=\"presentation\"\n    alt=\"17 treeViewOnItsOwn\"\n    src=\"https://user-images.githubusercontent.com/2313998/188683240-052b6e5d-529c-456c-acb2-f376aa8da17e.png\"\n  />\n  <Caption as=\"figcaption\" color=\"fg.subtle\">\n    A tree view that replaces itself with the content of the activated node.\n  </Caption>\n</Box>\n\n#### Provide sufficient vertical space\n\nBe considerate of the amount of vertical space a tree view can take up when all of it's nodes are expanded.\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"18 1 DO-renderWithEnoughSpace\"\n      src=\"https://user-images.githubusercontent.com/2313998/187768699-d97f4119-f989-487c-9d81-aa9253dbd580.png\"\n    />\n    <Caption color=\"fg.subtle\">\n      Render a tree view in an area with enough vertical space to comfortably browse the list, and doesn't push\n      important content or controls below the bottom of the viewport\n    </Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      role=\"presentation\"\n      alt=\"18 2 DONT-renderTooSmall\"\n      src=\"https://user-images.githubusercontent.com/2313998/187768702-2881810c-7d1d-4e36-ae85-dfc35cf95cda.png\"\n    />\n    <Caption color=\"fg.subtle\">\n      Don't render a tree view in an area that pushes down other content or forces users to scroll through small\n      segments of the list\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\n## Accessibility\n\n### Label\n\n<Box m={0}>\n  <Box as=\"p\">\n    Tree views need an accessible name to be supplied, ideally via `aria-labelledby` pointing at an appropriate heading\n    before the tree. If the tree view has enough surrounding context that it doesn't need a visible label, apply\n    `sr-only` to the heading to hide it visually, but preserve the underlying programatic association.\n  </Box>\n  <img\n    width=\"960\"\n    role=\"presentation\"\n    alt=\"25 labelledTreeView\"\n    src=\"https://user-images.githubusercontent.com/2313998/187957351-02c80d5a-c2a3-42bc-9811-7ee40e8f6cba.png\"\n  />\n</Box>\n\n### Keyboard navigation\n\n| Key(s)                                                                                                                                                                                                                                                                                                                                     | Description                                                                                                                                                                                                                                                                                                                                      |\n| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>Enter</Box>                                                                                                                                                                                  | Performs the default action (e.g. onclick event) for the focused node which is to activate the link.                                                                                                                                                                                                                                             |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>Tab</Box>                                                                                                                                                                                    | Moves focus outside of the tree view to the next focusable node.                                                                                                                                                                                                                                                                                 |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowDown</Box>                                                                                                                                                                              | <ul><li>Moves focus to the next node that is focusable without opening or closing a node.</li> <li>If focus is on the last node, does nothing.</li></ul>                                                                                                                                                                                         |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowUp</Box>                                                                                                                                                                                | <ul><li>Moves focus to the previous node that is focusable without opening or closing a node.</li><li>If focus is on the first node, does nothing.</li></ul>                                                                                                                                                                                     |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowRight</Box>                                                                                                                                                                             | <ul><li>When focus is on a closed node, opens the node; focus does not move.</li><li>When focus is on a open node, moves focus to the first child node.</li><li>When focus is on an end node, does nothing.</li></ul>                                                                                                                            |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>ArrowLeft</Box>                                                                                                                                                                              | <ul><li>When focus is on an open node, closes the node.</li><li>When focus is on a child node that is also either an end node or a closed node, moves focus to its parent node.</li><li>When focus is on a root node that is also either an end node or a closed node, does nothing.</li></ul>                                                   |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>Home</Box>                                                                                                                                                                                   | Moves focus to first node without opening or closing a node.                                                                                                                                                                                                                                                                                     |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>End</Box>                                                                                                                                                                                    | Moves focus to the last node that can be focused without expanding any nodes that are closed.                                                                                                                                                                                                                                                    |\n| <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>a-z</Box>, <Box as=\"kbd\" backgroundColor=\"canvas.subtle\" borderRadius={1} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" py={1} px={2}>A-Z</Box>, all printable characters | <ul><li>Focus moves to the next node with a name that starts with the typed character.</li><li>Search wraps to first node if a matching name is not found among the nodes that follow the focused node.</li><li>Search ignores nodes that are descendants of closed nodes.</li><li>Focus should not move if no nodes match the search.</li></ul> |\n\n#### Typeahead behavior\n\n<Box display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} sx={{gap: 3}}>\n  <Box flex={1}>\n    <p>\n      Focus moves to the next node with a name that starts with the typed character(s). Wait for 300ms from the last key\n      press to stop searching.\n    </p>\n    <p>\n      Typeahead behavior is case insensitive, and any printable character can be used, not just alphanumeric characters.\n    </p>\n    <p>\n      The `Space` key is ignored because it's being reserved for toggling a tree view node's checkbox. Nodes with\n      checkboxes are not supported yet, but they may in the future.\n    </p>\n  </Box>\n  <CustomVideoPlayer\n    width=\"456\"\n    loop\n    src=\"https://user-images.githubusercontent.com/2313998/187719392-3693e45a-f108-4b78-84ef-0cfe4c7067f9.mp4\"\n  />\n</Box>\n\n### Focus behavior\n\n<Box\n  display=\"flex\"\n  alignItems=\"center\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n\n<Box flex={1}>\n\n#### Focus in\n\nIf moving focus into the TreeView for the first time, focus on the first node.\n\nIf moving focus back into the TreeView after the user already interacted with it, focus the previously focused TreeView node.\n\n#### Focus out\n\nIf activating a node causes new content to appear without a page refresh, focus should be moved to the new content. By default, focus should be moved to the first focusable control within the main content region. We should avoid skipping any content so that the user can easily go back to the TreeView if they activate a node by accident.\n\nIf the first focusable element would cause a confusing experience for folks who listen to content using a screen reader, then an alternate element may be defined\n\n</Box>\n\n<CustomVideoPlayer\n  width=\"456\"\n  loop\n  src=\"https://user-images.githubusercontent.com/2313998/187719387-44088bf3-5236-4b0e-955b-85918f35734f.mp4\"\n/>\n\n</Box>\n\n### Minimum click target area for the chevron\n\n<Box as=\"figure\" display=\"flex\" flexDirection={['column', 'column', 'column', 'column', 'row']} m={0} sx={{gap: 3}}>\n  <Box as=\"figcaption\">\n    <p>\n      The chevron has a generous click area to make it an easier target to hit, but it's kept compact to preserve\n      horizontal space in deeply nested nodes.\n    </p>\n    <p>When we detect that the user is on a device with a coarse pointer, the click target is enlarged.</p>\n  </Box>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    alt=\"24 minTouchTarget\"\n    src=\"https://user-images.githubusercontent.com/2313998/187769276-d946bbbf-0fdb-4d40-8614-63b4ee17027e.png\"\n  />\n</Box>\n","parent":{"relativeDirectory":"components","name":"tree-view"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/index.mdx","frontmatter":{"title":"Foundations"},"rawBody":"---\ntitle: Foundations\n---\n\n<ChildPages of=\"Foundations\" />\n","parent":{"relativeDirectory":"foundations","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/layout.mdx","frontmatter":{"title":"Layout"},"rawBody":"---\ntitle: Layout\ndescription: GitHub is a diverse and complex platform. These layout guidelines aim to provide a set of standards that enables consistent, accessible, and responsive experiences.\n---\n\nimport {Box, Heading} from '@primer/react'\n\n<p><img src=\"https://user-images.githubusercontent.com/293280/193331583-020b59af-d749-402a-b8fd-095aaada098c.png\" alt=\"\" width=\"960\" /></p>\n\n## Overview\n\nHumans process visual information by breaking down shapes and colors. The visual processing system parses colors and textures in parallel, while parsing shapes and forms one at a time.\n\nLayouts are composed of shapes, and therefore parsed linearly. As a consequence, a layout should be organized aiming to create the least amount of friction for users.\n\nPeople rely on their natural reading order (top-to-bottom, left-to-right in Latin script), and their acquired mental models from previous interactions to discover what they are looking for.\n\nAt a quick glance, a layout should provide a clear understanding of the content hierarchy and its relationship. Having a consistent layout throughout the platform allows people to focus on their tasks rather than on learning new models. It helps them to navigate around with ease and confidence.\n\nConstructing a layout that is visually and semantically clear improves how people digest the content, and is aligned with an accessible implementation. Assistive technologies, such as screen readers and keyboard navigation, rely on semantic markup to understand the page structure and translate it into an accessible interaction.\n\nDesigning with these considerations in mind results in a user experience that is consistent, inclusive, and responsive.\n\n### Takeways\n\n#### Strive for a focused experience\n\nA page should enable the person to focus on the content. We should respect the user’s attention, and provide an experience that is clean, calm, and uncluttered.\n\n#### Design fully-functional responsive experiences\n\nPages should adapt to smaller screens, without loss of functionality. Multi-column page layouts need to be designed for scenarios where not all columns fit the viewport at once. Break down layout into multiple views for mobile-friendly experiences.\n\n#### Consider consistency inside and outside GitHub\n\nLeverage existing mental models people have from using GitHub, the web, and other computer software. Use familiar patterns and conventions to create an experience that can be rationally understood.\n\n<!-- Comment about permalinks? -->\n\n## Responsive foundations\n\nPrimer provides two levels of abstraction for handling responsive designs:\n- **Viewport ranges**, for defining the layout and navigation affordance of a page at a high level.\n- **Breakpoints**, for fine-tuning custom experiences.\n\n### Viewport ranges\n\nViewport ranges target common scenarios when designing responsive layouts. They are based on the viewport width, and are opinionated about the number of layout columns that can fit in a given range.\n\nViewport ranges enable designs to break down complex multi-column experiences into simpler layouts according to the the available space.\n\nBecause they provide a clear separation between mobile and desktop patterns, viewport ranges allow pages to remain powerful on desktop-friendly scenarios, while allowing a targetted streamlined experience in small devices.\n\n<p><img width=\"960\" alt=\"Viewport ranges\" src=\"https://user-images.githubusercontent.com/293280/193167177-87175665-4f52-4d3a-aac3-d09f408c05c4.png\" /></p>\n\nViewport range | Width range   | Columns  | Description\n---------------|---------------|----------|------------\n`narrow`       | < 768px       | 1        | Supports a single-column layout. Also known as “mobile”.\n`regular`      | >= 768px      | Up to 2  | All desktop-friendly patterns start at this range.\n`wide`         | >= 1400px     | Up to 3  | Optional range when a 3rd layout column is needed.\n\n### Breakpoints\n\nBreakpoints enable designers to fine-tune their responsive experiences, adjusting any specific responsive scenarios that are not addressed by viewport ranges.\n\nHistorically, Primer has utilized breakpoints as the base of [mobile-first responsive CSS utilities](https://github.com/primer/css/blob/b5e009778ec01b6e983cba6cbf89cebfdc5a4124/docs/content/support/breakpoints.md). While these utilities values remain available, breakpoints are no longer tied to a `min-width` mobile-first media query approach.\n\nBreakpoint sizes should be simply seen as a unit in a ruler. The numbers are not opinionated into how they should be used when applied to a media query. That is, they don't refer to ranges that go upwards or downwards.\n\nWhile viewport ranges should be used for distinguishing responsive layout adaptations, custom media queries built with these breakpoints values can be used internally for adjusting any specific responsive scenarios that require a fine-tune level of control.\n\nBreakpoint | Size\n-----------|-------\n`xsmall`   | 320px\n`small`    | 544px\n`medium`   | 768px\n`large`    | 1012px\n`xlarge`   | 1280px\n`xxlarge`  | 1400px\n\nFor more information about viewport ranges and breakpoints, check the [Responsive API design guidelines ADR](https://github.com/github/primer/blob/main/adrs/2022-04-15-responsive-design-api-guidelines.md) (currently only available for hubbers). \n\n## Anatomy of a page\n\n<p><img src=\"https://user-images.githubusercontent.com/293280/192653282-e728781c-6024-4d11-9388-12ad91ae388a.png\" alt=\"Anatomy of a page\" /></p>\n\n### App header\n\nApp header is GitHub’s topmost bar. This header contains global navigation and actions, but also contextual navigation elements such as **Context region** and **Local navigation**.\n\nIt may also contain other system-level elements, such as notification banners. \n\nApp header is never fixed to the top of the viewport. It scrolls with the rest of the page.\n\n### Context region\n\nContext region informs the current section where the person is located. For example, in any page that belongs to a repository, it shows `:owner / :repository`.\n\nContext region is not a full-path breadcrumb. Instead, it works alongside elements such as Local navigation and other in-page navigation components to give the user a full mental model of where they are located.\n\nDon’t include custom interactive elements such as dropdown selectors or other buttons in the Context region.\n\n#### Repository context\n\n<DoDontContainer>\n<Do indented>\n\n`:owner / :repository`\n\n<Caption>Do represent repositories as direct sub-items of an organization or user in the Context region.</Caption> \n</Do>\n<Dont indented>\n\n`:owner / :repository / Issues`\n\n<Caption>Don’t use a Context region to show the full page’s path. A selected “Issues” item in the local navigation should provide enough complementary context.</Caption>\n</Dont>\n</DoDontContainer>\n\n#### Owner context (organization or users)\n\n<DoDontContainer>\n<Do indented>\n\n`:owner`\n\n<Caption>Do represent top-level sections with a single Context region item.</Caption>\n</Do>\n<Dont indented>\n\n`:owner / Projects`\n\n<Caption>Don’t use a Context region to show the full page’s path. A selected “Projects” item in the local navigation should provide enough complementary context.</Caption>\n</Dont>\n</DoDontContainer>\n\n#### Other owned categories\n\n<DoDontContainer>\n<Do indented>\n\n`:owner / Projects / :project`\n\n<Caption>Do represent objects other than repositories as sub-items of a category.</Caption> \n</Do>\n<Dont indented>\n\n`:owner / Projects / :project / Insights`\n\n<Caption>Don’t display the full page’s path. The page should use local or in-page navigation elements to provide such context.</Caption>\n</Dont>\n</DoDontContainer>\n\n### App footer\n\nApp footer contains useful links and legal information about GitHub. It remains “after the fold” in smaller pages to keep the focus on the main content.\n\nThe App footer should be present in all core pages. Experiences that require rich interactions, such as when manipulating large amounts of data, may opt-out of the App footer.\n\n## Page types\n\nPage layouts can have many different forms and needs. The list below contain common page types that can be used as a starting point for designing new experiences.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <Box justifyContent=\"center\">\n      <img\n        width=\"464\"\n        alt=\"\"\n        src=\"https://user-images.githubusercontent.com/293280/193167353-d945da51-665f-4d9b-81f6-904744901d51.png\"\n      />\n  </Box>\n  <Box>\n      <Heading as=\"h3\" sx={{fontSize: 3, mb: 2}}>Full pages</Heading>\n\nThis is the classic type of a page design of GitHub, where both content and pane regions appear horizontally centered to the viewport.\n\nPage layouts generally limit their maximum width to `xlarge` (1280px) so the content region doesn’t render paragraphs with too many words per line.\n\n  </Box>\n  <Box justifyContent=\"center\">\n      <img\n        width=\"464\"\n        alt=\"\"\n        src=\"https://user-images.githubusercontent.com/293280/193167352-51d74a57-4e62-488a-92f9-581d0c4ca15a.png\"\n      />\n  </Box>\n  <Box>\n      <Heading as=\"h3\" sx={{fontSize: 3, mb: 2}}>Split pages</Heading>\n\nSplit page layouts are a good options for pages that have side navigation, filtering, or any type of list-detail pattern.\n\nSplit pages separate the viewport in two, allowing the pane to have an independent scrollable area. This is useful when the pane has a long list of items, and the user needs to scroll through the list without losing the context of the selected item.\n\nThe pane region of a split page layout is always flushed to the left. Don’t use right-aligned flushed panes as their scrollbar may conflict with the page scrollbar.\n\nThe content region of a split page layout may have a maximum width. In those scenarios, the content region tries to remain centered horizontally to the viewport if there's space.\n\n  </Box>\n  <Box justifyContent=\"center\">\n      <img\n        width=\"464\"\n        alt=\"\"\n        src=\"https://user-images.githubusercontent.com/293280/193167350-b4bd5626-af85-464c-9b0c-df6fbe26a6f0.png\"\n      />\n  </Box>\n  <Box>\n      <Heading as=\"h3\" sx={{fontSize: 3, mb: 2}}>Interstitial pages</Heading>\n\nUsed for signing-in experiences, password verification, loading states, or other long operations.\n\nInterstitial pages usually have an `xsmall` (320px) maximum width.\n\n  </Box>\n</Box>\n\n## Layout regions\n\nLayout regions are the main structural building blocks of a page layout. They are the areas where content and components are placed, and group elements that share a common purpose.\n\nLayout regions make it easy to adapt the page to different viewport ranges. For more information about responsive behavior, see [Responsive behavior](#responsive-behavior) below.\n\n### Header region\n\nHeaders appear at the top of the page, and include a page title, alongside optional actions, summary, local navigation, and metadata.\n\n### Content region\n\nThe content region is used for displaying the main subject of the page. Other regions support the content with additional information, either about, or related to it.\n\n### Left pane region\n\nDisplay navigation, filtering, or an overview for entities such as users, bots, apps, etc.\n\n### Right pane region\n\nDisplay item metadata, details, and other auxiliary information.\n\n### Footer region\n\nUse it to display less important information, such as references, or links to other pages.\n\n## Responsive behavior\n\nNarrow viewports support a single column when displaying page layouts. The list below contain common responsive adaptations to make sure experiences can remain usable on smaller screens.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <Box justifyContent=\"center\">\n      <img\n        width=\"464\"\n        alt=\"\"\n        src=\"https://user-images.githubusercontent.com/293280/193167623-16947bb7-aadd-4532-91d4-67f2c10c1e37.png\"\n      />\n  </Box>\n  <Box>\n      <Heading as=\"h3\" sx={{fontSize: 3, mb: 2}}>Split into different pages</Heading>\n\nList-detail patterns, such as settings pages, can be split into different pages when the viewport is narrow.\n\nIn this behavior, only one of pane or content regions is shown. The user can switch between the two by selecting an item from the list to drill-in into its details, or navigate back using a parent link in the page header.\n\n  </Box>\n  <Box justifyContent=\"center\">\n      <img\n        width=\"464\"\n        alt=\"\"\n        src=\"https://user-images.githubusercontent.com/293280/193167620-71c4d803-b9d6-4ff0-8f42-9be100b672ac.png\"\n      />\n  </Box>\n  <Box>\n      <Heading as=\"h3\" sx={{fontSize: 3, mb: 2}}>Show pane as bottom sheet</Heading>\n\nPanes can be displayed as bottom sheets when they’re used to display auxiliary information, such as metadata, details or actions. Use narrow viewport-specific button triggers to open the pane as a bottom sheet.\n\n  </Box>\n  <Box justifyContent=\"center\">\n      <img\n        width=\"464\"\n        alt=\"\"\n        src=\"https://user-images.githubusercontent.com/293280/193167624-f66af4a2-49b9-4610-bf76-36f77a5521e8.png\"\n      />\n  </Box>\n  <Box>\n      <Heading as=\"h3\" sx={{fontSize: 3, mb: 2}}>Stack vertically</Heading>\n\nIn scenarios where the pane is used to display an overview of the content, it can be stacked vertically on top of the content region. Metadata and auxiliary information can appear stacked below the content region.\n\nAdditionally, a small pane summary may appear above the content, with a trigger used to display the full details as a bottom sheet.\n\n  </Box>\n</Box>","parent":{"relativeDirectory":"foundations","name":"layout"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/responsive.mdx","frontmatter":{"title":"Responsive"},"rawBody":"---\ntitle: Responsive\ndescription: Supporting responsive experiences is an essential part of developing for the Web. Every page and feature at GitHub needs to adapt to the user’s device and their preferences.\n---\n\n## Definition\n\n[Responsive web design](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Responsive_Design) is the practice of building a website suitable to work on every device and every screen size, no matter how large or small, mobile or desktop. Responsive web design is an accessibility requirement, focused around providing an intuitive and gratifying experience for everyone.\n\nAt GitHub, being Responsive means our experiences are inherently adaptive. Interfaces should not only adjust layout and spacing when resizing a page, but work [efficiently](/foundations/introduction#design-for-efficiency) to provide an experience that is tailored to match the paradigms and affordances of the person’s device:\n\n- Responsive to the [form factor](<https://en.wikipedia.org/wiki/Form_factor_(design)>): adapt to viewport size, pointing device support, and to the device metaphors, power, and [affordances](https://www.interaction-design.org/literature/topics/affordances).\n- Responsive to the user preferences: respect browser’s default font size, reduced motion, color scheme, contrast preferences, etc.\n\n## Responsive to the device’s form factor\n\nDesigning for the web means that people can open your page from virtually any type of device. When designing for GitHub, picture our users using desktops, tablets, and smartphones, but also [custom-built tiny cyberdecks](https://www.reddit.com/r/cyberDeck/top/?t=year) and [VR headsets](https://en.wikipedia.org/wiki/Virtual_reality_headset).\n\n### Device power\n\nGitHub cannot discriminate against devices and connection speeds. Experiences need to be fast and performant, even on low-powered devices and slow connections. [It’s not fully shipped until it’s fast](/foundations/zen).\n\n### Viewport size\n\nTo guarantee maximum compatibility, pages should adapt to the [browser’s viewport size](https://developer.mozilla.org/en-US/docs/Web/CSS/Viewport_concepts), without loss of information or functionality, starting at the following dimensions:\n\n- **Minimum viewport width**: 320px\n- **Minimum viewport height**: 256px\n\nProviding support at these smaller sizes enable people with low vision to use GitHub with a browser zoom enabled, up to 400% on a 1280px wide screen. [Read more about this accessibility requirement](https://www.w3.org/WAI/WCAG21/Understanding/reflow.html).\n\nTo understand how to break down a page to work on smaller viewports, check out [Responsive foundations](/foundations/layout#responsive-foundations) and [Responsive behavior](/foundations/layout#responsive-behavior) sections in the [Layout](/foundations/layout) page.\n\n<!--\n\nTodo: Link to Figma Templates\n\n> When designing a mobile-friendly rendering of a page, we recommend using a viewport width of **375px**, as this is the most common size among small smartphones. However, the page should still be tested and be fully functional at smaller widths for accessibility reasons, all the way to **320px**.\n\n-->\n\n### Pointing device\n\nUse the device characteristics through [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries) to adapt the experience accordingly for different device scenarios. The table below shows some possible device scenarios using `pointer` and `hover` media features:\n\n| &nbsp;             |                `pointer: coarse`                 |   `pointer: fine`    |\n| ------------------ | :----------------------------------------------: | :------------------: |\n| **`hover: none`**  |            Smartphones, touch screens            | Stylus-based screens |\n| **`hover: hover`** | Virtual reality headsets, video-game controllers |   Mouse, touch pad   |\n\n#### Minimum target\n\nWhen creating interactive targets in your design, ensure that they are large enough to easily tap or click on. The AA accessibility standard GitHub strives for requires a minimum target size of `32px` for touch `pointer: coarse` and `24px` for mouse/stylus `pointer: fine`.\nHowever, it is recommended to aim for the AAA standard when possible. For more information on Target Size at the AAA level, refer to the [W3C documentation](https://www.w3.org/WAI/WCAG21/Understanding/target-size.html).\n\n| Input             | Minimum Size (AA) | Recommended size (AAA) |\n| ----------------- | :---------------: | :--------------------: |\n| `pointer: coarse` |       32px        |          44px          |\n| `pointer: fine`   |       24px        |          24px          |\n\nA common example of a hit target that may not meet the AAA standard on mobile is our medium size button, which is only 32px in height. To improve its touch target, the height must be increased without altering the visual appearance of the button.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/212349806-8329b722-9245-4911-9763-87a7eba6b328.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A design that showcases a medium-sized button of 32px height, where the touch target has been increased to 44px by adding space above and below the button.\"\n    />\n    <Caption>While acceptable for AA try to increase the touch target to 44px on mobile to reach AAA</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/212349813-b5389387-72b5-47bc-9c3a-ffa7c5609887.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A design that illustrates a medium-sized button that is 32px in height and its touch target remains unchanged.\"\n    />\n    <Caption>Keep the 32px hit target for mobile touch targets.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<!--\n\nTodo: Touch-friendly strategy section.\n\nExamples of touch adaptation with out-of-boudaries touch targets, when applied to Button and IconButton components, following comparison with ActionListItem, which increases its height instead.\n\nImage source:\nhttps://www.figma.com/file/YlBTqHTbdRwYQt0bfIHvGw/Interface-guidelines?node-id=457%3A89625\n\n-->\n\n#### Hover support\n\nBrowsers report if the primary input mechanism can hover over elements with the `hover` media feature.\n\nDevices that don’t support hovering such as smartphones and tablets may need adapted experiences so that the user can interact with the page without hovering over elements.\n\nFeatures that rely on hover such as tooltips or hovercards may not be available on these devices. Make sure the information presented is still accessible through other means, such as a direct link to a page with the information.\n\n<!--\n\nTodo: Do we include examples of device metaphors and afforances here as well?\n\n-->\n\n## Responsive to the user preferences\n\nPeople may set system preferences to change the way they prefer to interact with their devices. By default, GitHub must respect these preferences. Providing a way to override these options within the **User settings** is also recommended.\n\nOn the web, these user preference media features include:\n\n- [`prefers-color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)\n- [`prefers-contrast`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast)\n- [`prefers-reduced-motion`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion)\n- [`forced-colors`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors)\n- [`inverted-colors`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors)\n\n### Browser default font size\n\nUsers may set their operating system or browsers to use larger or smaller fonts. GitHub should respect these preferences, as it enables people with low vision to increase the size of the text on the page.\n\nPrimer design tokens are designed to support `rem` units, which are relative to the browser’s default font size. Use Primer-provided design tokens to ensure consistency across the system.\n\nTo test this, change the size in the browser:\n\n- In Chrome: Go to `chrome://settings`. Under **Appearance**, change the font size.\n- In Firefox: In the menu button, select **Settings**. Under ”Language and Appearance” you can set different size. Default is `16`.\n\n## See also\n\n- [Viewport ranges](/foundations/layout#viewport-ranges)\n- [Responsive breakpoints](/foundations/layout#breakpoints)\n- [Responsive layout behavior](/foundations/layout#responsive-behavior)\n","parent":{"relativeDirectory":"foundations","name":"responsive"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/typography.mdx","frontmatter":{"title":"Typography"},"rawBody":"---\ntitle: Typography\ndescription: These guidelines summarize how we use typography at GitHub, and serve as guardrails for designers to design freely with best typographic practices in mind.\n---\n\nimport segoeImage from '../../src/images/segoe.svg'\nimport sfImage from '../../src/images/sf.svg'\nimport sfMonoImage from '../../src/images/sfMono.svg'\nimport interImage from '../../src/images/interUI.svg'\nimport ubuntuImage from '../../src/images/ubuntu.svg'\n\n## Typefaces\n\nThe first three typefaces listed below are the most commonly utilized system-fonts on GitHub products. However, this isn’t a finite list, so keep in mind that typographic implementations may vary between browser settings and operating systems.\n\n[Inter UI](https://rsms.me/inter/) and [SF Mono](https://developer.apple.com/fonts/) are not system fonts, but are used in specialized scenarios to differentiate information and establish hierarchy.\n\n| Example                                                | Description                                                                                                                                                                                                                                     |\n| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| <img src={sfImage} alt=\"San Francisco\" width=\"1000\" /> | [San Francisco](https://developer.apple.com/fonts/) is a neo-grotesque sans-serif typeface designed by Apple to replace Helvetica Neue for OSX and iOS                                                                                          |\n| <img src={segoeImage} alt=\"Segoe\" width=\"1000\" />      | [Segoe UI](https://developer.microsoft.com/en-us/fabric#/resources) is a humanist sans-serif adopted by Microsoft as its default operating system font since Windows Vista                                                                      |\n| <img src={ubuntuImage} alt=\"Ubuntu\" width=\"1000\" />    | [Ubuntu](https://design.ubuntu.com/font/) is an OpenType-based, humanist sans-serif typeface. It became the default system font for Ubuntu 10.10 and is commonly used on Linux distros                                                          |\n| <img src={interImage} alt=\"Inter\" width=\"1000\" />      | [Inter UI](https://rsms.me/inter/) is a typeface designed by Rasmus Andersson specially for user interfaces. Inter UI is used in our products as a display face in select circumstances                                                         |\n| <img src={sfMonoImage} alt=\"SF Mono\" width=\"1000\" />   | [SF Mono](https://developer.apple.com/fonts/) is a monospace typeface that is part of the San Francisco typeface family. SF Mono is monospaced across weights, so resetting SF Mono text into another font weight will not cause text to reflow |\n\n## Font stack\n\nWe utilize system fonts at GitHub, which allow for optimized performance. This design decision takes advantage of retina screens, dynamic kerning, additional font-weights, and improved readability.\n\n**System Fonts**—default GitHub font-stack with ample fallbacks alongside emoji support\n\n```css\nfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n```\n\n**Monospace**—used within GitHub product to display metadata or captions, and used in marketing contexts as subheaders\n\n```css\n$mono-font: \"SFMono-Regular\", Consolas, \"Liberation Mono\", Menlo, Courier, monospace !default;\n```\n\n**Display face**—the font stack that implements Inter UI\n\n```css\nfont-family: InterUI, -apple-system, BlinkMacSystemFont, \"Helvetica Neue\", \"Segoe UI\", Oxygen, Ubuntu, Cantarell, \"Open Sans\", sans-serif;\n```\n\n_For more information on why we made the change to system fonts, check out [Mark Otto](http://markdotto.com/)'s article: [Shipping System fonts to GitHub.com](http://markdotto.com/2018/02/07/github-system-fonts/)_\n\n## Typography scale and line height\n\nThe typography scale is designed to work for GitHub's product interfaces and marketing sites. Font sizes are designed to work in combination with line-height values so as to result in more sensible numbers wherever possible.\n\n| Font size: desktop | 1.25 line-height | 1.5 line-height |\n| ------------------ | ---------------- | --------------- |\n| 12px               | 15               | 18              |\n| 14px               | 17.5             | 21              |\n| 16px               | 20               | 24              |\n| 20px               | 25               | 30              |\n| 24px               | 30               | 36              |\n| 32px               | 40               | 48              |\n| 40px               | 50               | 60              |\n| 48px               | 60               | 72              |\n\n### Marketing typography scale\n\nOur marketing typography scale aligns with our core typography scale, except for one additional header size:\n\n| Font size: desktop | 1.25 line height | 1.5 line height |\n| ------------------ | ---------------- | --------------- |\n| 64px               | 80               | 96              |\n\nMarketing typography also incorporates [Inter UI](https://rsms.me/inter/) as a display face.\n_More information on [marketing typography](https://primer.style/css/utilities/marketing-type)_.\n\n## Applying typography\n\nIt is best practice at GitHub to keep unique type styling to a minimum as to align stylistically with our other products.\n\n### Hierarchy\n\nWhen establishing hierarchy for GitHub products, designers should remember that we stress efficient, clean reading experiences for our users. Be sure to utilize Primer’s [typography scale](https://primer.style/css/utilities/typography) and [typography utilities](https://primer.style/css/utilities/typography) when doing so. Refrain from utilizing color as a primary method of emphasis.\n\n### Readability\n\n- **Line height**—Refer to our typography scale when structuring line height. Generally, our products should follow this scale without issues.\n\n- **Line length**—It's considered a good practice to keep lines around 80 characters or less—[W3 Page Structure Guidelines](https://www.w3.org/WAI/tutorials/page-structure/styling/). Cases vary depending on the situation, but this serves as a general rule of thumb for designing layouts.\n\n- **Type alignment**—Our content is typically left-aligned and ragged right. Be sensible in deviating from this standard, as justifying, centering, and right-aligning text is atypical of GitHub products.\n\n- **Font weight**—Adjust font weight to add emphasis and differentiate content hierarchy.\n\n- **Letter spacing**—Please refrain from altering letter-spacing on our products. There may be rare scenarios in which this is acceptable, but generally speaking, this should be avoided altogether.\n\n## Support\n\n### Iterate and componentize\n\nWhen certain typographic patterns in your design emerge, or you believe a certain solution should be made into a component, reach out to the [#primer](https://github.slack.com/archives/CSGAVNZ19) channel on Slack to find out more on submitting your code or idea. You may also reach out by opening an issue in [the Primer repo on GitHub](https://github.com/primer/primer).\n\n### Related typography components\n\nPrimer includes many typographic solutions. Please utilize them when possible before creating a custom component. Some include:\n\n- [Alerts](https://primer.style/css/components/alerts)\n- [Labels](https://primer.style/css/components/labels)\n- [Subheads](https://primer.style/css/components/subhead)\n- [Navigation](https://primer.style/css/components/navigation)\n\n### Further reading and resources\n\n- [Mathematical Web Typography](https://jxnblk.com/blog/mathematical-web-typography/)\n- [The Elements of Typographic Style](https://www.amazon.com/Elements-Typographic-Style-Robert-Bringhurst/dp/0881791326)\n- [A Type Primer](https://www.amazon.com/Type-Primer-2nd-John-Kane-ebook/dp/B006Y1X55G)\n- [Thinking with Type](http://thinkingwithtype.com/)\n- [WCAG Accessibility Tutorials](https://www.w3.org/WAI/tutorials/page-structure/)\n- [Browser Typography Scale](http://type-scale.com/)\n- [Typewolf Blog](https://www.typewolf.com)\n\n<!-- **etc.** -->\n\nexport const meta = {displayName: 'Typography'}\n","parent":{"relativeDirectory":"foundations","name":"typography"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/about.mdx","frontmatter":{"title":"Meet the team"},"rawBody":"---\ntitle: Meet the team\n---\n\nimport {Team} from '../../src/components/team'\n\n<Team />\n","parent":{"relativeDirectory":"guides","name":"about"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/component-lifecycle.mdx","frontmatter":{"title":"Component lifecycle"},"rawBody":"---\ntitle: Component lifecycle\ndescription: Milestones that summarize the maturity lifecycle of UI components in Primer.\n---\n\nComponents must meet all criteria _before_ proceeding to a given milestone.\n\n## Experimental\n\nThe component exists as a proof-of-concept or is work in progress.\n\n- The component may be ready for preliminary usage depending on its maturity. Please file [an issue](https://primer.style/contribute/how-to-contribute#contribute-to-our-open-source-repos) to discuss further.\n\n## Alpha\n\nThe component is ready for preliminary usage, with breaking changes expected.\n\n- The component does not have external dependencies. This could be external libraries or dependencies on libraries in an application (like GitHub.com)\n- The component is compatible with color modes and can adapt to different themes. The component does not reference any hard-coded static values and uses functional variables. Any temporary or app-level variables have been removed. Theme values (such as a new brand scheme) can be swapped out without touching the public API of the component.\n- The component is designed with responsiveness in mind. The component can adapt to different screen sizes, from mobile to large desktop screens. The component's interactive areas must be friendly to touch on devices with a coarse pointer method.\n- Component documentation includes example usage of the component.\n- Primary use cases tested and reviewed.\n- The component has robust unit test coverage on all critical paths, including branching logic and edge cases. This is measurable through metrics like 100% test coverage (where achievable).\n- The component has visual regression coverage of its default and interactive states.\n- The component has robust test coverage for its interactive (stateful) behaviour, which has been verified in end-to-end and/or open-box testing suites.\n- The component does not introduce any [axe](https://www.deque.com/axe/) violations.\n- The component has been manually reviewed for accessibility and any outstanding issues have been fixed.\n\n## Beta\n\nThe component meets most maturity criteria, and use is encouraged for most scenarios.\n\n- The component is used in a production application in multiple instances. Expectation is three or more instances in dotcom for Primer ViewComponents, at least one or more instances for Primer React. Uses of the component have been reviewed for correctness.\n- Usage guidelines and configuration documentation covers common use cases. Implementation of additional features (secondary priorities) is expected during beta. Additional and most common use cases should be documented by this phase. Documentation should include a sandbox environment such as Storybook.\n- The design has been reviewed and any resulting issues have been addressed. Systems Designers have reviewed the current implementation, validated its responsive strategy, and how it’s used in production.\n- The component is compatible with server-side rendering (SSR).\n- The component does not introduce unnecessary performance regressions to the user experience or the Primer library.\n\n## Stable\n\nThe component is significantly mature and usage is strongly encouraged, with long-term support expected.\n\n- The API remains stable, with no breaking changes for at least one month. Feedback on API usability has been sought from developers using the component and production use cases have been reviewed for correctness.\n- Documentation exists for the remaining implementation, usage, and design guidelines. Primer React and/or Primer ViewComponents documentation includes all props and variations, accessibility guidelines (including common misuses), and common scenarios. Design documentation is added to Interface Guidelines. Figma components are available in the Primer Web library.\n- Tooling (such as linters, codemods, etc.) exists to prevent further use of alternatives.\n\n## Deprecated\n\nThe component will be removed in the future and should be avoided.\n\n- Documentation exists for the deprecation, including any alternative components to use instead.\n- When using the component, a warning is shown to the consumer.\n\n## Removed\n\nThe component no longer exists in Primer.\n\n- The removal date has been announced and is at least one month away from the release date of the package that removes the component.\n- Manual and automated migration paths are documented and have been available for at least one month.\n","parent":{"relativeDirectory":"guides","name":"component-lifecycle"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/index.mdx","frontmatter":{"title":"Guides"},"rawBody":"---\ntitle: Guides\n---\n\n<ChildPages of=\"Guides\" />\n","parent":{"relativeDirectory":"guides","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/introduction.mdx","frontmatter":{"title":"Introduction"},"rawBody":"---\ntitle: Introduction\ndescription: Primer is built for GitHub by GitHub. Its guidelines are a collection of open source principles, standards, and recommendations for designing GitHub. As a design language, Primer provides common grammar and vocabulary to build cohesive, accessible, responsive, and efficient experiences.\n---\n\n## A cohesive experience\n\nGitHub has a global audience. Millions of people use GitHub every day for many different reasons, in many different ways. They all come from different backgrounds. We can’t infer their physical or cognitive abilities, or devices they use, or the internet connection they have. All of that needs to be taken into account before, during, and after the design process.\n\nFamiliar patterns help people intuitively navigate to the information they're looking for, while also helping people discover new features. If pages and features don’t share the same metaphors, people get confused more easily, it makes it harder for them to understand the features we provide.\n\nPrimer focuses on the user experience so people can benefit from using a platform that is cohesive, no matter where in the platform they are. If a page behaves and feels familiar, it allows people to focus on the task at hand, instead of requiring them to parse UI that looks completely new.\n\n## Inclusive and accessible design\n\nGitHub is a home for all developers. To be inclusive means we must consider accessibility at the core of how we design.\n\nAccessibility and inclusive design needs to be considered from the start of a project, because it deeply affects its design, how the product behaves, and how it’s built.\n\nAdding accessibility support to a design after the fact generally turns into a difficult retrofit.\n\nFor more information, see [Accessibility at GitHub](/guides/accessibility/accessibility-at-github).\n\n## Responsive design\n\nBrowsers are found on devices with different shapes, sizes, display qualities, and input methods, so we can’t assume a desktop-only experience is enough. Supporting responsive experiences is an essential part of developing for the Web today. In fact, making sure pages work well [on most screen sizes or zoom levels](https://www.w3.org/WAI/WCAG21/Understanding/reflow.html) is an accessibility requirement as well.\n\nPrimer plays an important role in providing reusable patterns and components that can streamline the creation of responsive-friendly and accessible designs, letting teams focus on bigger problems. GitHub projects should take advantage of these patterns so they can provide people with cohesive experiences throughout the entire platform.\n\nPrimer uses the term “Responsive design” to refer to design decisions that are adapted to device form factors and user preferences.\n\nFor more information, see [Responsive](/foundations/responsive).\n\n## Design for efficiency\n\nGitHub is a platform used for productivity. We aim to encourage flow, focus, and an experience that is fast and compact.\n\nBy providing a cohesive, inclusive, and responsive design, Primer’s goal is to remove as much friction as possible between the human and the software.\n\nPrimer patterns and components aim towards accessible solutions that don’t dilute efficient UI interactions. It focuses on responsive design that doesn’t reduce desktop experiences into mobile-first solutions. Ultimately, it recognizes the need to encourage flow by providing calm and logical experiences throughout.\n\n## The Zen of GitHub\n\n> “Whether you call it taste, culture, or zen, there are underlying assumptions that members of an organization rely on to resolve ambiguity in pursuit of the organization’s mission.”  \n> – [Ben Balter](https://ben.balter.com/2015/08/12/the-zen-of-github/)\n\nThe [GitHub API](https://api.github.com/zen) consolidates the Zen of GitHub in its own codebase, in 14 aphorisms:\n\n- Responsive is better than fast\n- It’s not fully shipped until it’s fast\n- Anything added dilutes everything else\n- Practicality beats purity\n- Approachable is better than simple\n- Mind your words, they are important\n- Speak like a human\n- Half measures are as bad as nothing at all\n- Encourage flow\n- Non-blocking is better than blocking\n- Favor focus over features\n- Avoid administrative distraction\n- Design for failure\n- Keep it logically awesome\n\nWe recommend you to read about the story behind the Zen of GitHub in these posts:\n- [Taste and The Zen of GitHub](https://warpspire.com/posts/taste), by [@kneath](https://github.com/kneath)\n- [The Zen of GitHub](https://ben.balter.com/2015/08/12/the-zen-of-github/), by [@benbalter](https://github.com/benbalter)\n","parent":{"relativeDirectory":"guides","name":"introduction"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/status.mdx","frontmatter":{"title":"Component status"},"rawBody":"---\ntitle: Component status\n---\n\nimport {StatusTable} from '../../src/components/status'\n\n<Note>\n\nCheck out the [component lifecycle](/guides/contribute/component-lifecycle) for more information on each status.\n\n</Note>\n\n<StatusTable />\n","parent":{"relativeDirectory":"guides","name":"status"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/native/index.mdx","frontmatter":{"title":"Native"},"rawBody":"---\ntitle: Native\n---\n\n<ChildPages of=\"Native\" />\n","parent":{"relativeDirectory":"native","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/ui-patterns/dates-and-times.mdx","frontmatter":{"title":"Dates & Times"},"rawBody":"---\ntitle: Dates & Times\ndescription: These guidelines summarize how to display time in a way that is clear, concise, and accessible.\n---\n\nimport {Box} from '@primer/react'\n\n## Overview\n\nAll dates and times displayed should use the relative time component, which is able to format and localise dates into the users given locale, as well as display times relative to the current date, while also updating in real-time.\n\nDates and times almost always appear [relative](#relative-dates) to the current date, using short-hand formats to help users quickly determine how old something is or how soon something will be. For this, we use the relative time component which displays dates rounded to the nearest unit, for example, \"a minute ago\" or \"20 days ago\". For dates that are more than 1 month from the current date, it can be more useful to display the date-time, as these items are less \"current\" and more \"historical\".\n\nSome dates are especially sensitive and always should be displayed in a [precise](#precise-dates) date-time format, such as the creation or expiration of certificates and keys. When a user needs to take action before a particular time (such as an expiry date) then the precise date time should be displayed. These should display the weekday, the date, the month, and the year (if the year is not the current year), for example, \"Thursday, 26 August 2021\" or \"Saturday, 31 December 2022\".\n\nSome dates and times represent the start or (expected) end of an actively running task, for these the [elapsed or remaining](#elapsed-or-remaining-dates) time should be displayed, as this information is more useful than when a task started. This format should display all units that are greater than zero, for example, \"2 minutes, 24 seconds\" or \"8 hours, 15 seconds\". For ephemeral tasks where timing needs to be quickly consumed, or where a lot of times may be displayed together, a compact time notation can be used, for example, \"2m 24s\" or \"8h 15s\".\n\n## Usage\n\n### Relative dates\n\n#### Past dates\n\nFor past dates, the relative time component outputs different formats depending on the time difference. Within a month's time, the output shows a relative time[^1] in the format of `X seconds/minutes/hours/days ago`. If the time difference is less than 1 minute, it shows `just now`. If the date is in past months, the date time[^2] format `on D MMM` is used. If the date is in the past years, the format `on D MMM, YYYY` is used.\n\n[^1]: Relative time data is derived from the [Intl.RelativeTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) API.\n[^2]: Date time data is derived from the [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) API.\n\n| Time difference | Format                           | Examples                                                                                  |\n| --------------- | -------------------------------- | ----------------------------------------------------------------------------------------- |\n| < 1 minute      | just now                         | `just now`                                                                                |\n| < 1 month       | X seconds/minutes/hours/days ago | `a minute ago`, `5 minutes ago`, `an hour ago`, `3 hours ago`, `yesterday`, `20 days ago` |\n| > 1 month       | on D MMM                         | `on 18 Nov`                                                                               |\n| Past year       | on D MMM, YYYY                   | `on 26 Aug, 2021`                                                                         |\n\n<p>\n  <img\n    width=\"960\"\n    alt=\"Relative time examples\"\n    src=\"https://user-images.githubusercontent.com/912236/208934714-3bd0763c-c4b9-4df4-89ea-47332beca61d.png\"\n  />\n</p>\n\n#### Future dates\n\nFuture dates also use different formats depending on the time difference. If the future date is due to happen within the a month's time, the relative time outputs the format of `in X seconds/minutes/hours/days`. If the time difference is less than 1 minute, it shows `just now`. If the date is in the following months, the format `on D MMM` is used. If the date is in the next year or further, the format `on D MMM, YYYY` is used.\n\n| Time difference | Format                                | Examples                                                                            |\n| --------------- | ------------------------------------- | ----------------------------------------------------------------------------------- |\n| < 1 minute      | just now                              | `just now`                                                                          |\n| < 1 month       | in X seconds / minutes / hours / days | `in a minute`, `in 2 minutes`, `in an hour`, `in 7 hours`, `tomorrow`, `in 14 days` |\n| > 1 month       | on D MMM                              | `on 18 Nov`                                                                         |\n| Next year       | on D MMM, YYYY                        | `on 26 Aug, 2021`                                                                   |\n\n#### Standalone\n\nThe relative dates can be used within a sentence, following the action that it's relative to, or as an independent elements when the content and the surrounding elements make it clear what the time is related to.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={5}>\n  <div>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/912236/208956681-5129e245-2752-4efb-9605-9fd33d762ceb.png\"\n    />\n    <Caption>Use standalone relative dates on items where its title references the action.</Caption>\n  </div>\n  <div>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/912236/208956687-503e9f34-2e95-46d1-9333-cd9cc7238ed3.png\"\n    />\n    <Caption>Use standalone relative dates a timeline item where the section title references the action.</Caption>\n  </div>\n</Box>\n\n#### Links\n\nThe relative dates are used as plain text in most cases. However, they can be used to point to a list of historical changes, a timeline, or as an anchor link for nested information in a view. For example, a date could be used to link to a comment in a conversation thread.\n\n<img\n  width=\"960\"\n  alt=\"A relative time as a link to a comment in a conversation.\"\n  src=\"https://user-images.githubusercontent.com/912236/208957419-46174cce-00c1-4d18-8551-62c7a89c8148.png\"\n/>\n\n#### Responsive design and micro format\n\nRelative dates must remain readable and accessible in different screen sizes. We encourage to use long date formats (e.g. `2 months ago`) instead of the `micro` format (e.g. `2mo`) on mobile screens or narrow spaces, as it can be difficult for users to understand, it doesn't support browser translation, and causes issues with assistive technologies. For example, some screen readers, such as VoiceOver for mac, will read out `1m` as `1 meter`.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/912236/209098128-37111f46-3b53-4201-82d3-be5721effe5a.png\"\n      role=\"presentation\"\n    />\n    <Caption>Use readable, long date formats, and adapt the layout to the available space.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/912236/209098133-3452047c-4931-4460-bb3b-d4b9d9e51fb4.png\"\n      role=\"presentation\"\n    />\n    <Caption>\n      Don't use narrow date formats, specially if there's a prominent space available or the layout can be adapted to\n      the screen size.\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\n### Precise dates\n\nFor dates that needs to represent a precise date and time which the user should be aware of, dates should be displayed in a precise format that includes the weekday, date, month and if appropriate the hours minutes and seconds. This will take the format of `weekday, MMM D, YYYY, HH:MM:SS [AP]M`. The placement of these items may be different depending on locale.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/912236/209115253-82ea4a79-62a2-494b-9367-1f31786ba99c.png\"\n      role=\"presentation\"\n    />\n    <Caption>Use precise dates for future relevant dates.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/912236/209115031-e493457c-f62b-454a-ab52-4ec62b17ce11.png\"\n      role=\"presentation\"\n    />\n    <Caption>Don't use relative dates for future specific dates.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/912236/209114717-1019f9f1-d0ae-4342-8ae3-849eda5dd835.png\"\n      role=\"presentation\"\n    />\n    <Caption>Use precise dates when the user needs to know the exact time of past dates.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/912236/209114722-6eedf092-49b2-4c61-8657-1a462710ebee.png\"\n      role=\"presentation\"\n    />\n    <Caption>Don't use relative dates for past specific dates.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Elapsed or remaining dates\n\nFor dates which represent the start or (expected) end of a currently running task or job, it is more useful to display the elapsed time since the task began, or remaining time until the task ends. This takes the long format of `X years, X months, X days, X hours, X minutes, X seconds` or the compact format of `Xy Xm Xd Xh Xm Xs`. Any `0` values will not be displayed. For some tasks where the expected end time is further away and second precision is not needed, it may be useful to display less precise data, such as down-to-the-day, taking the format of `Xy Xm Xd`.\n\n| Precision | Format            | Examples                              |\n| --------- | ----------------- | ------------------------------------- |\n| second    | Xy Xm Xd Xh Xm Xs | `4s`, `5m 32s`, `1d 4h 32s`           |\n| day       | Xy Xm Xd          | `2y 3m`, `2y 8m 5d`, `2m 2d`, `1y 4d` |\n\n<div>\n  <img\n    alt=\"\"\n    src=\"https://user-images.githubusercontent.com/912236/209115404-1100b345-da19-4d17-b42b-b78c2619cec9.png\"\n  />\n  <Caption>Use elapsed dates to represent the duration of a single or multiple running tasks.</Caption>\n</div>\n\n## Accessibility\n\nA relative date is treated like a [time](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time) element. It contains a [title](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title) showing the precise localised date.\n","parent":{"relativeDirectory":"ui-patterns","name":"dates-and-times"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/ui-patterns/empty-states.mdx","frontmatter":{"title":"Empty states"},"rawBody":"---\ntitle: Empty states\ndescription: Empty states are used to fill spaces when no content has been added yet, or is temporarily empty due to the nature of the feature.\n---\n\nThese guidelines demonstrate best practices for using the Blankslate component and designing empty states. If you're looking for guidelines on implementation, please refer to [Primer CSS](https://primer.style/css/components/blankslate).\n\n## The Blankslate component\n\nThe Blankslate is made up of several elements that work together to inform the user about a feature and how to proceed forward. Below are the different elements of the component and how to modify them.\n\n![Blankslate anatomy](https://user-images.githubusercontent.com/6846673/62806713-78795380-baa8-11e9-9cbd-1a56fef3247b.png)\n\n### Graphic\n\nThe graphic can bring delight, preview an interface element, or represent the goal of the feature. Graphics should be placed intentionally and with thought about the intention of the content. Graphics also differ in meaning and appeal to the user, which is why the Blankslate component has multiple variations. These variations are outlined later on this page.\n\n### Primary Text\n\nUse primary text to explain the purpose of the empty state, help users feel comfortable to engage with the content, or begin a feature flow. Primary text should sound welcoming, human, and convey the intention of the feature.\n\n### Secondary text\n\nThis optional text is used to inform the user about the feature in more detail. Secondary text should be brief and non-redundant if possible. From the text, users should be able to understand the general purpose of the feature and how it may help them accomplish a goal.\n\n### Primary action\n\nBlankslates can and are encouraged to use one primary action. This button should lead to a feature or component creation flow. Button copy should be kept brief and descriptive. If a button requires further specification, consider adding an Octicon.\n\n### Secondary action\n\nSecondary actions are optional and are represented by a text link located below the primary action button. A secondary action is used to direct a user to additional content about the feature. This might look like `Learn more about X` or \"`Check out the guide on X`.\n\n### Border\n\nThe border is invisible by default, but can be added to help define the structure of the Blankslate component when needed. This can be particularly helpful in page layouts where the Blankslate is not the only content on the screen. For implementation, check out the [Primer CSS Blankslate component](https://primer.style/css/components/blankslate#add-border).\n\n## Variations\n\nEmpty states have multiple variations that can be used in different contexts.\n\n### GitHub marketing icons\n\n[GitHub marketing icons](https://ghicons.github.com/) can be used to represent the feature where the Blankslate is found. Blankslates should default to using a GitHub marketing icon for graphic elements.\n\n![GH Icon Blankslate](https://user-images.githubusercontent.com/6846673/62806619-39e39900-baa8-11e9-9de0-5b2f511d63da.png)\n\n### Code block\n\nBlankslates that use a list of steps or offer instructions in the format of code to get started with a feature can insert a `code` block. This is the case for getting started with packages in GitHub:\n\n![Code block Blankslate](https://user-images.githubusercontent.com/589285/64209577-b83c1c80-ce55-11e9-8b61-8d82713b56a6.png)\n\n## Content and copy\n\nEmpty states should explain features _in addition_ to conveying intention. In the example below, the primary text is used to provide a welcome invitation to creating a positive community while the secondary text supports this intent by informing the user on how to do this by providing a code of conduct.\n\n![code of conduct illustration Blankslate](https://user-images.githubusercontent.com/6846673/62806616-394b0280-baa8-11e9-8a5e-45f0c51aaa22.png)\n\n## First time user experiences\n\nFor first time user experiences, use illustration Blankslates to playfully engage the user and introduce the Octocat as a symbol of GitHub. Primary text should welcome the user to the platform and feature. Secondary text should seek to educate the user, but at a simpler, less-technical level.\n\n![first time user Blankslate](https://user-images.githubusercontent.com/6846673/62813307-efb9e200-babe-11e9-93e7-a6fd45d7f942.png)\n","parent":{"relativeDirectory":"ui-patterns","name":"empty-states"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/ui-patterns/feature-onboarding.mdx","frontmatter":{"title":"Feature onboarding"},"rawBody":"---\ntitle: Feature onboarding\ndescription: Onboarding is a virtual unboxing experience that helps users get started with a feature. This is a guide for designing onboarding for the product and does not include what to do for marketing pages, email announcements, social media, etc.\n---\n\nimport {Box} from '@primer/react'\n\nWhen designing a feature onboarding flow, remember to:\n\n- ✅ Think creatively utilizing different ways to onboard users, including patterns that are not explicitly mentioned in this document.\n- ✅ Create a well-rounded feature release campaign that may leverage both on and off-product avenues.\n- 🚫 Do not leave feature announcement campaigns running forever.\n\n## Usage guidelines\n\n### Proximity and proportion\n\n- Onboarding elements should be close to where the feature will live in perpetuity.\n- Consider the primary task on a page before disrupting the user with a feature callout.\n- Keep in mind the context, placement, and dominance of an onboarding element.\n- Onboarding UI choices should be proportional to the functional hierarchy of the feature on the page.\n\n### Do not derail or trap the user\n\n- Make it clear to the user how they may dismiss the message and return to their original task quickly.\n- Maintain context if a call-to-action links to a new page, i.e. open the link in a new tab or window to avoid losing a user's work.\n\n### Set clear campaign limits\n\nCreate a new feature release timeline with clear parameters and an appropriate ramp down plan:\n\n- **Define why**\n  - System triggers, e.g. a new feature released, a user should not need to dismiss the same announcement each time they visit a different repository.\n  - User triggers, e.g. a user visits a specific repository for the first time, if recurring, a user should feel added value each time they see the message.\n  - Consider how triggers may be tallied for users who belong to multiple repositories and organizations.\n- **Define when**\n  - Timebox to a maximum number of days a coordinated campaign will run across all targeted users.\n  - Specify a maximum number of impressions a user should see an in-product message. Respect when a user dismisses a message.\n\n### Avoid traffic collisions\n\n- Avoid showing too many alerts at the same time. Collisions are awkward and undesirable, no more than 2 alerts a time.\n- Consider what other alerts, teaching bubbles, or banners may be active on the page when crafting an onboarding experience.\n\n<Dont>\n  <img\n    src=\"https://user-images.githubusercontent.com/66705495/92283281-6e48a500-eeb4-11ea-9b3c-5f3a95ef0479.png\"\n    alt=\"Screenshot of two teaching bubbles overlapping\"\n  />\n  <Caption>Don't forget to check coinciding feature releases on the same page.</Caption>\n</Dont>\n\n### Create efficient sequences\n\nSequence tasks in a logical way to increase onboarding success. Clearly define when a user starts and successfully completes an onboarding flow.\n\nTreat feature onboarding as a story or a journey with a beginning, middle, and end.\n\n#### Beginning: Draw attention to the feature\n\n- Invite the user to engage with an onboarding journey.\n- Use teaching bubbles, alert banners, the feature preview tray or announcement modals to draw attention to the feature.\n\n<DoDontContainer stacked>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/66705495/92768625-0929ff00-f34d-11ea-9524-bb3f88a4681e.png\"\n      alt=\"Example of the Blank Slate component in the Wiki tab of a repository.\"\n    />\n    <Caption>\n      Use empty states or alert banners to call attention to a feature if users may discover the feature when starting a\n      task.\n    </Caption>\n  </Do>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/66705495/92768727-2363dd00-f34d-11ea-84bf-36c2f3670589.png\"\n      alt=\"Example of a teaching bubble pointing out a new collaboration tool on GitHub\"\n    />\n    <Caption>\n      Use teaching bubbles or other easily dismissable elements if users will discover the feature when they are\n      completing another task.\n    </Caption>\n  </Do>\n</DoDontContainer>\n\n#### Middle: Guide users through their task\n\n- Use form, checklist, or other components to help users complete their task.\n\n<Box display=\"flex\" alignItems=\"center\" flexDirection=\"column\" my={3}>\n  <Box\n    borderWidth=\"1px\"\n    borderStyle=\"solid\"\n    borderColor=\"border.default\"\n    borderRadius={2}\n    width={9 / 12}\n    mb={2}\n    overflow=\"hidden\"\n  >\n    <img\n      src=\"https://user-images.githubusercontent.com/6744014/89254411-e8df8580-d5d3-11ea-969f-5080a8c6b0d4.png\"\n      alt=\"Example of a checklist on GitHub with two uncompleted tasks and one completed task\"\n    />\n  </Box>\n  <p>Example of a checklist.</p>\n</Box>\n\n#### End: Celebrate the finish\n\n- Clearly define when a user starts and successfully completes an onboarding flow.\n- Use a toast, flash alert, or other messages to confirm the user has completed their task. Messages should be short and concise.\n\n<Box display=\"flex\" alignItems=\"center\" flexDirection=\"column\" my={3}>\n  <Box\n    borderWidth=\"1px\"\n    borderStyle=\"solid\"\n    borderColor=\"border.default\"\n    borderRadius={2}\n    width={9 / 12}\n    mb={2}\n    overflow=\"hidden\"\n  >\n    <img\n      src=\"https://user-images.githubusercontent.com/66705495/92781977-7348a100-f359-11ea-9ed1-924f4ea8567a.png\"\n      alt=\"Example of the success state toast component \"\n    />\n  </Box>\n  <p>Example of a toast.</p>\n</Box>\n\n## Teaching bubble\n\nA teaching bubble is a [popover](https://primer.style/css/components/popover) that calls attention to a feature in a specific part of the page. Generally, teaching bubbles should be used to educate the user and enrich the task at hand.\n\n### Usage guidelines for teaching bubble\n\nTeaching bubble Figma [sticker sheet](https://www.figma.com/file/Y2xJLFBrU7yyiDLlEkQXcF/Primer-Interfaces?node-id=2%3A1295&t=2xX6FwLSJ0Cq9Qkp-1).\n\n<DoDontContainer>\n<Do>\n\n- Highlight a new feature or important feature that extends or improves the user's experience on the page.\n- Show one teaching bubble at a time.\n- Include a headline that states the purpose of the message.\n- Keep messages short and concise, around 160 characters.\n- Make it clear how to easily dismiss the popover.\n- Include supplementary information when applicable. Consider a \"Learn more\" link in the message body that opens a new window or tab without destroying a user's work or context.\n\n</Do>\n<Dont>\n\n- Don't point to hidden elements.\n- Don't use a teaching bubble if the user cannot immediately interact or benefit from the highlighted feature.\n- Don't derail users; call-to-actions should not remove the user from their current context.\n\n</Dont>\n</DoDontContainer>\n\n### Variations\n\n<table>\n  <tr>\n    <td></td>\n    <th>Example</th>\n    <th>Notes</th>\n  </tr>\n  <tr>\n    <th>Default</th>\n    <td>\n      <img\n        src=\"https://user-images.githubusercontent.com/6744014/89239384-dc483680-d5ad-11ea-9463-3c56e1feefd9.png\"\n        alt=\"Example of a default teaching bubble\"\n      />\n    </td>\n    <td>\n      Generally, use a descriptive dismiss button over a close icon. \"OK, got it\" is the default dismissal button copy.\n    </td>\n  </tr>\n  <tr>\n    <th>Condensed</th>\n    <td>\n      <img\n        src=\"https://user-images.githubusercontent.com/6744014/89239379-db170980-d5ad-11ea-8327-fa8b035f5e0c.png\"\n        alt=\"Example of a condensed teaching bubble\"\n      />\n    </td>\n    <td>\n      Use a close icon for condensed messages. Remember to apply the correct tab order for screen readers to easily\n      dismiss the teaching bubble at the end of the message.\n    </td>\n  </tr>\n  <tr>\n    <th>Multiple buttons</th>\n    <td>\n      <img\n        src=\"https://user-images.githubusercontent.com/6744014/89239536-58427e80-d5ae-11ea-9578-05c74c7701da.png\"\n        alt=\"Example of a teaching bubble with multiple buttons\"\n      />\n    </td>\n    <td>\n      Invite the user to engage with the value proposition promised. Include dismiss as a secondary button as \"OK,\n      dismiss\". Additional links that takes the user to a new page should be linked from the text and must open in a new\n      tab or window to prevent losing the user’s context.\n    </td>\n  </tr>\n  <tr>\n    <th>Emoji</th>\n    <td>\n      <img\n        src=\"https://user-images.githubusercontent.com/6744014/89239385-dc483680-d5ad-11ea-97e9-9ea6f54fe451.png\"\n        alt=\"Example of a teaching bubble with an emoji\"\n      />\n    </td>\n    <td>Use emojis to inject personality into the message.</td>\n  </tr>\n  <tr>\n    <th>Pictograms</th>\n    <td>\n      <img\n        src=\"https://user-images.githubusercontent.com/6744014/89239387-dce0cd00-d5ad-11ea-898b-b574bb837836.png\"\n        alt=\"Example of a teaching bubble with pictograms\"\n      />\n      <img\n        src=\"https://user-images.githubusercontent.com/6744014/89239389-dd796380-d5ad-11ea-84f4-c0819100fc2a.png\"\n        alt=\"Example of a teaching bubble with a pictogram\"\n      />\n    </td>\n    <td>Use pictograms to represent the feature.</td>\n  </tr>\n  <tr>\n    <th>Illustrations and gifs</th>\n    <td>\n      <img\n        src=\"https://user-images.githubusercontent.com/6744014/90083962-d39be280-dcc8-11ea-9d38-4bc24f759ba9.gif\"\n        alt=\"Example of a teaching bubble with a GIF\"\n      />\n    </td>\n    <td>Visually communicate or demonstrate a complex feature with illustrations and gifs to supplement a message.</td>\n  </tr>\n</table>\n\n## Inline feature discovery\n\nInline feature discovery is a way to highlight features without obscuring other parts of the page while a user may be performing an existing task.\n\n### Page banner\n\nUse page banners for announcements that are relevant to the core task on the current page. Remember to consider using other feature announcement patterns or marketing strategies instead of disturbing the user with multiple announcements.\n\nInclude a clear way for users to dismiss a page banner and [clear campaign parameters](#set-clear-campaign-limits).\n\n<DoDontContainer stacked>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/66705495/92768839-41314200-f34d-11ea-8f62-dfca0d43adf0.png\"\n      alt=\"Example of a page banner on the code tab of a repository\"\n    />\n    <Caption>\n      Call out a major feature or change in a page with an invitation to engage and a clear way to dismiss.\n    </Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/66705495/92768935-56a66c00-f34d-11ea-8b78-18ca99bd0350.png\"\n      alt=\"Example of a page banner pointing out a small feature change\"\n    />\n    <Caption>Don't use a page banner to disproportionately highlight a small feature.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Inline banner\n\nUse inline banners in a page with multiple steps or actions.\n\n<table>\n  <tr>\n    <td></td>\n    <th>Example</th>\n    <th>Notes</th>\n  </tr>\n  <tr>\n    <th>Inline feature banner</th>\n    <td>\n      <img\n        src=\"https://user-images.githubusercontent.com/6744014/88744364-f5f40480-d0fb-11ea-97c4-5ab87b548a2c.png\"\n        alt=\"Example of an inline feature banner\"\n      />\n      <p>A short introduction to the Wiki feature while configuring repository settings.</p>\n    </td>\n    <td>\n      Organization, repository, or user settings, where a feature is managed and customized, inline alert banners can\n      highlight relevant features that may help better accomplish a user’s task.\n    </td>\n  </tr>\n  <tr>\n    <th>Hidden revealed</th>\n    <td>\n      <img\n        src=\"https://user-images.githubusercontent.com/6744014/89241458-d35a6380-d5b3-11ea-9307-52c8ae80f2d3.png\"\n        alt=\"Example of an inline banner revealing an easter egg\"\n      />\n      <p>Discovering the Profile Readme when creating a new repository.</p>\n    </td>\n    <td>\n      Sometimes features can be hidden for users to discover. Show a <a href=\"\">Primer alert</a> at pivotal moments to\n      signal the user they're on the right track and provide more information.\n    </td>\n  </tr>\n</table>\n\n### Empty states\n\nUse empty states as an integrated way to onboard users to new features. Read more about [empty states](/ui-patterns/empty-states).\n\n#### In-product marketing empty state\n\nFor special occasions, a first time experience may be more unique than the typical blank state. Take a more branded approach to engage and guide the user through complex experiences. Be aware of how the experience will change once the first-time UI is no longer there.\n\n<Box display=\"flex\" alignItems=\"center\" flexDirection=\"column\" my={3}>\n  <Box\n    borderWidth=\"1px\"\n    borderStyle=\"solid\"\n    borderColor=\"border.default\"\n    borderRadius={2}\n    width={9 / 12}\n    mb={2}\n    overflow=\"hidden\"\n  >\n    <img\n      src=\"https://user-images.githubusercontent.com/6744014/88744262-b3cac300-d0fb-11ea-9752-c43722a30399.png\"\n      alt=\"Screenshot of the empty state for GitHub actions\"\n    />\n  </Box>\n  <p>GitHub Actions branded first-time user experience</p>\n</Box>\n\n## Designated feature discovery areas\n\nThe designated feature discovery areas are generally detached from where the feature actually lives and have a clear click-through for the user to try out the feature or to learn more.\n\n### Dashboard feature bulletin\n\nThe top of the right sidebar in a user’s dashboard (logged-in home) is a designated area for feature discovery. They take the user directly to the feature in the product or the relevant marketing page.\n\nWhen using a dashboard feature bulletin:\n\n- Limit messages to around 160 characters.\n- If there is a click-through, include a descriptive button; avoid hidden links.\n- Use color, with discretion, to spotlight and bring brand feature personality to the announcement.\n\n<Box display=\"flex\" alignItems=\"center\" flexDirection=\"column\" my={3}>\n  <img\n    mb={2}\n    src=\"https://user-images.githubusercontent.com/6744014/89245516-d22e3400-d5bd-11ea-8124-110a698562d2.png\"\n    alt=\"Example of a bulletin that leads to a marketing page\"\n  />\n  <p>An announcement about GitHub Teams in the feature preview bulletin leads to an off-platform marketing page.</p>\n</Box>\n\n### Beta feature preview dialog\n\nFeature previews allow teams to test features in production with users who opt in. A feature under the beta preview will be added to the Feature Preview dialog, accessible through the user dropdown.\n\n**Note:** Features in beta testing should have a comprehensive release and redaction plan. No feature should remain in beta for longer than 2 months unmonitored.\n\n![Beta feature preview dialog](https://user-images.githubusercontent.com/6744014/89245313-6b107f80-d5bd-11ea-86cb-b697c61a2d99.png)\n\n## Lifecycles (labels)\n\nLabels are a softer way to accentuate new features without derailing the user from their primary task.\n\nConsider using standalone labels for features that appear in a user’s current view but may navigate away from their current page to fully engage with the feature.\nIf the label is not part of a navigational item then it's important to include a `Give feedback` or `Learn more` link to collect info on how the changes are perceived by the user.\n\n### Lifecycles\n\nDepending on the size and impact of your ship you might only release to a fraction of users.\nThere are currently 4 main lifecycles: `Alpha`, `Beta (Private | Public | Limited public)`, `General audience (GA)` and `Deprecation`.\n\n| Preview                                                                                                                       | Name                            | Users                 | Required (unless navigation)   |\n| ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | --------------------- | ------------------------------ |\n| <img width=\"177\" src=\"https://user-images.githubusercontent.com/980622/205132473-cf383aec-23bd-4aff-8cb3-fa55d6605017.png\" /> | Alpha                           | Internal              | Include a `Give feedback` link |\n| <img width=\"177\" src=\"https://user-images.githubusercontent.com/980622/205132479-f06472d3-f284-483d-83c4-d4fcb6e34827.png\" /> | (Private, Limited, Public) Beta | Internal and external | Include a `Give feedback` link |\n| <img width=\"177\" src=\"https://user-images.githubusercontent.com/980622/205132482-4fbc72e8-f206-4a42-8f90-ffbd5f76f565.png\" /> | General audience                | Everyone              | Include a `Give feedback` link |\n| <img width=\"177\" src=\"https://user-images.githubusercontent.com/980622/205132483-d0e172a7-5c14-4687-a47f-ea31914208a2.png\" /> | Deprecation                     | Everyone              | Include a `Learn more` link    |\n\nWe recommend collecting feedback through a discussion to be able to follow up with the user without any friction. If we are deprecating a feature it's important to provide additional info through our documentation.\nNote that features that were never promoted beyond the `Alpha` lifecycle do not need to go through a deprecation lifecycle.\n\n### Color and terminology\n\nIt's important to stick to the correct terminology and label color when referring to a lifecycle.\n\n<DoDontContainer>\n  <Do>\n    <img src=\"https://user-images.githubusercontent.com/980622/205090973-2c05a0d8-3406-4d54-9e6d-00b29e236395.png\" />\n    <Caption>Use the correct label and link color</Caption>\n  </Do>\n  <Dont>\n    <img src=\"https://user-images.githubusercontent.com/980622/205090963-c5889708-12bc-44ca-8a9e-801612c92656.png\" />\n    <Caption>Don't change the label or link color</Caption>\n  </Dont>\n</DoDontContainer>\n","parent":{"relativeDirectory":"ui-patterns","name":"feature-onboarding"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/ui-patterns/forms.mdx","frontmatter":{"title":"Forms"},"rawBody":"---\ntitle: Forms\ndescription: Primer's form design guidelines aim to minimize the effort and cognitive load required to complete a task that requires data input from the user. For example, creating a new repo configuring settings, and logging in.\n---\n\nimport {Box, Heading} from '@primer/react'\n\n## Form control anatomy\n\n![diagrams labeling the anatomy of a text field and a checkbox field](https://user-images.githubusercontent.com/2313998/171692166-43d45c4b-509a-4f68-9e8b-1577658b493e.png)\n\n### Label (required)\n\nLabels should be descriptive and concise: aim for no more than 3 words. Write labels in sentence case. Examples: \"Repository name\", \"Payment method\".\n\nIf you're having trouble keeping label text short, consider using a [caption](#caption) to provide more context.\n\nPlaceholder text is never an acceptable substitute for a label because:\n\n- The placeholder text disappears as soon as the input has a value\n- Placeholder text colors are typically too light to meet the minimum color contrast ratio required for accessibility\n- Screen readers do not read placeholder text as a label\n\n### Required field indicator\n\nWhen a field is required to have a value, it should be visibly marked as required. An individual checkbox or radio button cannot be marked as required.\n\n### Input (required)\n\nThe input is what the user interacts with to set the value of the form control. You may pre-fill inputs with smart default values, but be careful about making too many assumptions about what a user wants or needs.\n\n### Caption\n\nA caption may be used to provide additional context about the field to help users fill in the correct data or explain how the data will be used. Caption text should be as short as possible.\n\nCaption text may be displayed alongside a validation message, or it may be hidden if it only provides redundant information.\n\nCaption text may be used to augment the [label](#label-required), but should not be redundant with the label or any other parts of the form control. If the caption feels redundant, try removing it.\n\n<DoDontContainer>\n  <Do>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/170069904-5ff41e86-a95f-4644-b1af-1b8a6225dc59.png\"\n    />\n    <Caption>Use caption text that shows new information and provides helpful context</Caption>\n  </Do>\n  <Dont>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/170069907-5a147b22-0856-4c61-91a2-f9c1db8e941d.png\"\n    />\n    <Caption>Don’t use caption text that is redundant</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Validation message\n\nA single validation message may be displayed to provide helpful information for a user to complete their task. For example: explain why a value is invalid so they can correct it and submit the form.\n\nAn individual checkbox or radio should not have its own validation message or style.\n\n<DoDontContainer>\n  <Do>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/170069916-08bcf5c6-9a8f-4998-a246-39d7f020e94b.png\"\n    />\n    <Caption>Show a validation message for the group of inputs</Caption>\n  </Do>\n  <Dont>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/170069919-d557c4d8-ed4d-4a3c-80c7-3372359603ab.png\"\n    />\n    <Caption>Don’t show a validation message for each input</Caption>\n  </Dont>\n</DoDontContainer>\n\nInformation from the caption should not be repeated in the error message. Show the validation message and remove the caption. A validation message makes the field easier to spot when a user is scanning for invalid fields.\n\n<DoDontContainer>\n  <Do>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/170069909-b9ad91e4-db88-42c0-bc83-d2f00f24a66e.png\"\n    />\n    <Caption>Hide a caption that is redundant with the validation message</Caption>\n  </Do>\n  <Dont>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/170069912-d8dfdde4-08bd-47ab-b9fe-3ab0f0f603a5.png\"\n    />\n    <Caption>Don’t show a repetitive validation message</Caption>\n  </Dont>\n</DoDontContainer>\n\nFor more information about form validation, see the [validation guidelines](#validation).\n\n## Input methods\n\n### Open-ended text\n\n![Text input, open-ended autocomplete text input, plain text input, textarea](https://user-images.githubusercontent.com/2313998/170069913-325a987b-9a75-4e83-826a-bb7ae73d6831.png)\n\nUse an open-ended text field when the field does not have a list of possible values. If the input is able to suggest values, use [autocomplete](/components/avatar-pair) to allow users to pick a value or enter their own.\n\n### A set of selectable options\n\n![Action menu, autocomplete input with limited options, checkbox group, radio group, select](https://user-images.githubusercontent.com/2313998/170069915-657a6291-2729-4e3e-abbc-b7611f8051dc.png)\n\nShow a set of selectable options when there is a finite number of possible values.\n\n## Structure\n\nForms should have a structure that makes it easy for users to scan. Forms that flow vertically are easier for sighted users to scan visually.\n\n<DoDontContainer>\n  <Do>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/170069921-98bb9035-2125-4807-b790-1da90e6bde3b.png\"\n    />\n    <Caption>Default to vertically stacked form controls</Caption>\n  </Do>\n  <Dont>\n    <img\n      role=\"presentation\"\n      src=\"https://user-images.githubusercontent.com/2313998/170069922-ed8a0ef7-0573-4f02-bd15-da6a5acbc527.png\"\n    />\n    <Caption>Don’t lay out forms that flow into columns just to reduce the vertical space used by the form</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Order of form controls\n\nForm fields should be in a predictable order that flows intuitively.\n\nTo achieve an intuitive flow:\n\n- Order fields by their relative level of importance\n- Keep related fields near each other\n- When possible, keep inputs that require keyboard input near each other so that users who use a mouse don't have to switch back and forth between clicking and typing\n\n### Sizing form controls\n\n#### Hint at the expected length of the value\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/2313998/170069941-0e7ead2f-1e20-47dc-b7b0-e7a27480d2a5.png\"\n  />\n  <Box>\n    <Box as=\"p\" mt=\"0\">\n      Form controls should be sized to fit their value. Start with the browser default width, and adjust as needed.\n    </Box>\n    <Box as=\"ul\" pl=\"1rem\">\n      <li>\n        Single-line text inputs get a default width set by the browser, but their width can be changed to fit the\n        approximate length of their text.\n        <ul>\n          <li>\n            If the text length could fall into a wide range, then either keep the browser-default length, or fill the\n            width of its parent.\n          </li>\n        </ul>\n      </li>\n      <li>\n        Multi-line text inputs <a href=\"#textarea\">Textarea</a> get a default width and height set by the browser, but\n        its dimensions can be changed to fit longer blocks of text.\n      </li>\n      <li>\n        Select dropdown widths are set by the browser to be as wide as the text of it's longest option. We shouldn't\n        override this width unless it's to make the dropdown fill the width of its parent.\n      </li>\n      <li>Checkbox and radio inputs have static dimensions</li>\n    </Box>\n  </Box>\n</Box>\n\n#### Maintain page hierarchy\n\nInput components ship with size variants that adjust font size and padding to maintain consistent hierarchy with adjacent elements.\n\n### Grouping form controls\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    width=\"456\"\n    alt=\"visually grouped of related inputs\"\n    src=\"https://user-images.githubusercontent.com/2313998/170069926-230f01ae-6371-4b4b-9b79-c2a82a7f5d2e.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    When there is a collection of closely related fields, they should be labeled and visually grouped together. For\n    example: putting form controls closer together.\n  </Box>\n</Box>\n\n### Progressively disclosed form controls\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    width=\"456\"\n    alt=\"form section where controls are hidden until the feature is enabled\"\n    src=\"https://user-images.githubusercontent.com/2313998/170069928-5ea261f4-78c1-44d6-92f4-95392d12b47f.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    To keep forms concise, you may choose to hide or show form controls based on selections the user has made.\n  </Box>\n</Box>\n\n#### Nested form controls\n\nSometimes, progressively disclosed form controls can be visually nested under a parent form control. A common pattern is to use a checkbox or radio “checked” state to decide whether to show a related form control.\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    width=\"456\"\n    alt=\"Primary discipline radio buttons, selected 'Other' option reveals a text input\"\n    src=\"https://user-images.githubusercontent.com/2313998/170069930-87ffd7f3-89db-4a0a-bca3-64d0244e54a3.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    If the parent form control provides sufficient visual context, you may visually hide the label. However, you must\n    specify text for a visually hidden label that is accessible to screen readers.\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box flexGrow={1} flexShrink={0} flexBasis={['column', 'column', 'column', 'column', '456px']}>\n    <img\n      width=\"456\"\n      alt=\"Checkbox that progressively discloses a dropdown with an internal label\"\n      src=\"https://user-images.githubusercontent.com/2313998/170069931-24cf2caa-148d-49bd-b1dc-361ec1ea8b61.png\"\n    />\n    <img\n      width=\"456\"\n      alt=\"Checkbox that progressively discloses a labeled select input\"\n      src=\"https://user-images.githubusercontent.com/2313998/170069932-37f1d07d-f7ef-4021-b74c-f217a990296f.png\"\n    />\n  </Box>\n  <Box as=\"p\" mt=\"0\" flexShrink={1}>\n    If the parent form control does not provide sufficient context, a visible label should be shown. Make sure the label\n    of the nested form control doesn’t clash with the label of its parent form control.\n  </Box>\n</Box>\n\nSee [progressive disclosure](/ui-patterns/progressive-disclosure) for more information.\n\n## Validation\n\nUse Primer instead of browser-native validation UI. Browser-native validation messages are not accessible to screen readers, and they visually clash with Primer styles.\n\nDisabled buttons are discouraged, as they don't clearly communicate what actions a user should take to complete a form.\n\nInstead, consider the following validation methods.\n\n### Validation statuses\n\n<Box mb={3} display=\"flex\" alignItems=\"flex-start\" flexDirection={[\"column\", \"column\", \"column\", \"column\", \"row\"]} sx={{gap: 3}}>\n  <Box flexGrow={1} flexBasis=\"0\">\n    <img\n        alt=\"input with forbidden characters\"\n        src=\"https://user-images.githubusercontent.com/2313998/170069933-233fd82d-7af8-4475-b73c-65bec80a3891.png\"\n    />\n    <Box as=\"p\" mt=\"0\"><strong>Error messages:</strong> An invalid field should always have a message explaining why the value does not pass validation. The message should explain why the value is invalid, and unblock users from completing their task by guiding them to a valid value.</Box>\n  </Box>\n\n  <Box flexGrow={1} flexBasis=\"0\">\n    <img\n        alt=\"valid repo name success\"\n        src=\"https://user-images.githubusercontent.com/2313998/170069936-48ddd7de-9cdb-4c18-bccd-18fa4a39bcf0.png\"\n    />\n    <Box as=\"p\" mt=\"0\"><strong>Success messages:</strong> A success message may be used when a user might need extra assurance that the field's value is valid. For example: when creating a repository name, it’s nice to be assured that the name is available and valid.</Box>\n  </Box>\n</Box>\n\n### Validation on submit\n\nThe default behavior of the web is to perform validation when the user attempts to submit the form. This lets the user flow quickly through the form without interruption.\n\nWhen the form fails validation, guide the user to the invalid inputs:\n\n- If the form has 3 or more errors, you may show an [interactive summary of errors](#interactive-summary-of-errors)\n- If an interactive summary of errors is not shown, the first invalid input should be focused and scrolled into the viewport\n\nAfter a form has been submitted and failed validation, you may switch to inline validation to provide quicker feedback.\n\n#### Interactive summary of errors\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    width=\"456\"\n    alt=\"a form for biographical information that has three invalid inputs\"\n    src=\"https://user-images.githubusercontent.com/2313998/170069940-44aec752-e840-4e51-abe5-fd45226f0388.png\"\n  />\n  <div>\n    <Box as=\"p\" mt=\"0\">\n      In a <a href=\"/design/ui-patterns/messaging#flash-alerts\">flash alert</a> at the top of the form, list the invalid\n      inputs as anchor links. When the link is activated, place focus in it's corresponding input.\n    </Box>\n    <Box as=\"p\" mt=\"0\">\n      When the flash alert appears, it should be focused.\n    </Box>\n  </div>\n</Box>\n\n### Inline validation\n\n<Note variant=\"warning\">\n  Inline validation offers immediate feedback, but be sure to consider the following drawbacks.\n\n  <ul>\n    <li>There is a negative impact on perceived performance when validating server-side.</li>\n    <li>When a screen reader user moves focus from the invalid input to the next form control, they will be interrupted by the validation message of the previous form control.</li>\n  </ul>\n</Note>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box flexShrink={0}>\n    <CustomVideoPlayer\n      width=\"456\"\n      loop\n      src=\"https://user-images.githubusercontent.com/2313998/170273001-3e722629-bcb3-4677-83b5-cfde9296ca52.mp4\"\n    />\n  </Box>\n  <Box as=\"p\" mt=\"0\">\n    If the form control is in a valid state, validation should be performed until after the user has made a change to\n    the input <strong>and has removed focus from the input</strong>.\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box flexShrink={0}>\n    <CustomVideoPlayer\n      width=\"456\"\n      loop\n      src=\"https://user-images.githubusercontent.com/2313998/170273004-913ba77a-041f-43e5-9809-0d2c303cf518.mp4\"\n    />\n  </Box>\n  <Box as=\"p\" mt=\"0\">\n    Don't attempt to validate an input before the user is done with it. Validation may be performed as the user is\n    typing or making their selection, but only <strong>after the first time the input has been validated</strong> and\n    the <strong>input is in an invalid state</strong>. This gives the user early positive feedback by removing the error\n    if the user makes a change that fixes it.\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box flexShrink={0}>\n    <CustomVideoPlayer\n      width=\"456\"\n      loop\n      src=\"https://user-images.githubusercontent.com/2313998/170273002-677fea75-265a-42d7-b8e8-f5a07128ca38.mp4\"\n    />\n  </Box>\n  <Box as=\"p\" mt=\"0\">\n    If the form control’s validation is likely to take more than 1 second, show a loading indicator.\n  </Box>\n</Box>\n\n## Submission\n\nForms should follow consistent patterns for [submitting and saving data](/ui-patterns/saving).\n\n## Related components\n\n<Box\n  mb={4}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    width=\"456\"\n    role=\"presentation\"\n    src=\"https://user-images.githubusercontent.com/293280/123881067-cdbaea00-d8f8-11eb-98e4-e57c64489308.png\"\n  />\n  <div>\n    <Heading sx={{fontSize: 3}}>Action menu with selection</Heading>\n    <p>\n      If the parent form control provides sufficient visual context, you may visually hide the label. However, you must\n      specify text for a visually hidden label that is accessible to screen readers.\n    </p>\n    <a href=\"https://primer.style/react/ActionMenu#with-selection\">Primer React implementation</a>\n  </div>\n</Box>\n\n<Box\n  mb={4}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    role=\"presentation\"\n    width=\"456\"\n    src=\"https://user-images.githubusercontent.com/2313998/170268364-021748a9-f304-4626-8ff2-3a71a5bcbd6b.png\"\n  />\n  <div>\n    <Heading sx={{fontSize: 3}}>Autocomplete</Heading>\n    <p>\n      An autocomplete input renders a text input that allows a user to quickly filter through a list of options to pick\n      one or more values.\n    </p>\n    <Box display=\"flex\" sx={{gap: 3}}>\n      <a href=\"../components/autocomplete\">Interface guidelines</a>\n      <span aria-hidden=\"true\">|</span>\n      <a href=\"https://primer.style/react/Autocomplete\">Primer React implementation</a>\n    </Box>\n  </div>\n</Box>\n\n<Box\n  mb={4}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    role=\"presentation\"\n    width=\"456\"\n    src=\"https://user-images.githubusercontent.com/2313998/170268367-51ee68d4-8121-4f49-b995-86755a381d6c.png\"\n  />\n  <div>\n    <Heading sx={{fontSize: 3}}>Checkbox group</Heading>\n    <p>A set of checkboxes to let users make one or more selections from a short list of options</p>\n    <Box display=\"flex\" sx={{gap: 3}}>\n      <a href=\"../components/checkbox-group\">Interface guidelines</a>\n      <span aria-hidden=\"true\">|</span>\n      <a href=\"https://primer.style/react/CheckboxGroup\">Primer React implementation</a>\n    </Box>\n  </div>\n</Box>\n\n<Box\n  mb={4}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    role=\"presentation\"\n    width=\"456\"\n    src=\"https://user-images.githubusercontent.com/2313998/170268368-5daef93f-b7d3-4863-938a-9c777c609ee4.png\"\n  />\n  <div>\n    <Heading sx={{fontSize: 3}}>Form control</Heading>\n    <p>A form control renders a labelled input and, optionally, associated validation text and/or hint text.</p>\n    <Box display=\"flex\" sx={{gap: 3}}>\n      <a href=\"../components/form-control\">Interface guidelines</a>\n      <span aria-hidden=\"true\">|</span>\n      <a href=\"https://primer.style/react/FormControl\">Primer React implementation</a>\n    </Box>\n  </div>\n</Box>\n\n<Box\n  mb={4}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    role=\"presentation\"\n    width=\"456\"\n    src=\"https://user-images.githubusercontent.com/2313998/170268369-b9885114-90f0-4bae-863e-ca3ed37aa67d.png\"\n  />\n  <div>\n    <Heading sx={{fontSize: 3}}>Radio group</Heading>\n    <p>A set of radio inputs to let users make a single selection from a short list of options</p>\n    <Box display=\"flex\" sx={{gap: 3}}>\n      <a href=\"../components/radio-group\">Interface guidelines</a>\n      <span aria-hidden=\"true\">|</span>\n      <a href=\"https://primer.style/react/RadioGroup\">Primer React implementation</a>\n    </Box>\n  </div>\n</Box>\n\n<Box\n  mb={4}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    role=\"presentation\"\n    width=\"456\"\n    src=\"https://user-images.githubusercontent.com/2313998/170268372-be76e525-7337-4739-afd0-7e4a12037731.png\"\n  />\n  <div>\n    <Heading sx={{fontSize: 3}}>Select dropdown</Heading>\n    <p>A select input may be used when a user needs to select one option from a long list</p>\n    <a href=\"https://primer.style/react/Select\">Primer React implementation</a>\n  </div>\n</Box>\n\n<Box\n  mb={4}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    role=\"presentation\"\n    width=\"456\"\n    src=\"https://user-images.githubusercontent.com/2313998/170268373-463d55fa-ead8-4471-91f2-2bec2456f385.png\"\n  />\n  <div>\n    <Heading sx={{fontSize: 3}} id=\"textarea\">\n      Textarea\n    </Heading>\n    <p>A text area is used to put multiple lines of text in an input</p>\n    <a href=\"https://primer.style/react/Textarea\">Primer React implementation</a>\n  </div>\n</Box>\n\n<Box\n  mb={4}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    role=\"presentation\"\n    width=\"456\"\n    src=\"https://user-images.githubusercontent.com/2313998/170268374-7d701912-5f6c-45ce-832f-e7c3b1d3c476.png\"\n  />\n  <div>\n    <Heading sx={{fontSize: 3}}>Text input</Heading>\n    <p>\n      A text input is used to set a value that is a single line of text. See the list of{' '}\n      <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\">types in the MDN docs</a>.\n    </p>\n    <Box display=\"flex\" sx={{gap: 3}}>\n      <a href=\"../components/text-input\">Interface guidelines</a>\n      <span aria-hidden=\"true\">|</span>\n      <a href=\"https://primer.style/react/TextInput\">Primer React implementation</a>\n    </Box>\n  </div>\n</Box>\n","parent":{"relativeDirectory":"ui-patterns","name":"forms"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/ui-patterns/index.mdx","frontmatter":{"title":"UI patterns"},"rawBody":"---\ntitle: UI patterns\n---\n\n<ChildPages of=\"UI patterns\" />\n","parent":{"relativeDirectory":"ui-patterns","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/ui-patterns/messaging.mdx","frontmatter":{"title":"Messaging"},"rawBody":"---\ntitle: Messaging\ndescription: Messaging components are used to provide important and relevant information to the user, including feedback, contextual information, product updates, and more.\n---\n\nimport {Box} from '@primer/react'\n\nPrimer includes three different messaging components:\n\n- Toasts\n- [Flash alerts](../components/flash)\n- [Popovers](../components/popover) \n\n## Messaging types\n\nIt's important to consider the context when selecting a component to convey your message. Does the message need to interrupt the user flow? Is this a global message that needs to be shown on every page? Does it require the user to take an action, or is it more of a notice? Most messaging on GitHub falls into one of the following categories:\n\n**Feedback**: communicates something to the user based on an action they've taken or a change in context\n\n- _Toasts or flash alerts are best suited for this type of messaging._\n\n**Highlights**: bring attention to how and why to engage with a feature\n\n- _Popovers are best suited for this type of messaging._\n\n**Updates**: inform the user of necessary updates or changes to the product as it relates to them.\n\n- _Flash alerts are best suited for this type of messaging._\n\n## Toasts\n\n<Box mb=\"3\" mt=\"4\">\n  <img\n    width=\"453\"\n    src=\"https://user-images.githubusercontent.com/586552/63105014-f5477a00-bf4d-11e9-954e-f01582a39ef3.png\"\n  />\n</Box>\n\n[Toasts](https://primer.style/css/components/toasts) are used to provide relevant feedback to the user, typically after they've taken an action. Primer includes styles for success, warning, error, loading, and default toasts. Some examples include:\n\n- Confirmation that an action was successfully taken\n- Communicating that an action is pending\n- Notifying the user if an action failed to complete\n- Providing general information\n\nToasts are best used in context of the page they're referring to (rather than a global notification that can appear on any page) and should require minimal user interaction. Toasts are best used to display time-sensitive information. For global notices and messaging, see the [flash component](#flash-alerts).\n\nToasts should be brief and not bog down the experience with superfluous copy. If multiple toasts appear on the page, they will stack naturally.\n\n<DoDontContainer>\n  <Do>\n    <img src=\"https://user-images.githubusercontent.com/586552/63106528-06de5100-bf51-11e9-8a5e-98583ed74874.png\" />\n    <Caption>Use brief and direct communication</Caption>\n  </Do>\n  <Dont>\n    <img src=\"https://user-images.githubusercontent.com/586552/63106527-06de5100-bf51-11e9-858c-72de6a5c728a.png\" />\n    <Caption>Don't use wordy and redundant copy</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Accessibility\n\nToasts are non-modal components and should contain `role=log`, which implies the element has `aria-live=\"polite\"`. This notifies the user of the toast via Assistance Technologies without having to change focus to the toast. You can read more about `role=log` at [W3: Using `role=log` to identify sequential information updates](https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA23).\n\nToasts are generally informative and should not receive focus when they appear. For that reason, we suggest you **avoid using interactive elements** in the component (aside from a dismiss action). Keep in mind that, even without an explicit dismiss action, the user can always hit `esc` to dismiss the toast. For more information on how interactive children affect web accessibility, [check out this issue](https://github.com/jackbsteinberg/std-toast/issues/29).\n\n## Flash alerts\n\n<Box mb=\"2\" mt=\"4\">\n  <img src=\"https://user-images.githubusercontent.com/586552/63052321-055b4d00-bead-11e9-95ba-1d4cdfb34dae.png\" />\n</Box>\nFlash alerts are used to display updates or alerts pertaining to any part of the system; this includes information regarding\nthe user's account, the organization, the repo, and more. These updates are typically not user-initiated but rather alerts\nthat require the user's attention. Similarly to toasts, flash alerts can convey a warning, error, success, or a neutral message.\n\nThough flash alerts don't need to be as concise as a typical Toast message, they should still be direct and not exceed two to three sentences. If additional context is needed, provide a link for the user to learn more.\n\nDon't use headings or multiple type sizes in flash alerts, rely on our default paragraph size instead.\n\n### Full-width\n\nFlash alerts that affect every page (e.g. a global message) should use the [full-width style](https://primer.style/css/components/alerts), which spans the entire page and is intended to sit beneath the top-level navigation. When using a full-width flash alert, be sure to include the `container` class to append a max-width on the content and avoid long line-lengths, which can be difficult to read.\n\n<DoDontContainer stacked>\n  <Do>\n    <img src=\"https://user-images.githubusercontent.com/586552/63046880-46e5fb00-bea1-11e9-836d-be1b1c7d963f.png\" />\n    <Caption>Use a container class to give the text a max-width</Caption>\n  </Do>\n  <Dont>\n    <img src=\"https://user-images.githubusercontent.com/586552/63046881-46e5fb00-bea1-11e9-87ee-80dbeb0bea1c.png\" />\n    <Caption>\n      Don’t let a single text block span the entire width of the window (non-text elements can still span the entire\n      width, such as left-aligned text and right-aligned buttons)\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\n### Interactive elements\n\nFlash alerts can contain links or buttons depending on the type CTA and how much attention it should draw.\n\nThey typically do not timeout on their own, but can include a dismiss action for messages that can be closed or hidden.\n\n## Popovers\n\n<Box display=\"flex\" flexDirection={['column', 'row', 'row']}>\n  <Box mr=\"3\"  mb=\"2\">\n    <img width=\"262\" src=\"https://user-images.githubusercontent.com/586552/63109550-8111d400-bf57-11e9-8714-46607da2f2ba.png\" />\n\n  </Box>\n  <Box mb=\"2\">\n    <img width=\"386\" src=\"https://user-images.githubusercontent.com/586552/63109551-8111d400-bf57-11e9-893b-2cdeffffd147.png\" />\n  </Box>\n</Box>\n\nPopovers are used to call attention to a new feature, change to an existing feature, or to provide additional context. Popovers can be helpful for flows that require light onboarding or instruction.\n\n**Use sparingly to avoid cognitive overload**. Though they can be used for a variety of things, they should be used sparingly to avoid cognitive overload. It's important to consider the context in which the popover appears. Are there other popovers on the page? Does it appear on page load, or require the user to open the popover?\n\nUnlike other messaging components, popovers should never include critical information (such as errors) and should always include a dismiss action.\n","parent":{"relativeDirectory":"ui-patterns","name":"messaging"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/ui-patterns/progressive-disclosure.mdx","frontmatter":{"title":"Progressive disclosure"},"rawBody":"---\ntitle: Progressive disclosure\ndescription: These guidelines summarize how GitHub implements progressive disclosure—an interaction design pattern that hides/shows information—as well as guiding principles, best practices, and implementation support.\n---\n\nimport {Box} from '@primer/react'\n\n## Guiding principles\n\n### Maintain context for users\n\nWhen designing interfaces that incorporate progressive disclosure, refrain from creating interactions that drastically disorient the user’s initial point of focus.\n\n### Progressive disclosure vs navigation\n\nIt's important to understand the difference between progressive disclosure and navigation patterns. Because the two share common elements, it can be confusing when deciding which type to implement.\n\nPlease refer to these guidelines as they detail in-use solutions, and outline best practices for implementation. If you need more help, refer to the [support](#support) section of this article for how to get in touch.\n\n### Pair icons with text when possible\n\nPair progressive disclosure icons with descriptive text to provide context.\n\n### Implement only as necessary\n\nProgressive disclosure should be used sparingly, when it’s necessary to truncate information for the general layout/design.\n\n## Progressive disclosure UI patterns\n\nThe following table outlines common progressive disclosure solutions in use at GitHub.\n\n| Component                       | Icon                                                                                                              | Usage                                                          | Notes                                                                                                                             |\n| ------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| [Chevron icon](#chevron-icon)   | ![chevron](https://user-images.githubusercontent.com/24916540/52089727-1ae9d480-2564-11e9-8291-1ee9d3225427.png)  | When elements of content are collapsed and can be toggled open | Do not use this icon to trigger dropdown menus or navigation; the caret icon is the more suitable for this.                       |\n| [Fold/Unfold icon](#foldunfold) | ![expand](https://user-images.githubusercontent.com/24916540/52089724-1a513e00-2564-11e9-84f8-eba077f6abfc.png)   | Signify that there is content (typically text) to be revealed  | Should generally stand alone, rather than being paired with text                                                                  |\n| [Ellipsis icon](#ellipsis-icon) | ![ellipsis](https://user-images.githubusercontent.com/24916540/52089725-1ae9d480-2564-11e9-8d29-1dc28740924a.png) | For toggling truncated inline text content                     | Do not use this icon to trigger dropdown menus or navigation; the Kebab icon is the more suitable for this.                       |\n| Text-only toggles               |                                                                                                                   |                                                                | Usage of this solution is discouraged, as generally icons or icon+text pairings provide better accessibility and more information |\n| Kebab                           | ![kebab](https://user-images.githubusercontent.com/24916540/52089726-1ae9d480-2564-11e9-984b-2d304cc0d46e.png)    | N/A                                                            | For toggling inline dropdowns and menus                                                                                           |\n| Caret                           | ![caret](https://user-images.githubusercontent.com/24916540/52089723-1a513e00-2564-11e9-8179-420bba7922e7.png)    | N/A                                                            | Refrain from using this icon as a progressive disclosure solution                                                                 |\n\n### Chevron icon\n\nThe chevron icon is used when elements of content are collapsed and can be toggled open. Typically this icon is positioned vertically, and alternates between the “up” state when expanded and the “down” state when collapsed. This icon is quite flexible, and can stand alone, or be paired with text.\n\n<Box display=\"flex\" alignItems=\"center\" flexDirection=\"column\" my={5}>\n  <Box\n    borderWidth=\"1px\"\n    borderStyle=\"solid\"\n    borderColor=\"border.default\"\n    borderRadius={2}\n    width={9 / 12}\n    mb={2}\n    overflow=\"hidden\"\n  >\n    <img src=\"https://user-images.githubusercontent.com/24916540/52079947-8a9f9580-254b-11e9-9e64-72a2a38f5ebd.png\" />\n  </Box>\n  <p>Chevron icon used to display more branches in mobile view</p>\n</Box>\n\n<DoDontContainer>\n  <Do>\n    <img src=\"https://user-images.githubusercontent.com/24916540/52094309-7b344280-2573-11e9-8f1a-d28cf78a0351.png\" />\n    <Caption>Utilize appropriate text in scenarios to provide clarity</Caption>\n  </Do>\n  <Dont>\n    <img src=\"https://user-images.githubusercontent.com/24916540/52088378-892c9800-2560-11e9-9e36-0e72599da28a.png\" />\n    <Caption>Don't use the chevron to trigger dropdowns</Caption>\n  </Dont>\n</DoDontContainer>\n\n**Caution:**\n\n- The chevron should not be used as a call-to-action for dropdown menus\n- It should not be used for pagination, or indicate directional actions\n\n### Fold/Unfold\n\nThis icon is used to signify that there is content that can be toggled open and closed. It is typically surrounded by text content above and below it. There are currently versions of this icon that expand the context in a singular direction, but are only used in GitHub’s code review editor.\n\n<Box display=\"flex\" alignItems=\"center\" flexDirection=\"column\" my={5}>\n  <Box\n    borderWidth=\"1px\"\n    borderStyle=\"solid\"\n    borderColor=\"border.default\"\n    borderRadius={2}\n    width={9 / 12}\n    mb={2}\n    overflow=\"hidden\"\n  >\n    <img src=\"https://user-images.githubusercontent.com/24916540/52096167-c43bc500-257a-11e9-9e20-a0371eb83720.png\" />\n  </Box>\n  <p>Fold/Unfold Icon used in Profiles context</p>\n</Box>\n\n<DoDontContainer>\n  <Do>\n    <img src=\"https://user-images.githubusercontent.com/24916540/52096601-47114f80-257c-11e9-92fc-d5a12f980372.png\" />\n    <Caption>Use this icon to show content expansion in the code editor</Caption>\n  </Do>\n  <Dont>\n    <img src=\"https://user-images.githubusercontent.com/24916540/52090486-5b4a5200-2566-11e9-8f29-3c26f3787409.png\" />\n    <Caption>Don't pair this icon with lengthy text</Caption>\n  </Dont>\n</DoDontContainer>\n\n**Caution:**\n\n- This icon should generally be used to signify the expansion of text content\n- Generally this icon is not displayed with accompanying text\n\n### Ellipsis icon\n\nThe ellipsis icon is used for toggling truncated inline text content. Its primary purpose is to serve as a method that designers to use to curtail bodies of texts, but sometimes other types of information.\n\n<DoDontContainer>\n  <Do>\n    <img src=\"https://user-images.githubusercontent.com/24916540/52093713-14ae2500-2571-11e9-9893-819b563639b1.png\" />\n    <Caption>Use this icon to give users the option to toggle the amount of text being displayed</Caption>\n  </Do>\n  <Dont>\n    <img src=\"https://user-images.githubusercontent.com/24916540/52093714-1546bb80-2571-11e9-8799-9260792e40f5.png\" />\n    <Caption>Don't substitute a Kebab icon in the place of an ellipsis</Caption>\n  </Dont>\n</DoDontContainer>\n\n**Caution:**\n\n- While visually similar, the ellipsis icon is different from the kebab icon, which is used for dropdown menus or general call-to-actions. Be careful not to confuse them for one another\n- This icon generally stands alone within inline bodies of text\n\n## Support\n\n### Iterate and componentize\n\nIf or when certain progressive disclosure patterns emerge in your design, or you believe a certain solution should be made into a component, reach out to the [#primer](https://github.slack.com/archives/CSGAVNZ19) channel on Slack to discuss how you can submit your code or idea. You may also reach out by opening an issue to the Design Systems team directly on GitHub.\n\n### Requesting feedback\n\nProgressive disclosure can be tricky to implement, and certain designs and scenarios may test the bounds of our design guidelines. If you have further questions or need clarity on implementation, please get in touch via the [#primer](https://github.slack.com/archives/CSGAVNZ19) channel on Slack.\n","parent":{"relativeDirectory":"ui-patterns","name":"progressive-disclosure"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/ui-patterns/saving.mdx","frontmatter":{"title":"Saving"},"rawBody":"---\ntitle: Saving\ndescription: Save patterns help users store and update their content and configuration throughout GitHub. These changes should be represented in the UI accurately, quickly, and obviously. Their behavior should inspire confidence and trust.\n---\n\nimport {Box, Text} from '@primer/react'\n\n## Explicit saving\n\nWhen designing a form, start with an explicit saving pattern. Avoid mixing explicit and automatic save patterns on a single page with multiple forms, and never mix save patterns in a single form. For example: if I upload a profile photo in the \"Public profile\" form, that change should not be saved until I explicitly submit the whole form.\n\nExplicitly saved forms can be saved by clicking a submit button or by pressing Enter while focused on an input.\n\nIf there is an error saving the data, the user's data should be preserved in the form and they should be given [feedback](#feedback) about the failure.\n\n<DoDontContainer>\n  <Do>\n    <img\n      alt=\"A form broken into two sections where one section has a dropdown that automatically saves\"\n      src=\"https://user-images.githubusercontent.com/2313998/159594852-aa1223c7-201e-42ea-9109-649371709d22.png\"\n    />\n    <Caption>Separate auto-saving controls from an explicitly saved form</Caption>\n  </Do>\n  <Dont>\n    <img\n      alt=\"A form with a single section and it contains a dropdown that automatically saves\"\n      src=\"https://user-images.githubusercontent.com/2313998/159594854-8edb9736-bdd1-436c-a327-8525b6ddac0c.png\"\n    />\n    <Caption>Don't mix auto-saving controls and explicitly saved controls in the same form</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Unsaved changes\n\nIf a user tries to navigate away from a page with a form that has unsaved changes, you have the option to warn them that their changes will be lost using the [`beforeunload` event](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event). Modern browsers prevent developers from customizing the `alert` message, so we're limited to a generic message like \"Do you want to leave this site? Changes you made may not be saved.\"\n\n### Declarative controls\n\nTo ensure your forms are accessible, you should use explicit saving (and not automatic saving) in declarative controls. These are:\n\n- Text inputs\n- Checkbox groups\n- Radio button groups\n- Browser-native `<select>` dropdown menus\n- Multi-select dropdown menus\n\n<DoDontContainer>\n  <Do>\n    <img src=\"https://user-images.githubusercontent.com/2313998/158658672-8a503a7c-3857-4929-a77f-c975153e366c.png\" />\n    <Caption>Use save and cancel buttons in dropdowns that allow multiple selections</Caption>\n  </Do>\n  <Dont>\n    <img src=\"https://user-images.githubusercontent.com/2313998/151623713-12028e6d-86ba-4ae6-b46b-d3c88c0fa2c0.png\" />\n    <Caption>Don't automatically save selections once the dropdown is closed</Caption>\n  </Dont>\n</DoDontContainer>\n\nThere are a few issues to bear in mind with autosaving declarative controls.\n\n- Text inputs: Users expect to set a value and then submit. Sensitive information could be unintentionally submitted, such as a change password input.\n- Checkbox groups: It could be unclear whether or not the selection has been saved. Users may accidentally submit a selection clicked by accident.\n- Radio button groups: Screenreader users can't read the options without selecting them, which could accidentally apply a selection the user didn't want.\n- Browser-native `<select>` dropdowns: Similarly to radio button groups, options could be selected when a user focuses the select and uses the arrow keys to read through each option.\n\n### Calls to action\n\nWhen data is not automatically saved after the user makes changes, buttons are used to submit or cancel the changes.\n\n#### Text\n\nAll configuration flows should have calls to action that include an obvious active verb such as \"Create\", \"Save\", \"Delete\", or \"Update\" (for example, \"Create\" a new repository, \"Add\" an SSH key to your profile, \"Save\" security preferences, \"Update\" a repository's description, \"Delete\" an old email address).\n\nWhen defining these calls to actions, make sure to:\n\n1. Keep the text as succinct and clear as possible\n2. Add the item’s name to the button text in cases where it may be unclear to the user what is being changed\n\n<DoDontContainer>\n  <Do>\n    <img src=\"https://user-images.githubusercontent.com/2313998/152432685-08d8a944-c802-44ed-89e0-e9d3aa87771b.png\" />\n    <Caption>Use descriptive text with an active verb</Caption>\n  </Do>\n  <Dont>\n    <img src=\"https://user-images.githubusercontent.com/2313998/152432682-2e102919-114a-43ce-a446-5501d287084a.png\" />\n    <Caption>Don't use vague text</Caption>\n  </Dont>\n</DoDontContainer>\n\n#### Appearance\n\n- If the save button is used to save every input on the page, use the **primary** button appearance.\n- If the save button refers to a segment of controls on the page, use the **secondary** button appearance.\n- If the save button has a corresponding cancel button, use the **primary** button appearance for the save button, and **secondary** for the cancel button.\n\nFor more guidance on button usage, see the [button documentation](/components/button).\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  justifyContent=\"space-between\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box mb={3} display=\"flex\" alignItems=\"center\" flexDirection=\"column\" mx=\"auto\" sx={{gap: 2}}>\n    <img\n      width=\"456\"\n      src=\"https://user-images.githubusercontent.com/2313998/152432687-e119f44c-9325-4ae7-b277-e8559a4eb37b.png\"\n    />\n    <Text as=\"p\" mt=\"0\" align=\"center\" fontSize={1}>\n      Controls all belong to one form\n    </Text>\n    <img\n      width=\"456\"\n      alt=\"A small form in a dialog that has 'Cancel' and 'Save' buttons at the bottom right\"\n      src=\"https://user-images.githubusercontent.com/2313998/151623724-d59d5967-5484-4e81-a4c2-1109409956ee.png\"\n    />\n    <Text as=\"p\" mt=\"0\" align=\"center\" fontSize={1}>\n      A form with a button to save and a button to cancel\n    </Text>\n  </Box>\n  <Box mb={3} display=\"flex\" alignItems=\"center\" flexDirection=\"column\" mx=\"auto\" sx={{gap: 2}}>\n    <img\n      width=\"456\"\n      src=\"https://user-images.githubusercontent.com/2313998/152432688-e74f67b2-a777-4c5f-be45-37a43615e6ab.png\"\n    />\n    <Text as=\"p\" mt=\"0\" align=\"center\" fontSize={1}>\n      Controls divided into multiple sections\n    </Text>\n  </Box>\n</Box>\n\n#### State\n\nDo not disable or hide a form's save button even if the form is invalid or has not been changed. Disabled buttons cannot be focused using the Tab key, and disabled button styles are typically low-contrast and difficult to read.\n\n<DoDontContainer>\n  <Do>\n    <img src=\"https://user-images.githubusercontent.com/2313998/151623709-2a4257d6-e8d0-4156-b928-c7097981791c.png\" />\n    <Caption>Always keep the save button enabled</Caption>\n  </Do>\n  <Dont>\n    <img src=\"https://user-images.githubusercontent.com/2313998/151623715-3b298004-b624-43dc-875c-2590c08070e7.png\" />\n    <Caption>Don't disable the save button if the form is invalid or unchanged</Caption>\n  </Dont>\n</DoDontContainer>\n\n#### Placement\n\nPlace save buttons somewhere intuitive and easily accessible.\n\n- There should only be one save button on a page.\n- Place save buttons somewhere intuitive and easily accessible. If all of the fields save automatically, do not include a save button. This makes it unclear when data is being saved. See the guidelines on [explicit saving](#explicit-saving) and [automatic saving](#automatic-saving) for more information.\n- Allow only one edit mode activated at a time if you're designing a page with content that can be edited separately (such as an issue title). Pages that contain multiple save buttons can cause confusion about which save button saves which group. Multiple save buttons with the same label can cause confusion for people who use assistive technologies like screen readers and voice recognition software.\n\n<DoDontContainer>\n  <Do>\n    <img\n      alt=\"A form with one save button at the bottom\"\n      src=\"https://user-images.githubusercontent.com/2313998/151887934-cfcc5130-53a8-4f40-ba36-97148ead72c0.png\"\n    />\n    <Caption>Have one save button per form</Caption>\n  </Do>\n  <Dont>\n    <img\n      alt=\"A form with two sections. Each section has it's own save button.\"\n      src=\"https://user-images.githubusercontent.com/2313998/151887938-1fa6b5d7-c5c1-4010-ab99-e5c37bff8c0a.png\"\n    />\n    <Caption>Don't have one save button per section of a form</Caption>\n  </Dont>\n</DoDontContainer>\n\n##### Bottom-left (default)\n\nIf there is a button to submit and a button to cancel, the cancel button should go to the **right** of the submit button.\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    width=\"456\"\n    alt=\"A form with the controls and save button left aligned\"\n    src=\"https://user-images.githubusercontent.com/2313998/155623608-440c8f2c-dbb1-4b3c-a76e-7f01af63b3a8.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    Default to placing the submit button at the bottom left of the form. Labels and inputs are left-aligned and run from\n    top-to-bottom, so users would naturally move their eyes down and to the left.\n  </Box>\n</Box>\n\n##### Bottom-right (dialogs and comments)\n\nIf there is a button to submit and a button to cancel, the button to cancel should go to the **left** of the submit button.\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    width=\"456\"\n    alt=\"A small form in a dialog that has 'Cancel' and 'Save' buttons at the bottom right\"\n    src=\"https://user-images.githubusercontent.com/2313998/151623724-d59d5967-5484-4e81-a4c2-1109409956ee.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    If the save button is used in a dialog, place the button at the bottom right of the dialog. Right-aligned dialog\n    buttons feel familiar because it's a common pattern across various platforms such as Windows, macOS, and Android.\n  </Box>\n</Box>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <img\n    width=\"456\"\n    alt=\"A multi-line text input with 'Close with Comment' and 'Comment' buttons right-aligned below the input\"\n    src=\"https://user-images.githubusercontent.com/2313998/158623777-a4bb25ec-e1a0-4feb-bd56-e46a69c7f768.png\"\n  />\n  <Box as=\"p\" mt=\"0\">\n    If the button is used to send a message such as a comment on an issue, right-align the button below the text area.\n    This is where GitHub has traditionally placed the <strong>Submit</strong> button for issues and pull requests, and\n    it's common practice in other apps to place a <strong>Send</strong> button to the right.\n  </Box>\n</Box>\n\n<!--\nTODO:\nConsider how we might define more patterns to keep the \"Save\" button easily accessible on long forms:\n- add save and cancel buttons on top AND bottom?\n- use a sticky header with save and cancel buttons?\n-->\n\n##### Adjacent to inline editing input\n\nTo simplify the interface, some content may be edited inline without taking the user to a separate flow.\n\nAn input used for inline editing should have a save button placed very close to visually connect the input with the button.\n\n<img\n  width=\"960\"\n  alt=\"Two images of a pull request header. The first image shows the title as read-only text. The second image shows a text input to edit the pull request title with 'Cancel' and 'Save' buttons below the input.\"\n  src=\"https://user-images.githubusercontent.com/2313998/158624334-fcd4e268-d144-4420-98ed-819c51631e7e.png\"\n/>\n\n##### Other\n\nIf you believe your submit button will not be intuitive or easily accessible using any of the placement options listed here, you may consider alternatives and optionally propose a new Primer pattern.\n\n## Automatic saving\n\nAutomatic saving applies changes as they are made. Automatic saving should be used when the user expects instant feedback from the change they made.\n\n<Box mb={3} display=\"flex\" alignItems=\"center\" flexDirection=\"column\" mt={6} mx=\"auto\" sx={{gap: 2, maxWidth: '450px'}}>\n  <Box\n    display=\"inline-block\"\n    overflow=\"hidden\"\n    borderWidth=\"1px\"\n    borderColor=\"border.default\"\n    borderStyle=\"solid\"\n    borderRadius=\"12px\"\n  >\n    <img\n      width=\"456\"\n      src=\"https://user-images.githubusercontent.com/2313998/152013139-02eb5213-bb19-4c8d-8b19-01f1d73602d1.gif\"\n      alt=\"Opening the 'Watch' dropdown menu and changing. It saves automatically.\"\n    />\n  </Box>\n  <Text as=\"p\" mt=\"0\" align=\"center\" fontSize={1}>\n    If a form field is saved automatically, it should be obvious whether or not it saved without using text or visual\n    indicators. A visual indicator for whether or not a form field has been saved successfully could be mistaken as a\n    validation status.\n  </Text>\n</Box>\n\n### Imperative controls\n\nTo reduce UI and give instant feedback, you should use automatic saving (and not explicit saving) for imperative controls. These are:\n\n- [Toggle switches](/components/toggle-switch). The toggle switch behaves like a light switch: the light just switches on and off without you having to confirm each time you flip the switch.\n- [Segmented controls](/components/segmented-control). The segmented control behaves like tabs: the tab changes as soon as you select it, and you can only select one at a time.\n- Single-select dropdowns that are not native `<select>` dropdowns or part of an explicitly saved form. Single-select dropdowns behave like a radio dial: the station starts playing as soon as you select it.\n\n### Dropdown menu accessibility\n\nSemantic menus should only have a list of options to select from and should not have a save button in their dropdown. As soon as additional features (search inputs, filters, tabs, etc) are added, the component should be treated like a dialog with a button to submit and a button to cancel.\n\n## Feedback\n\nIf the change is not obvious within the user's viewport, provide feedback to let the user know that the change occurred successfully.\n\n- If the change occurred without a redirect or page refresh, you can use the [toast component](/ui-patterns/messaging#toasts).\n- If the change occurred and the page refreshes or redirects, you can use a [flash banner component](/ui-patterns/messaging#flash-alerts).\n\n<Note variant=\"warning\">\n  If your design is being implemented in github.com, avoid using a toast for now. The toast components used on\n  github.com have accessibility issues that need to be fixed.\n</Note>\n\n## Error forgiveness\n\nBefore submitting a form with potentially destructive consequences (for example, delete a repository), ask the user to confirm they want to submit the form.\n\nFor risky changes, provide a way to undo those changes after saving.\n\n<Box display=\"flex\" alignItems=\"center\" flexDirection=\"column\" mx=\"auto\" sx={{gap: 1}}>\n  <Box\n    display=\"inline-block\"\n    overflow=\"hidden\"\n    borderWidth=\"1px\"\n    borderColor=\"border.default\"\n    borderStyle=\"solid\"\n    borderRadius=\"12px\"\n  >\n    <img\n      width=\"960\"\n      src=\"https://user-images.githubusercontent.com/2313998/152434199-a067b037-baf8-4093-8796-b0bb58344223.png\"\n    />\n  </Box>\n  <Text as=\"p\" mt=\"0\" align=\"center\" fontSize={1}>\n    After merging a pull request, a button appears to revert the changes\n  </Text>\n</Box>\n\n## Redirecting\n\nWhen creating new content like issues, discussions, or even larger entities such as repositories or organizations, you may redirect the user to the entity they just created at the end of the flow.\n\nIn some cases, such as forking or using a template, you may need to hold the user at a waiting page while the entity is generated. In these cases, make the user feel confident that something is happening and that their configuration details will not be lost.\n\n<Box overflow=\"hidden\" borderWidth=\"1px\" borderColor=\"border.default\" borderStyle=\"solid\" borderRadius=\"12px\">\n  <img\n    src=\"https://user-images.githubusercontent.com/2313998/151446009-58bfb92f-00e1-4a15-a2a3-f1afb6fb4031.gif\"\n    alt=\"Screen recording of a user forking a repository\"\n  />\n</Box>\n","parent":{"relativeDirectory":"ui-patterns","name":"saving"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/component-documentation-guidelines/component-MVP-documentation-guidelines.md","frontmatter":{"title":""},"rawBody":"# Component documentation MVP guides\n\n## Description\n\nOne of the strategies to help Primer documentation become self-serve is to accurately represent the breadth of patterns and components we have available through our documentation.\n\nTo do this, we are increasing our coverage to include 100% of available-for-use components temporarily in the primer/design repository. Executing on this plan requires us to be practical and concise in terms of the depth of the documentation. In order to ensure we can reach 100% coverage, we're using an MVP approach.\n\n## Principles for this approach\n\n- Accurate\n- Informative but concise\n- Visible\n\n## MVP documentation approach\n\nAside from components we deem to be high touch and therefore requiring more in-depth documentation, the majority of components that are missing usage guidelines will be documented with the following minimum requirements:\n\nDescription\n\n- brief text describing what the component is\n- link to available implementations\n- image, if applicable\n\nUsage\n\n- proper usage guides\n- visual examples, such as an image or gif demonstrating what the component is\n\n## Add more documentation if it's readily available\n\nIf more information (than required above) is easily accessible and doesn't require a huge time investment to include, it should be added to to MVP documentation. Some examples of this include listing out related components, cross-linking to Accessibility guidelines, and more.\n\nTake a look at the [Component documentation guides](../component-documentation-guides.md) for an full overview of content recommendations and how to write them.\n\n---\n\n### Tips and tricks\n\n- A great starting off point is to consolidate existing documentation for the component that's already available. Places to look:\n  - Figma ([Primer Web file](https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=179%3A3870))\n  - [CSS documentation](https://primer.style/css/)\n  - [React documentation](https://primer.style/react/)\n  - [Rails documentation](https://primer.style/view-components/)\n  - [Interface guidelines component documentation](/components)\n  - [Interface guidelines UI pattern documentation](/ui-patterns)\n  - [Interface guidelines Accessibility documentation](/guides/accessibility)\n  - Related components that may have guidelines applicable to your component\n  - Take a look at an existing component that was documented using this approach, such as [Action menu](/components/action-menu)\n\n#### Recommendations for tackling this work quickly and efficiently\n\n- Work in pairs or with a small group. Dedicate 1-2 components per person, with each person in the group is responsible for reviewing the others' PRs.\n- Timebox each component to x hour(s) for writing, x hour(s) for reviewing, and x hour(s) for writing revisions.\n- If you get stuck or a component clearly needs more thorough documentation in order to be accurate, swap it out for another component and add it to the backlog of components that need more thorough documentation.\n","parent":{"relativeDirectory":"components/component-documentation-guidelines","name":"component-MVP-documentation-guidelines"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/component-documentation-guidelines/component-documentation-guidelines.md","frontmatter":{"title":""},"rawBody":"# Component documentation guidelines\n\n## Principles\n\nPrimer documentation should express the voices and contributions of different people, but for it to be useful it’s important to be consistent in tone and structure.\n\n### Concise but friendly\n\nA large proportion of readers want to find an answer that helps them complete a task, so don't waste their time\n\n### Universally understood\n\nAvoid using phrases or referencing examples that are only familiar internally at GitHub. Assume readers are either members of the public or new to GitHub.\n\n### Production quality\n\nCode examples should promote what we'd like to see used in production. While examples might be simpler than what we'd use in production, the code should promote best practices and follow our principles and accessibility standards.\n\nConsider the core elements needed to properly document a component and its usage within Primer UI.\n\n## Documenting components\n\nWhen documenting components, consider the core elements needed to convey its main purpose and proper usage within the UI.\n\nSee our full [documentation guidelines here](https://primer.style/contribute/documentation/).\n\n### Types of components\n\n- **Regular**: Standard components used to build Primer UI. See [ActionList](/components/action-list).\n- **Internal**: Components used by other components that do not exist on their own. See [Overlay](https://primer.style/react/Overlay).\n- **Behavioral**: Components with no real anatomy or structure, rather behaviors. See [Truncate](https://primer.style/react/Truncate).\n\n### Component documentation structure\n\n#### Description\n\nThe description appears directly under the title of the component. It may be automatically pulled from component-metadata, and can be edited as needed.\n\n- What is this component, and how would you describe it to someone who has never used it before? This description should be as concise and shouldn't include usage information, which is covered below this section.\n- Release status\n- Accessibility status\n\n#### Usage\n\n- When to use\n- Best practices\n- Do/Don't examples\n\n#### Options\n\n- Different sizes, typography options, layout variations, spac\n  ing, etc\n- Different applications of the component in context\n\n#### Anatomy\n\n- Describe the elements that make up the component, including typography, spacing, and styles. This can also include sub components, if there are any. See [Action list](/components/action-list#anatomy).\n\n#### Interactions\n\n- If there are specific behaviors or interactions that the consumer of this documentation should be aware of, it's important to document that. Is it clickable or static, does it have any specific interactions based on state? Are there multiple types of behavior, and when does each get applied? See [Autocomplete](/components/autocomplete#sort-and-filter-behavior).\n\n#### Accessibility\n\n- Any component-specific accessibility considerations should be documented. This could include keyboard navigation, touch targets, and any specific usage guidelines with regards to assistive technology. See [Segmented control](/components/segmented-control#accessibility).\n\n#### Related components and patterns\n","parent":{"relativeDirectory":"components/component-documentation-guidelines","name":"component-documentation-guidelines"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/animations.mdx","frontmatter":{"title":"Animations"},"rawBody":"---\ntitle: Animations\ndescription: Animations are reusable animation classes that you can use to emphasize an element. All of these animations will animate if you toggle their visibility using the \"Toggle\" button.\n---\n\n<StorybookEmbed\n  framework=\"css\"\n  stories={[\n    {id: 'utilities-animation--fade-in'},\n    {id: 'utilities-animation--fade-out'},\n    {id: 'utilities-animation--fade-up'},\n    {id: 'utilities-animation--fade-down'},\n    {id: 'utilities-animation--scale-in'},\n    {id: 'utilities-animation--grow-x'},\n    {id: 'utilities-animation--pulse'},\n    {id: 'utilities-animation--hover'},\n    {id: 'utilities-animation--rotate'}\n  ]}\n/>\n\n| Animation | Description                                                                                                                                                                                                         |\n| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Fade in   | The `.anim-fade-in` class is used to fade in an element on the page. This will run once when the element is revealed.                                                                                               |\n| Fade out  | The `.anim-fade-out` class is used to fade out an element on the page. This will run once when the element is revealed.                                                                                             |\n| Fade up   | The `.anim-fade-up` class is used to reveal an element on the page by sliding it up from below the fold. You should use this in a container with `overflow: hidden;` or on the bottom of the page.                  |\n| Fade down | The `.anim-fade-down` class is used to slide an element down hiding it. You should use this in a container with `overflow: hidden;` or on the bottom of the page.                                                   |\n| Scale in  | The `.anim-scale-in` class will scale the element in. This is useful on menus when you want them to appear more friendly.                                                                                           |\n| Grow x    | The `.anim-grow-x` class will grow an element width from 0-:100: real quick.                                                                                                                                        |\n| Pulse     | The `.anim-pulse` class will pulse an element infinitely.                                                                                                                                                           |\n| Hover     | The `.anim-hover-grow` class will increase the scale of the element upon hover.                                                                                                                                     |\n| Rotate    | The `.anim-rotate` class will rotate the element indefinitely around the coordinate specified by `transform-origin`. Most elements have a default of `transform-origin: 50% 50%` and will rotate around the center. |\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"animations"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/borders.mdx","frontmatter":{"title":"Borders"},"rawBody":"---\ntitle: Borders\ndescription: Utilities for borders, and border radius.\n---\n\n## Default border\n\nThe default border utility applies a solid, 1px border, with a default gray color.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-border--default'}]} height=\"80\" />\n\nBorders can be applied to a specific edge or to the X and Y axes individually:\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-border--direction'}]} height=\"340\" />\n\nRemove borders from all sides or a single side with `.border-0`, `.border-top-0`, `.border-right-0`, `.border-bottom-0`, `.border-left-0`.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-border--hide'}]} height=\"80\" />\n\n## Border style\n\nUse `border-dashed` to give an element a dashed border.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-border--style'}]} height=\"80\" />\n\n## Responsive borders\n\nYou can adjust border widths on all sides or each side individually with responsive border utilities:\n\n- `border-(sm|md|lg|xl)` adds borders on all sides at and above the breakpoint. The `border-(sm|md|lg|xl)` shorthand is also supported.\n- `border-(sm|md|lg|xl)-0` removes borders from all sides at and above the breakpoint.\n- `border-(sm|md|lg|xl)-(top|right|bottom|left)` adds a border on the given side at and above the breakpoint.\n- `border-(sm|md|lg|xl)-(top|right|bottom|left)-0` the border from the given side at and above the breakpoint.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-border--responsive'}]} height=\"150\" />\n\n## Border colors\n\nBorder colors are documented on the [colors utilities page](/foundations/css-utilities/colors#border).\n\n## Rounded corners\n\nUse the following utilities to add or remove rounded corners: `rounded-0` removes rounded corners, `rounded-1` applies a border radius of 4px, `rounded-2` applies a border radius of 6px, and `rounded-3` applies a border radius of 8px. `.circle` applies a border radius of 50%, which turns square elements into perfect circles.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-border--rounded'}]} height=\"360\" />\n\nYou can also add rounded corners to each edge (top, right, bottom, left) with the following utilities:\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-border--rounded-direction'}]} height=\"240\" />\n\n## Responsive rounded corners\n\nYou can adjust border radius on all sides or each side individually with responsive border radius utilities:\n\n- `rounded-(sm|md|lg|xl)` adds a 6px rounded corner on all sides at and above the breakpoint.\n- `rounded-(sm|md|lg|xl)-(0|1|2|3|4)` adds a rounded corner on all sides at and above the breakpoint.\n- `rounded-(sm|md|lg|xl)-(top|right|bottom|left)-(0|1|2|3|4)` adds a rounded corner on the given side at and above the breakpoint.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-border--rounded-responsive'}]} height=\"200\" />\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"borders"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/box-shadow.mdx","frontmatter":{"title":"Box shadow"},"rawBody":"---\ntitle: Box shadow\ndescription: Box shadows are used to make content appear elevated. They are typically applied to containers of content that users need to pay attention to or content that appears on top of (overlapping) other elements on the page (like a pop-over or modal).\n---\n\n## Small\n\nSmall shadows are mainly used on things that need to appear slightly elevated, like pricing cards or UI elements containing important information.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-shadow--small'}]} height=\"75\" />\n\nThese types of shadows are typically applied to elements with borders, such as the [Box component](/components/box).\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-shadow--small-example'}]} height=\"300\" />\n\n## Medium\n\nMedium box shadows are more diffused and slightly larger than small box shadows.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-shadow--medium'}]} height=\"75\" />\n\nMedium box shadows are typically used on editorialized content that needs to appear elevated. Most of the time, the elements using this level of shadow will be clickable.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-shadow--medium-example'}]} height=\"220\" />\n\n## Large\n\nLarge box shadows are very diffused and used sparingly in the product UI.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-shadow--large'}]} height=\"75\" />\n\nThese shadows are used for marketing content, UI screenshots, and content that appears on top of other page elements.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-shadow--large-example'}]} height=\"375\" />\n\n## Extra large\n\nExtra large box shadows are even more diffused.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-shadow--extra-large'}]} height=\"75\" />\n\nThese shadows are used for marketing content and content that appears on top of other page elements.\n\n## Remove a box shadow\n\nAdditionally there is a `box-shadow-none` class that removes `box-shadow`:\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-shadow--none'}]} height=\"75\" />\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"box-shadow"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/colors.mdx","frontmatter":{"title":"Colors"},"rawBody":"---\ntitle: Colors\ndescription: Use color utilities to apply color to the background of elements, text, and borders.\n---\n\n<Note>\n  Please note Primer CSS v18 has changed the naming of these color classes. Check the{' '}\n  <a href=\"/css/support/v18-migration\">migration guide</a> to make sure your app is up to date.\n</Note>\n\nThese utilities should only be used where color is not provided by a component. To learn more about how to apply color, read the [color documentation](/foundations/color).\n\n## Text\n\nUse text color utilities to set text to a specific color. Color contrast must pass a minimum WCAG accessibility rating of [level AA](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html). This ensures that viewers who cannot see the full color spectrum are able to read the text. To customize outside of the suggested combinations below, we recommend using this [color contrast testing tool](https://colorable.jxnblk.com/). For more information, read our [accessibility standards](/guides/accessibility).\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-color--text'}]} height=\"410\" />\n\nYou can set the color inheritance on an element by using the `color-fg-inherit` class.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-color--text-inherit'}]} height=\"60\" />\n\n## Background\n\nBackground colors are most commonly used for filling large blocks of content or areas with a color. When selecting a background color, make sure the foreground color contrast passes a minimum WCAG accessibility rating of [level AA](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html). Meeting these standards ensures that content is accessible by everyone, regardless of disability or user device. You can [check your color combination with this demo site](https://colorable.jxnblk.com/). For more information, read our [accessibility standards](/guides/accessibility).\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-color--background'}]} height=\"1250\" />\n\n## Border\n\nOverride default border colors with the following utilities.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-color--border'}]} height=\"1170\" />\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"colors"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/details.mdx","frontmatter":{"title":"Details"},"rawBody":"---\ntitle: Details\ndescription: Details classes are created to enhance the native behaviors of details elements.\n---\n\n## Fullscreen click area\n\nUse `.details-overlay` to expand the click area of `<summary>` to cover the full screen, so user can click anywhere on a page to close `<details>`.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-details--overlay'}]} height=\"130\" />\n\n## Darkened fullscreen click area\n\nUse `.details-overlay-dark` darken the click area overlay. Useful for modals.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-details--overlay-dark'}]} height=\"130\" />\n\n## Custom caret\n\nUse `.details-reset` to remove the default caret (that little triangle on the left). You then can add the `.dropdown-caret` on the right of the text.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-details--caret'}]} height=\"130\" />\n\n## Using button styles with the details summary element\n\nYou can add `.btn` and `.btn-*` classes to any\n[`<summary>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary)\nelement so that it gains the appearance of a button, and\nselected/active styles when the parent\n[`<details>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details)\nelement is open.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-details--summary'}]} height=\"170\" />\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"details"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/flexbox.mdx","frontmatter":{"title":"Flexbox"},"rawBody":"---\ntitle: Flexbox\ndescription: Flex utilities can be used to apply flexbox behaviors to elements by using utility classes.\n---\n\n## Required reading\n\nBefore using these utilities, **you should be familiar with CSS3 Flexible Box spec**. If you are not, check out MDN's guide:\n\n📖 **[Using CSS Flexible Boxes](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes)**\n\n## Flex container\n\nUse these classes to make an element lay out its content using the flexbox model. Each **direct** child of the flex container will become a flex item.\n\n```css\n.d-flex {\n  display: flex;\n}\n.d-inline-flex {\n  display: inline-flex;\n}\n```\n\n| Class            | Description                                                                                  |\n| ---------------- | -------------------------------------------------------------------------------------------- |\n| `.d-flex`        | The element behaves like a block and lays out its content using the flexbox model.           |\n| `.d-inline-flex` | The element behaves like an inline element and lays out its content using the flexbox model. |\n\n### Example using `.d-flex`\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--flex'}]} height=\"125\" />\n\n### Example using `.d-inline-flex`\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--inline-flex'}]} height=\"125\" />\n\n## Flex direction\n\nUse these classes to define the orientation of the main axis (`row` or `column`). By default, flex items will display in a row. Use `.flex-column` to change the direction of the main axis to vertical.\n\n```css\n.flex-row {\n  flex-direction: row;\n}\n.flex-row-reverse {\n  flex-direction: row-reverse;\n}\n.flex-column {\n  flex-direction: column;\n}\n.flex-column-reverse {\n  flex-direction: column-reverse;\n}\n```\n\n| Class                  | Description                                 |\n| ---------------------- | ------------------------------------------- |\n| `.flex-row`            | The main axis runs left to right (default). |\n| `.flex-row-reverse`    | The main axis runs right to left.           |\n| `.flex-column`         | The main axis runs top to bottom.           |\n| `.flex-column-reverse` | The main axis runs bottom to top.           |\n\n### Example using `.flex-column`\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--column'}]} height=\"300\" />\n\n### Example using `.flex-column-reverse`\n\nThis example uses the responsive variant `.flex-sm-column-reverse` to override `.flex-column` Learn more about **[responsive flexbox utilities](#responsive-flex-utilities)**. Keep in mind that it won't affect screen readers or navigating with the keyboard and it's advised to keep the markup in a logical source order.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--column-reverse'}]} height=\"300\" />\n\n### Example using `.flex-row`\n\nThis example uses the responsive variant `.flex-sm-row` to override `.flex-column` Learn more about **[responsive flexbox utilities](#responsive-flex-utilities)**.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--row'}]} height=\"125\" />\n\n### Example using `.flex-row-reverse`\n\nThis example uses the responsive variant `.flex-sm-row-reverse` to override `.flex-column` Learn more about **[responsive flexbox utilities](#responsive-flex-utilities)**. Keep in mind that it won't affect screen readers or navigating with the keyboard and it's advised to keep the markup in a logical source order.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--row-reverse'}]} height=\"125\" />\n\n## Flex wrap\n\nYou can choose whether flex items are forced into a single line or wrapped onto multiple lines.\n\n```css\n.flex-nowrap         { flex-wrap: nowrap; }\n.flex-wrap           { flex-wrap: wrap; }\n.flex-wrap-reverse   { flex-wrap: wrap-reverse; }\n```\n\n\n| Class                | Description                                                          |\n| -------------------- | -------------------------------------------------------------------- |\n| `.flex-nowrap`       | Flex items are laid out in a single line, even if they overflow      |\n| `.flex-wrap`         | Flex items will break onto multiple lines (default)                  |\n| `.flex-wrap-reverse` | Behaves the same as wrap but cross-start and cross-end are permuted. |\n\n### `flex-nowrap` example\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--nowrap'}]} height=\"220\" />\n\n\n### `flex-wrap` example\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--wrap'}]} height=\"125\" />\n\n### `flex-wrap-reverse` example\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--wrap-reverse'}]} height=\"220\" />\n\n## Justify content\n\nUse these classes to distribute space between and around flex items along the **main axis** of the container.\n\n```css\n.flex-justify-start {\n  justify-content: flex-start;\n}\n.flex-justify-end {\n  justify-content: flex-end;\n}\n.flex-justify-center {\n  justify-content: center;\n}\n.flex-justify-between {\n  justify-content: space-between;\n}\n.flex-justify-around {\n  justify-content: space-around;\n}\n```\n\n| Class                   | Default behavior                                                                        |\n| ----------------------- | --------------------------------------------------------------------------------------- |\n| `.flex-justify-start`   | Justify all items to the left                                                           |\n| `.flex-justify-end`     | Justify all items to the right                                                          |\n| `.flex-justify-center`  | Justify items to the center of the container                                            |\n| `.flex-justify-between` | Distribute items evenly. First item is on the start line, last item is on the end line. |\n| `.flex-justify-around`  | Distribute items evenly with equal space around them                                    |\n\n### flex-justify-start\n\nUse `.flex-justify-start` to align items to the start line. By default this will be on the left side of the container. If you are using `.flex-column`, the start line will be at the top of the container.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--justify-start'}]} height=\"125\" />\n\n### flex-justify-end\n\nUse `.flex-justify-end` to align items to the end line. By default this will be on the right side of the container. If you are using `.flex-column`, the end line will be at the bottom of the container.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--justify-end'}]} height=\"125\" />\n\n### flex-justify-center\n\nUse `.flex-justify-center` to align items in the middle of the container.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--justify-center'}]} height=\"125\" />\n\n### flex-justify-between\n\nUse `.flex-justify-between` to distribute items evenly in the container. The first items will be on the start line and the last item will be on the end line.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--justify-between'}]} height=\"125\" />\n\n### flex-justify-around\n\nUse `.flex-justify-around` to distribute items evenly, with an equal amount of space around them. Visually the spaces won't look equal, since each item has the same unit of space around it. For example, the first item only has one unit of space between it and the start line, but it has two units of space between it and the next item.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--justify-around'}]} height=\"125\" />\n\n## Align items\n\nUse these classes to align items on the **cross axis**.\n\nThe cross axis runs perpendicular to the main axis. By default the main axis runs horizontally, so your items will align vertically on the cross axis. If you use [flex-column](#flex-direction) to make the main axis run vertically, your items will be aligned horizontally.\n\n```css\n.flex-items-start {\n  align-items: flex-start;\n}\n.flex-items-end {\n  align-items: flex-end;\n}\n.flex-items-center {\n  align-items: center;\n}\n.flex-items-baseline {\n  align-items: baseline;\n}\n.flex-items-stretch {\n  align-items: stretch;\n}\n```\n\n| Class                  | Behavior                                                    |\n| ---------------------- | ----------------------------------------------------------- |\n| `.flex-items-start`    | Align items to the start of the cross axis                  |\n| `.flex-items-end`      | Align items to the end of the cross axis                    |\n| `.flex-items-center`   | Align items to the center of the cross axis                 |\n| `.flex-items-baseline` | Align items along their baselines                           |\n| `.flex-items-stretch`  | Stretch items from start of cross axis to end of cross axis |\n\n### flex-items-start\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-items-start'}]} height=\"190\" />\n\n### flex-items-end\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-items-end'}]} height=\"190\" />\n\n### flex-items-center\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-items-center'}]} height=\"190\" />\n\n### flex-items-baseline\n\nWith `.flex-items-baseline`, items will be aligned along their baselines even if they have different font sizes.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-items-baseline'}]} height=\"190\" />\n\n### flex-items-stretch\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-items-stretch'}]} height=\"190\" />\n\n## Align content\n\nWhen the main axis wraps, this creates multiple main axis lines and adds extra space in the cross axis. Use these classes to align the lines of the main axis on the cross axis.\n\n```css\n.flex-content-start {\n  align-content: flex-start;\n}\n.flex-content-end {\n  align-content: flex-end;\n}\n.flex-content-center {\n  align-content: center;\n}\n.flex-content-between {\n  align-content: space-between;\n}\n.flex-content-around {\n  align-content: space-around;\n}\n.flex-content-stretch {\n  align-content: stretch;\n}\n```\n\n| Class                   | Description                                                                                                         |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------- |\n| `.flex-content-start`   | Align content to the start of the cross axis                                                                        |\n| `.flex-content-end`     | Align content to the end of the cross axis                                                                          |\n| `.flex-content-center`  | Align content to the center of the cross axis                                                                       |\n| `.flex-content-between` | Distribute content evenly. First line is on the start of the cross axis, last line is on the end of the cross axis. |\n| `.flex-content-around`  | Stretch items from the start of the cross axis to the end of the cross axis.                                        |\n| `.flex-content-stretch` | Lines stretch to occupy available space.                                                                            |\n\n### flex-content-start\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-content-start'}]} height=\"340\" />\n\n### flex-content-end\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-content-end'}]} height=\"340\" />\n\n### flex-content-center\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-content-center'}]} height=\"340\" />\n\n### flex-content-between\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-content-between'}]} height=\"340\" />\n\n### flex-content-around\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-content-around'}]} height=\"340\" />\n\n### flex-content-stretch\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-content-stretch'}]} height=\"340\" />\n\n## Flex\n\nUse this class to specify the ability of a flex item to alter its dimensions to fill available space.\n\n```css\n.flex-1 {\n  flex: 1;\n}\n.flex-auto {\n  flex: auto;\n}\n.flex-grow-0 {\n  flex-grow: 0;\n}\n.flex-shrink-0 {\n  flex-shrink: 0;\n}\n```\n\n| Class            | Description                                               |\n| ---------------- | --------------------------------------------------------- |\n| `.flex-1`        | Fills available space                                     |\n| `.flex-auto`     | Fills available space and auto-sizes based on the content |\n| `.flex-grow-0`   | Prevents growing of a flex item                           |\n| `.flex-shrink-0` | Prevents shrinking of a flex item                         |\n\n### flex-1\n\nAdding `.flex-1` makes the item grow in size to take up all the space that is available.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--flex-1'}]} height=\"125\" />\n\nAdding `.flex-1` to all flex items results in each item having the same size.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--flex-1-all'}]} height=\"125\" />\n\n### flex-auto\n\nUsing `.flex-auto` fills the available space but also takes the size of the content into account. Type in the editor below to see the effect.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--flex-auto'}]} height=\"125\" />\n\n### flex-grow-0\n\nAdd `.flex-grow-0` to prevent an item from growing. This can be useful when used as a responsive variant. For example to stop growing when the viewport gets wider.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--flex-grow-0'}]} height=\"125\" />\n\n### flex-shrink-0\n\nAdd `.flex-shrink-0` to prevent an item from shrinking. Note that for example text will not wrap and the flex items start to overflow if there is not enough space.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--flex-shrink-0'}]} height=\"160\" />\n\n## Align self\n\nUse these classes to adjust the alignment of an individual flex item on the cross axis. This overrides any `align-items` property applied to the flex container.\n\n```css\n.flex-self-auto {\n  align-self: auto;\n}\n.flex-self-start {\n  align-self: flex-start;\n}\n.flex-self-end {\n  align-self: flex-end;\n}\n.flex-self-center {\n  align-self: center;\n}\n.flex-self-baseline {\n  align-self: baseline;\n}\n.flex-self-stretch {\n  align-self: stretch;\n}\n```\n\n| Class                 | Description                                                 |\n| --------------------- | ----------------------------------------------------------- |\n| `.flex-self-auto`     | Inherit alignment from parent                               |\n| `.flex-self-start`    | Align to the start of the cross axis                        |\n| `.flex-self-end`      | Align to the end of the cross axis                          |\n| `.flex-self-center`   | Align to center of cross axis                               |\n| `.flex-self-baseline` | Align baseline to the start of the cross axis               |\n| `.flex-self-stretch`  | Stretch item from start of cross axis to end of cross axis. |\n\n### flex-self-auto\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-self-auto'}]} height=\"190\" />\n\n### flex-self-start\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-self-start'}]} height=\"190\" />\n\n### flex-self-end\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-self-end'}]} height=\"190\" />\n\n### flex-self-center\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-self-center'}]} height=\"190\" />\n\n### flex-self-baseline\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-self-baseline'}]} height=\"190\" />\n\n### flex-self-stretch\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--align-self-stretch'}]} height=\"190\" />\n\n## Order\n\nUse these classes to change the order of flex items. Keep in mind that it won't affect screen readers or navigating with the keyboard and it's advised to keep the markup in a logical source order.\n\n```css\n.flex-order-1 {\n  order: 1;\n}\n.flex-order-2 {\n  order: 2;\n}\n.flex-order-none {\n  order: inherit;\n}\n```\n\n| Class              | Description                                            |\n| ------------------ | ------------------------------------------------------ |\n| `.flex-order-1`    | Set order to be 1                                      |\n| `.flex-order-2`    | Set order to be 2                                      |\n| `.flex-order-none` | Remove order (typically used with responsive variants) |\n\n### flex-order (1+2)\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--order'}]} height=\"125\" />\n\n### flex-order-none\n\nResize window to see the effect.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--order-none'}]} height=\"125\" />\n\n## Responsive flex utilities\n\nAll flexbox utilities can be adjusted per [breakpoint](/foundations/css-utilities/grid#breakpoints) using the following formulas:\n\n- `d-[breakpoint]-[property]` for `display`\n- `flex-[breakpoint]-[property]-[behavior]` for various flex properties\n\nEach responsive style is applied to the specified breakpoint and up.\n\n### Example classes\n\n```css\n/* Example classes */\n\n.d-sm-flex {\n}\n.d-md-inline-flex {\n}\n\n.flex-lg-row {\n}\n.flex-xl-column {\n}\n\n.flex-sm-wrap {\n}\n.flex-lg-nowrap {\n}\n\n.flex-lg-self-start {\n}\n```\n\n### Example usage\n\nMixing flex properties:\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--responsive'}]} height=\"190\" />\n\n## Example components\n\nThe flex utilities can be used to create a number of components. Here are some examples.\n\n### Media object\n\nYou can use flex utilities to make a simple media object, like this:\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--media-object'}]} height=\"180\" />\n\n### Responsive media object\n\nHere is an example of a media object that is **vertically centered on large screens**, but converts to a stacked column layout on small screens.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-flexbox--media-object-responsive'}]} height=\"170\" />\n\n## Flexbox bugs\n\nThis section lists flexbox bugs that affect [browsers we currently support](https://github.com/primer/css/blob/main/.browserslistrc).\n\n1. **Minimum content sizing of flex items not honored.** Some browsers don't respect flex item size. Instead of respecting the minimum content size, items shrink below their minimum size which can create some undesirable results, such as overflowing text. The workaround is to apply `flex-shrink: 0;` to the items using `d-flex`. This can be applied with the `flex-shrink-0` utility. For more information read [philipwalton/flexbugs](https://github.com/philipwalton/flexbugs#1-minimum-content-sizing-of-flex-items-not-honored).\n2. **Some elements can't be flex containers.** Specifically, `<button>`, `<fieldset>`, and `<summary>` elements cannot be styled with `display: flex` in Safari. Instead of using `class=\"d-flex\"` on these elements, you should nest an element within them, e.g. `<summary><div class=\"d-flex\">...</div></summary>`.\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"flexbox"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/getting-started.mdx","frontmatter":{"title":"CSS Utilities"},"rawBody":"---\ntitle: CSS Utilities\ndescription: Utilities provide the building blocks for layout and handle a range common use cases that help us avoid writing custom styles.\n---\n\n When we need to add some margin or padding, rather than adding a new selector specific to that use case, we can use utilities. This helps us reduce the number of unique property-value pairs, and helps us keep more consistent styles across the site.\n\n* Utilities should do one job well and one job only, are immutable, and on occasion are an acceptable approach to overriding component styles.\n* Utility class-names should be transparent and clearly describe the job they do.\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"getting-started"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/grid.mdx","frontmatter":{"title":"Grid"},"rawBody":"---\ntitle: Grid\ndescription: The grid is 12 columns and percentage-based. The number of columns a container spans can be adjusted across breakpoints for responsive layouts. The grid system works with a variety of layout utilities to achieve different results.\n---\n\n## Flexbox grids\n\nYou can use [flex utilities](/utilities/flexbox) on the container and columns to create a flexbox grid.\n\nThis can be useful for keeping columns the same height, justifying content and vertically aligning items. The flexbox grid is also great for working with responsive layouts.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--flexbox'}]} height=\"240\" />\n\n## Float based grid\n\nUse `.clearfix` on the container and float utilities with columns for a floated grid layout.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--float'}]} height=\"110\" />\n\n### Reversed float grid\n\nTo reverse the order of columns, use `float-right` to float columns to the right.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--float-reversed'}]} height=\"110\" />\n\n## Nesting\n\nYou can infinitely nest grid layouts within other columns since the column widths are percentage based. With great flexibility comes great responsibility - be sensible with how far you nest!\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--nested'}]} height=\"100\" />\n\n## Centering a column\n\nUse `.mx-auto` to center columns within a container.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--centered'}]} height=\"100\" />\n\n## Column widths\n\nColumn widths can be used with any other block or inline-block elements to add percentage-based widths.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--column-width'}]} height=\"125\" />\n\n## Offset columns\n\nUsing column offset classes can push a div over X number of columns. They work responsively using the [breakpoints outlined below](#responsive-grids).\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--column-offset'}]} height=\"150\" />\n\n## Gutters\n\nUse gutter styles or padding utilities to create gutters. You can use the default gutter style, `gutter`, or either of its modifiers, `gutter-condensed` or `gutter-spacious`. Gutter styles also support responsive breakpoint modifiers. Gutter styles add padding to the left and right side of each column and apply a negative margin to the container to ensure content inside each column lines up with content outside of the grid.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--gutter'}]} height=\"100\" />\n\nUse padding utilities to create gutters for more customized layouts.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--gutter-with-padding'}]} height=\"100\" />\n\n## Inline-block grids\n\nUse column widths with `d-inline-block` as an alternative to floated grids.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--inline-block'}]} height=\"100\" />\n\nYou can use column widths and other utilities on elements such as lists to create the layout you need while keeping the markup semantically correct.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--inline-block-with-column-width'}]} height=\"300\" />\n\n## Display table grids\n\nUsing [display table utilities](/utilities/layout#display) with columns gives you some alternative layout options.\n\nA useful example is being able to keep the height of the container equal across a row when the length of content may differ.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--table'}]} height=\"250\" />\n\nNote that table cells will fill the width of their container even when the total columns doesn't add up to 12.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--table-cell'}]} height=\"100\" />\n\n## Responsive grids\n\nAll the column width classes can be set per breakpoint to create responsive grid layouts. Each responsive style is applied to the specified breakpoint and up.\n\n### Breakpoints\n\nWe use abbreviations for each breakpoint to keep the class names concise.\n\n| Shorthand | Description       |\n| --------- | ----------------- |\n| sm        | min-width: 544px  |\n| md        | min-width: 768px  |\n| lg        | min-width: 1004px |\n| xl        | min-width: 1280px |\n\n**Note:** The `lg` breakpoint matches our current page width of `980px` including left and right padding of `12px`. This is so that content doesn't touch the edges of the window when resized.\n\n<hr />\n\nIn this example at the `sm` breakpoint 2 columns will show, at the `md` breakpoint 4 columns will show, and at the `lg` breakpoint 6 columns will show.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--responsive'}]} height=\"160\" />\n\nFor demonstration, this is how the above example would look at the `sm` breakpoint.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--responsive-small'}]} height=\"160\" />\n\nThis is how that same example would look at the `md` breakpoint.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--responsive-medium'}]} height=\"100\" />\n\nThis is how that example would look at the `lg` breakpoint.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--responsive-large'}]} height=\"100\" />\n\n## Containers\n\nContainer widths match our breakpoints and are available at a `sm`, `md`, `lg`, and `xl` size. Containers apply a max-width rather than a fixed width for responsive layouts, and they center the container.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-grid--container'}]} height=\"130\" />\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"grid"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/index.mdx","frontmatter":{"title":"CSS utilities"},"rawBody":"---\ntitle: CSS utilities\ndescription: Utilities provide the building blocks for layout and handle a range common use cases that help us avoid writing custom styles.\n---\n\n<ChildPages of=\"CSS utilities\" />\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/layout.mdx","frontmatter":{"title":"Layout"},"rawBody":"---\ntitle: Layout\ndescription: Change the document layout with display, float, alignment, and other utilities.\n---\n\n## Display\n\nAdjust the display of an element with `.d-block`, `.d-none`, `.d-inline`, `.d-inline-block`, `.d-table`, `.d-table-cell` utilities.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--display'}]} height=\"140\" />\n\n### The HTML `hidden` attribute\n\nAs of [Primer v10.10.0](https://github.com/primer/css/releases/v10.10.0), `primer-base` includes a rule that sets `display: none !important` for any element with the [`hidden` attribute][hidden]. You can safely use the `hidden` attribute with display utilities, but we suggest:\n\n1. Use the `hidden` attribute (and corresponding JavaScript property) if you're going to programmatically show and hide content.\n1. Use `d-none` and/or its responsive variants (`d-sm-block`, `d-lg-none`) to conditionally show content at different screen sizes.\n\nRather than toggling the `d-none` class in JavaScript, you should toggle the `hidden` property on an element. This means that you won't have to restore any more specific display utility (`d-inline` or `d-flex`, for instance) just to work around the order in which they're listed in the stylesheet.\n\n```js\n// Good:\nelement.hidden = !visible\n\n// Bad:\nelement.classList.toggle('d-none', !visible)\nelement.classList.toggle('d-inline', visible)\n```\n\n### `display:table` wrapping issues\n\nThere are known issues with using `display:table` and wrapping long strings, particularly in Firefox. You may need to use `table-fixed` on elements with `d-table` and apply column widths to table cells, which you can do with our [column width styles](/foundations/css-utilities/grid#column-widths).\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--table'}]} height=\"100\" />\n\n### Responsive display\n\nA selection of display utilities are able to be applied or changed per [breakpoint](/foundations/css-utilities/grid#breakpoints). `.d-block`, `.d-none`, `.d-inline`, and `.d-inline-block` are available as responsive utilities using the following formula: `d-[breakpoint]-[property]`. For example: `d-md-inline-block`. Each responsive display utility is applied to the specified breakpoint and up.\n\nIn the following example, the `ul` element switches from `display: block` on mobile to `display: inline-block` at the `md` breakpoint, while the list items remain inline.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--responsive'}]} height=\"100\" />\n\n### Responsive hide\n\nHide utilities are able to be applied or changed per breakpoint using the following formula:<br /> `hide-[breakpoint]`, for example: `hide-sm`. Hide utilities act differently from other responsive styles and are applied to each **breakpoint-range only**.\n\n| Shorthand | Range            |\n| --------- | ---------------- |\n| -sm       | 0—543px          |\n| -md       | 544px—767px      |\n| -lg       | 768px—1011px     |\n| -xl       | 1012px and above |\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--responsive-hide'}]} height=\"100\" />\n\n### Text direction\n\n`.direction-ltr` or `.direction-rtl` can be used to change the text direction. This is especially helpful when paired with `.d-table`, `.d-table-cell`, and `.v-align-middle` to create equal height, vertically centered, alternating content.\n\n## Visibility\n\nAdjust the visibility of an element with `.v-hidden` and `.v-visible`.\n\n## Overflow\n\nAdjust element overflow with `.overflow-hidden`, `.overflow-scroll`, and `.overflow-auto`, or use `.overflow-visible` to undo the effects of CSS with overflow issues. `.overflow-hidden` can also be used to create a new [block formatting context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context) or clear floats.\n\nOverflow utilities can also target x- and y-axes independently via:\n\n- `.overflow-x-auto`\n- `.overflow-x-hidden`\n- `.overflow-x-scroll`\n- `.overflow-x-visible`\n- `.overflow-y-auto`\n- `.overflow-y-hidden`\n- `.overflow-y-scroll`\n- `.overflow-y-visible`\n\nOverflow utilities can be applied or changed per [breakpoint](/foundations/css-utilities/grid#breakpoints). Each **responsive** overflow utility is applied to the specified breakpoint and up, using the following formula: `overflow-[breakpoint]-[axis]-[property]`. For example: `overflow-x-scroll` or `overflow-md-x-visible`.\n\n## Floats\n\nUsing floats are discouraged since [flexbox](/foundations/css-utilities/flexbox) offers more features and doesn't need to be cleared. If you still need it, you can use `.float-left` and `.float-right` to set floats, and `.clearfix` to clear.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--floats'}]} height=\"100\" />\n\n### Responsive floats\n\nFloat utilities can be applied or changed per [breakpoint](/foundations/css-utilities/grid#breakpoints). This can be useful for responsive layouts when you want an element to be full width on mobile but floated at a larger breakpoint.\n\nEach responsive float utility is applied to the specified breakpoint and up, using the following formula: `float-[breakpoint]-[property]`. For example: `float-md-left`. Remember to use `.clearfix` to clear.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--floats-responsive'}]} height=\"100\" />\n\n## Alignment\n\nAdjust the alignment of an element with `.v-align-baseline`, `.v-align-top`, `.v-align-middle` or `.v-align-bottom`. The vertical-align property only applies to inline or table-cell boxes.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--align'}]} height=\"100\" />\n\nUse `v-align-text-top` or `v-align-text-bottom` to adjust the alignment of an element with the top or bottom of the parent element's font.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--align-text'}]} height=\"100\" />\n\n## Width and height\n\nUse `.width-fit` to set max-width 100%.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--width-fit'}]} height=\"500\" />\n\nUse `.width-full` to set width to 100%.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--width-full'}]} height=\"100\" />\n\nUse `.width-auto` to reset width to `auto` (initial value). Typically used with **responsive variants**. Resize the window to see the effect in the example below.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--width-auto'}]} height=\"100\" />\n\nUse `.height-fit` to set max-height 100%.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--height-fit'}]} height=\"150\" />\n\nUse `.height-full` to set height to 100%.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--height-full'}]} height=\"175\" />\n\n## Position\n\nPosition utilities can be used to alter the default document flow. **Be careful when using positioning, it's often unnecessary and commonly misused.**\n\nThe position of an element depends on the content. Use `top-0`, `right-0`, `bottom-0`, and `left-0` to further specify an elements final position.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--position'}]} height=\"150\" />\n\nUsing the **responsive variants** (e.g. `.right-md-0`) can be helpful for positioning select menus, dropdowns, popovers etc. when the content gets shuffled around for certain responsive breakpoints. You can also use `auto` to \"reset\" a final position for wider breakpoints (e.g. `right-0 right-md-auto`).\n\n### Relative\n\nUse `.position-relative` to create a new stacking context.\n\n_Note how the other elements are displayed as if \"Two\" were in its normal position and taking up space._\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--position-relative'}]} height=\"200\" />\n\n### Absolute\n\nUse `.position-absolute` to take elements out of the normal document flow.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--position-absolute'}]} height=\"150\" />\n\n### Fixed\n\nUse `.position-fixed` to position an element relative to the viewport. **Be careful when using fixed positioning. It is tricky to use and can lead to unwanted side effects.**\n\n_Note: This example is shown in an `<iframe>` and therefore will not be positioned to the viewport of this page._\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--position-fixed'}]} height=\"150\" />\n\nTo fill an entire width or height, use opposing directions.\n\n_Note: fixed positioning has been disabled here for demonstration only._\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--position-fixed-filled'}]} height=\"100\" />\n\n### Sticky\n\nUse `.position-sticky` to keep an element stuck to an edge as long as its parent is visible. Things to keep in mind:\n\n- Using the `.position-sticky` class by itself doesn't have any effect. An additional `[top|bottom|left|right]-0` class is needed. See the examples below.\n- Add a background color to sticky elements so it covers the content underneath.\n- Use `style=\"z-index: 1;\"` (or higher) in case there are other elements with `z-index`.\n\n#### Top\n\nCombine `.position-sticky` with `.top-0` to keep an element stuck to the top.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--position-sticky-top'}]} height=\"250\" />\n\n#### Bottom\n\nCombine `.position-sticky` with `.bottom-0` to keep an element stuck to the bottom. Can be used as a footer or toolbar.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--position-sticky-bottom'}]} height=\"250\" />\n\n#### Left and right\n\nCombine `.position-sticky` with `.left-0` or `.right-0` to keep elements stuck to the left or right when scrolling horizontally.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--position-sticky-left-right'}]} height=\"110\" />\n\n### Responsive position\n\nPosition utilities can be applied or changed per breakpoint in responsive layouts. Each responsive position utility is applied to the specified breakpoint and up, using the following formula: `position-[breakpoint]-[property]`. For example: `position-md-absolute`.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--position-responsive'}]} height=\"100\" />\n\n## Screen reader only\n\nUse `.sr-only` to position an element outside of the viewport for screen reader access only. **Even though the element can't be seen, make sure it still has a sensible tab order.**\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--screen-reader-only'}]} height=\"100\" />\n\n## Show on focus\n\nUse `.show-on-focus` to visually hide an element and only show it when focused. This utility can be used to provide additional functionality for keyboard users.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--show-on-focus'}]} height=\"100\" />\n\n## The media object\n\nCreate a media object with utilities.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--media-object'}]} height=\"150\" />\n\nCreate a double-sided media object for a container with a flexible center.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-layout--media-object-double'}]} height=\"150\" />\n\nYou can also create a media object with [flexbox utilities](./flexbox#media-object) instead of floats which can be useful for changing the vertical alignment.\n\n[hidden]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"layout"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/margin.mdx","frontmatter":{"title":"Margin"},"rawBody":"---\ntitle: Margin\ndescription: Margin utilities are based on a global spacing scale which helps keep horizontal and vertical spacing consistent. These utilities help us reduce the amount of custom CSS that share the same properties, and allows to achieve many different page layouts using the same styles.\n---\n\n## Naming convention\n\nSince margin utilities have many variations and will be used in many places, we use a shorthand naming convention to help keep class names succinct.\n\n| Shorthand | Description              |\n| --------- | ------------------------ |\n| m         | margin                   |\n| t         | top                      |\n| r         | right                    |\n| b         | bottom                   |\n| l         | left                     |\n| x         | horizontal, left & right |\n| y         | vertical, top & bottom   |\n| 0         | 0                        |\n| 1         | 4px                      |\n| 2         | 8px                      |\n| 3         | 16px                     |\n| 4         | 24px                     |\n| 5         | 32px                     |\n| 6         | 40px                     |\n| 7         | 48px                     |\n| 8         | 64px                     |\n| 9         | 80px                     |\n| 10        | 96px                     |\n| 11        | 112px                    |\n| 12        | 128px                    |\n\n## Uniform margins\n\nUse uniform spacing utilities to apply equal margin to all sides of an element. These utilities can change or override default margins, and can be used with a spacing scale from 0-6.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-margin--uniform'}]} height=\"150\" />\n\n## Directional margins\n\nUse directional utilities to apply margin to an individual side, or the X and Y axis of an element. Directional utilities can change or override default margins, and can be used with a spacing scale of 0-6.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-margin--directional'}]} height=\"100\" />\n\n## Extended vertical margins\n\nThe extended scale starts from spacer `7` up to `12`. **Note**: Only the y-axis (`mt`, `mb` and `my`) and its responsive variants are supported.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-margin--directional-extended'}]} height=\"200\" />\n\n## Center elements\n\nUse `mx-auto`to center block elements with a set width.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-margin--auto'}]} height=\"100\" />\n\nWe also provide directional margin auto. `mt-auto, mr-auto, mb-auto, ml-auto`\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-margin--auto-directional'}]} height=\"250\" />\n\n## Reset margins\n\nReset margins built into typography elements or other components with `m-0`, `mt-0`, `mr-0`, `mb-0`, `ml-0`, `mx-0`, and `my-0`.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-margin--reset'}]} height=\"100\" />\n\n## Responsive margins\n\nAll margin utilities can be adjusted per [breakpoint](/foundations/css-utilities/grid#breakpoints) using the following formula: `m[direction]-[breakpoint]-[spacer]`. Each responsive style is applied to the specified breakpoint and up.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-margin--responsive'}]} height=\"100\" />\n\n## Negative margins\n\nYou can add negative margins to the top, right, bottom, or left of an item by adding a negative margin utility. The formula for this is: `m[direction]-n[spacer]`, where `spacer` runs from `1` to `6`. This also works responsively, with the following formula: `m[direction]-[breakpoint]-n[spacer]`.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-margin--negative'}]} height=\"100\" />\n\n## Extended negative margins\n\nYou can use the extended spacing scale for `top` and `bottom` margins, ranging from `1` to `12`.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-margin--negative-extended'}]} height=\"150\" />\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"margin"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/padding.mdx","frontmatter":{"title":"Padding"},"rawBody":"---\ntitle: Padding\ndescription: Padding utilities are based on a global spacing scale which helps keep horizontal and vertical spacing consistent. These utilities help us reduce the amount of custom CSS that could share the same properties, and allows to achieve many different page layouts using the same styles.\n---\n\n## Shorthand\n\nSince padding utilities have many variations and will be used in many places, we use a shorthand naming convention to help keep class names succinct.\n\n| Shorthand | Description              |\n| --------- | ------------------------ |\n| p         | padding                  |\n| t         | top                      |\n| r         | right                    |\n| b         | bottom                   |\n| l         | left                     |\n| x         | horizontal, left & right |\n| y         | vertical, top & bottom   |\n| 0         | 0                        |\n| 1         | 4px                      |\n| 2         | 8px                      |\n| 3         | 16px                     |\n| 4         | 24px                     |\n| 5         | 32px                     |\n| 6         | 40px                     |\n| 7         | 48px                     |\n| 8         | 64px                     |\n| 9         | 80px                     |\n| 10        | 96px                     |\n| 11        | 112px                    |\n| 12        | 128px                    |\n\n_**Note:** The gray in the examples below represents the element, and the yellow represents the padding._\n\n## Uniform padding\n\nUse uniform spacing utilities to apply equal padding to all sides of an element. These utilities can be used with a spacing scale from 0-6.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-padding--uniform'}]} height=\"150\" />\n\n## Directional padding\n\nUse directional utilities to apply padding to an individual side, or the X and Y axis of an element. Directional utilities can change or override default padding, and can be used with a spacing scale of 0-6.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-padding--directional'}]} height=\"100\" />\n\n## Extended directional padding\n\nThe extended directional padding scale starts from spacer `7` and goes up to `12`. All directions and their responsive variants are supported, except for `px`.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-padding--directional-extended'}]} height=\"200\" />\n\n## Responsive padding\n\nAll padding utilities can be adjusted per [breakpoint](/foundations/css-utilities/grid#breakpoints) using the following formula: <br /> `p-[direction]-[breakpoint]-[spacer]`. Each responsive style is applied to the specified breakpoint and up.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-padding--responsive'}]} height=\"100\" />\n\n## Responsive container padding\n\n`.p-responsive` is a padding class that adds padding on the left and right sides of an element. It is intended to be used with [container styles](/foundations/css-utilities/grid#containers).\n\n- On **0 to sm** screens, it gives the element padding of `$spacer-3`\n- On **sm to lg** screens it gives the element padding of `$spacer-6`\n- On **lg and wider** screens, it gives the element padding of `$spacer-3`\n\nIt's the equivalent of adding the `.px-3 .px-sm-6 .px-lg-3` utility classes.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-padding--responsive-container'}]} height=\"100\" />\n\n> Note: Since the example is shown in an `iframe` it won't show the change to `$spacer-3` for the `lg` breakpoint.\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"padding"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/css-utilities/typography.mdx","frontmatter":{"title":"Typography"},"rawBody":"---\ntitle: Typography\ndescription: Type utilities are designed to work in combination with line-height utilities so as to result in more sensible numbers wherever possible.\n---\n\nFont sizes are smaller on mobile and scale up at the `md` [breakpoint](/foundations/css-utilities/grid#breakpoints) to be larger on desktop.\n\n| Scale | Font size: mobile | Font size: desktop | 1.25 line height | 1.5 line height |\n| ----- | ----------------- | ------------------ | ---------------- | --------------- |\n| 00    | 40px              | 48px               | 60               | 72              |\n| 0     | 32px              | 40px               | 50               | 60              |\n| 1     | 26px              | 32px               | 40               | 48              |\n| 2     | 22px              | 24px               | 30               | 36              |\n| 3     | 18px              | 20px               | 25               | 30              |\n| 4     | 16px              | 16px               | 20               | 24              |\n| 5     | 14px              | 14px               | 17.5             | 21              |\n| 6     | 12px              | 12px               | 15               | 18              |\n\n## Heading utilities\n\nUse `.h1` – `.h6` to change an elements font size and weight to match our heading styles.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-typography--heading'}]} height=\"260\" />\n\nThese are particularly useful for changing the visual appearance while keeping the markup semantically correct. Be sure you keep the hierarchy appropriate for the page.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-typography--heading-semantic'}]} height=\"100\" />\n\n## Type scale utilities\n\nUse `.f1` – `.f6` to change an elements font size while keeping inline with our type scale.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-typography--font-size'}]} height=\"280\" />\n\nLighter font-weight utilities are available in a limited range. Lighter font-weights reduce the legibility of text, particularly at small font sizes, so the scale only goes down to `f3` at 20px. The larger sizes`f0` and `f00` allow for lighter and larger type that is in keeping with our marketing styles.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-typography--font-size-light'}]} height=\"280\" />\n\n## Line height styles\n\nChange the line height density with these utilities. Responsive variants are also available (e.g. `.lh-sm-condensed`).\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-typography--line-height'}]} height=\"280\" />\n\nThe `lh-0` utility class sets `line-height: 0 !important`, and can be used to remove vertical spacing from elements that inherit line-height but don't contain any text.\n\n## Typographic styles\n\nChange the font weight, styles, and alignment with these utilities.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-typography--typographic-styles'}]} height=\"600\" />\n\n## Word-break\n\nThere are two utilities for adjusting how lines and words of text break when they exceed the width of their containing element:\n\n1. `wb-break-word` sets `word-break: break-word` and `overflow-wrap: break-word`, which will only break words if they would exceed the line length _after wrapping_.\n\n2. `wb-break-all` sets `word-break: break-all`, which will force a word to break regardless of whether it's shorter than the line length. See [MDN's `word-break` docs](https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#Values) for more info.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-typography--word-break'}]} height=\"410\" />\n\n## Text alignment\n\nUse text alignment utilities to left align, center, or right align text.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-typography--text-alignment'}]} height=\"150\" />\n\n## Responsive text alignment\n\nUse the following formula to make a text alignment utility responsive: `.text-[breakpoint]-[alignment]`\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-typography--text-alignment-responsive'}]} height=\"100\" />\n\n## List styles\n\nRemove bullets from an unordered list or numbers from an ordered list by applying `.list-style-none` to the `<ul>`.\n\n<StorybookEmbed framework=\"css\" stories={[{id: 'utilities-typography--list'}]} height=\"100\" />\n","parent":{"relativeDirectory":"foundations/css-utilities","name":"typography"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/icons/design-guidelines.mdx","frontmatter":{"title":"Design guidelines"},"rawBody":"---\ntitle: Design guidelines\n---\n\nimport {Box} from '@primer/react'\n\nThese are guidelines to use as a reference when designing new octicons.\n\n## Grid sizes\n\nDesign two versions of each icon: a 16px version and a 24px version. \n\n<Box display={\"grid\"} gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={4}>\n    <div>\n        <Box display={\"flex\"} bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/41d55c2894e91bd7d0594d005ce51e2471292973343c01dcbbc271c34aa2d702\"/>\n        </Box>\n        <Caption>16x16 grid</Caption>\n    </div>\n    <div>\n        <Box display={\"flex\"} bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/b270acfcf262364d2647cf96df17fd9b89aa891f65bc3c50c404d74531e8bb0e\"/>\n        </Box>\n        <Caption>24x24 grid</Caption>\n    </div>\n</Box>\n\n## Stroke\n\nUse a consistent stroke width of 1.5px for both 16px and 24px icons.\n\n<div>\n    <Box display={\"flex\"} bg=\"gray.1\" justifyContent=\"center\">\n        <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/def9d3100c985ae397b8f0a0aa64506259449887ebc0bd362c727de3701d3fda\"/>\n    </Box>\n    <Caption>1.5px stroke on 16px icon</Caption>\n</div>\n\n\n## Reference shapes \n\nUse the following shapes as sizing references to ensure that the \"optical volume\" of your icon is consistent with the rest of the set. See the \"Grid and Optical Volume\" section of [Nucleo's Icon Guidelines](https://blog.nucleoapp.com/nucleo-icon-guidelines-introduction-70092f8b4697) to learn more about \"optical volume.\"\n\n### Circle\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={4}>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/517fd99ef0fb4b18ec8ba2866d1c588abf723a09c5cf88ac0689489096fa1c66\"/>\n        </Box>\n        <Caption>Circle on 16x16 grid</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/14df95cdfabe5942d909d93d6d0cf53559f747069c1c14b31e90ad0e3a2bb493\"/>\n        </Box>\n        <Caption>Circle on 16x16 grid example</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/386489cc8ceb0f33c27bfe85fc4fc4fcd3a625034f9c1a5ba76a0441ffd6c196\"/>\n        </Box>\n        <Caption>Circle on 24x24 grid</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/b1613783f96baf871bdeaf50c3353770b21437ef182f6f653b4aaa7cd7998074\"/>\n        </Box>\n        <Caption>Circle on 24x24 grid example</Caption>\n    </div>\n</Box>\n\n### Square\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={4}>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/d7f7995b17d2da448b5f7897cbdeb6852314caf644378e6a2f003f49bf93bee9\"/>\n        </Box>\n        <Caption>Square on 16x16 grid example</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/528612e3b081227a9c7d637145d8efec33e2040121ece3615008bec1efab62a2\"/>\n        </Box>\n        <Caption>Square on 16x16 grid example</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/50065ee42ae2dcec8fc89981c58627ebb59e0fcbeac46242d0f9129d0eb382bd\"/>\n        </Box>\n        <Caption>Square on 24x24 grid</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/d0c6f1bc2e6b79e5bb7c1908f1628b684e1a34d310565424f16f768596152005\"/>\n        </Box>\n        <Caption>Square on 24x24 grid example</Caption>\n    </div>\n</Box>\n\n### Rectangle\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={4}>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/9f5be6a1ab3037035e5e3a95949dddbf0774b65ab44f07cc40df14acb493b73f\"/>\n        </Box>\n        <Caption>Rectangle on 16x16 grid</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/6ae41747f6879df041fbd3c3a8bf6a1299d93fbbb94cf286b0ea003c271f4171\"/>\n        </Box>\n        <Caption>Rectangle on 16x16 grid example</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/58d509fcc6462dcf1f6b302ee613af53e9d60e41df658c6c72d38ced736860c4\"/>\n        </Box>\n        <Caption>Rectangle on 24x24 grid</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/2dc78cb66d06f450ab6d41136e5c72cebc36bbd0b57e870c377a8f41ca1efbf4\"/>\n        </Box>\n        <Caption>Rectangle on 24x24 grid example</Caption>\n    </div>\n</Box>\n\n## Caps and joins\n\nUse round caps and joins.\n\n<div>\n    <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n        <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/fec160f7b9bad6d1f9bf15da6e9b6ece441680c81ce7d3392e90e17567db9f3e\"/>\n    </Box>\n    <Caption>Round caps and joins</Caption>\n</div>\n\n## Corners\n\nUse 1px radius for corners unless a different radius makes the icon more recognizable (e.g. [repo](/repo-16)). \n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={4} mb={4}>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/48f9cd74350c40914c1aeb97a4e830bc5b5d8fa855a6125cfe791ec9b033913f\"/>\n        </Box>\n        <Caption>1px radius on 16px icon</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/90a05df970a9049bae4e249cb8fab4db64311a2293154d08cca2ad46131d5e0c\"/>\n        </Box>\n        <Caption>1px radius on 24px icon</Caption>\n    </div>\n</Box>\n\nUse 0.25px radius for small filled elements inside icons, like filled arrowheads.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={4}>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/528954ce1f6774b645b7ca04a36acb00739df168e7ba8b691050c5c223c032e0\"/>\n        </Box>\n        <Caption>0.25px radius on arrowhead</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/042c23576fd22e88fc013692cc3cf0ee1b9e76fdaad7595d8f90f31113e106be\"/>\n        </Box>\n        <Caption>0.25px radius on bookmark in repo icon</Caption>\n    </div>\n</Box>\n\n## Gaps\n\nUse a 1px gap to separate overlapping objects.\n\n<Box display=\"flex\" mb={4} flexDirection=\"column\">\n    <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n        <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/e3ff5e9bf83ff4d5fe7cf43e8f3b9cd14bb30bdfb705cfcbc30adf013b39499f\"/>\n    </Box>\n    <Caption>1px gap in comment-discussion icon</Caption>\n</Box>\n\nUse a 1.5px gap around modifier elements, like lines and arrows.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={4}>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/469f56437ac92380af105686fd03f5639d03c5013a965724303f2ff9aee2569f\"/>\n        </Box>\n        <Caption>1.5px gap in bookmark-slash icon</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/650ecfa784e14b19635ac96be274c3e9e48f2fcf71d67fee8eaea73ff258fc0e\"/>\n        </Box>\n        <Caption>1.5px gap in package-dependencies icon</Caption>\n    </div>\n</Box>\n\n## Perspective\n\nUse 2D perspective unless depth makes the icon more recognizable.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={4}>\n    <Do>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/279357826adcb80f653d8d199e6b01989a1d08daacb4e1eb9d88a6b27d7f25a4\"/>\n        </Box>\n        <Caption>Use 2D perspective</Caption>\n    </Do>\n    <Dont>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/1476c36a14d58dc6d931c9ac9e87bc3cee827c86f6a3f5a0e4ca50cf9e7577b1\"/>\n        </Box>\n        <Caption>Don't add unnecessary depth</Caption>\n    </Dont>\n    <Do>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/3aadc8fea546dd54d25198401ccd737e4199798c20b4032535c40ee6ba89feb3\"/>\n        </Box>\n        <Caption>Use depth when it adds meaning</Caption>\n    </Do>\n    <Dont>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/bbe56e09aff2a5f8b0dfa7dbbc37f1cc4d6b4f464e4f1b06d0b78dc5cf970454\"/>\n        </Box>\n        <Caption>Don't use a 2D perspective if it makes the icon unrecognizable</Caption>\n    </Dont>\n</Box>\n\n## Pixel alignment\n\nAlign the outer edge of shapes to pixel boundaries when possible.\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={4}>\n    <Do>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/7fb5cb03a4e6d1164ad31b1ed8d3538f00c69a788c2d3bfd8ad282398b517c04\"/>\n        </Box>\n        <Caption>Align the outer edge of shapes to pixel boundaries</Caption>\n    </Do>\n    <Dont>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/39e340f63b3f8f6a8e86f3a656b53777caddfaec757ee98a0f64c8e7de245f7d\"/>\n        </Box>\n        <Caption>Don't align the inner edge of shapes to pixel boundaries</Caption>\n    </Dont>\n</Box>\n\n\n## Arrowheads\n\nUse line arrowheads unless there is not enough room.\n\n\n<Box display=\"grid\" gridTemplateColumns={['1fr', null, null, null, '1fr 1fr']} gridGap={4}>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/d8f70676d9e78c9bf5aab2961eb65d5aa311bf8119f11be229c8056838a2cd6e\"/>\n        </Box>\n        <Caption>Line arrowhead in sign-out icon</Caption>\n    </div>\n    <div>\n        <Box display=\"flex\" bg=\"gray.1\" justifyContent=\"center\">\n            <img width=\"400\" alt=\"\" src=\"https://compai.pub/v1/png/603edbc609906bb955775f45d0d0257b25805ab309b1ad86111b029e3b57a0fc\"/>\n        </Box>\n        <Caption>Filled arrowhead in link-external icon</Caption>\n    </div>\n</Box>\n\n\n## Contributing\n\n### Creating a pull request\n\nIf you work at GitHub, you can use the [Octicons Push](https://www.figma.com/community/plugin/825432045044458754/Octicons-Push) Figma plugin to start an Octicons pull request from Figma.\n\nHere's how it works:\n1. Select the icon frames you want to commit. Make sure the frames are either 16x16 or 24x24 and that you've outlined all strokes.\n1. Open the Octicons Push plugin.\n1. Select the branch you want to commit to. You can choose an existing branch or create a new branch.\n1. Press \"Commit.\" The plugin will then export, commit, and push the selected icons to the branch you chose. If you chose to create a new branch, the plugin will give you a link to where you can start a new pull request with your branch.\n\nAfter you create a pull request, a member of the [design systems](https://primer.style/about/#team/) team will triage and review your contribution.\n\n\n![demo showing how to create a pull request using the Octicons Push Figma plugin](https://user-images.githubusercontent.com/4608155/77948730-b1a24600-727a-11ea-9c39-040be9a12963.gif)\n\n### Review questions\n\nHere are a few questions we'll ask when reviewing new octicons. Keep these in mind as you're designing:\n\n- Where will this icon be used in the context of GitHub UI?\n- Is an icon necessary in that context?\n- Could we use an existing icon?\n- Is the icon trying to represent too many ideas? \n- Does it follow the design guidelines?","parent":{"relativeDirectory":"foundations/icons","name":"design-guidelines"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/foundations/icons/index.mdx","frontmatter":{"title":"Octicons"},"rawBody":"---\ntitle: Octicons\nsource: https://github.com/primer/octicons\n---\n\nimport Icons from '../../../src/components/icons'\n\n<Icons />\n","parent":{"relativeDirectory":"foundations/icons","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/accessibility-at-github.mdx","frontmatter":{"title":"Accessibility at GitHub"},"rawBody":"---\ntitle: Accessibility at GitHub\ndescription: Get started with accessibility at GitHub.\n---\n\nGitHub's aim is to be the home for _all_ developers. To be inclusive means we must consider accessibility at the core of how we design.\n\n15% of the world's population has a disability (estimated by the [World Health Organization based on 2010 data](https://www.who.int/disabilities/world_report/2011/report/en/)), and that doesn't take into consideration those under temporary or situational disabilities.\n\nIn many cases, devices that have been designed with accessibility in mind for a portion of the population end up benefiting everyone. Take the [OXO brand's Good Grips line of products](https://www.oxo.com/blog/behind-the-scenes/behind-design-oxos-iconic-good-grips-handles/); although they were developed for people who have arthritis, most people found them easier to use than other product lines.\n\nWhen you consider accessibility from the beginning of the design process and incorporate it throughout, it becomes part of an established design process that seeks to include everyone, of all abilities, and allows everyone to achieve more.\n\n<Note>\n  When reading through accessibility information, you might find the common abbreviation: \"a11y\". A11y is a shortening\n  of the word \"accessibility\". It starts with the first letter, \"a\", uses the number 11 for the eleven characters\n  inbetween the first and last letter, and ends with the last letter, \"y\".\n</Note>\n\n## What standards you must aim for\n\nGitHub aims for [Web Content Accessibility Guidelines (WCAG) 2.1](https://www.w3.org/TR/WCAG21/) AA compliance. This includes all of WCAG 2.0 AA plus additional considerations.\n\nCurrently, [Section 508](https://www.access-board.gov/guidelines-and-standards/communications-and-it/about-the-ict-refresh/overview-of-the-final-rule) (required by law in the United States) follows WCAG 2.0 AA guidelines for compliance.\n\n## Who should you consider when designing?\n\nWhile there are a multitude of disabilities to consider, the majority will fall into one of these categories:\n\n- **Visual:** Anything that deals with sight, or technology that helps someone to see. This includes people who have different types of sight like color blindness.\n- **Cognitive:** Concentration, memory, judgement, problem solving, logic skills.\n- **Mobility:** Anything that affects movement in a body.\n- **Hearing:** A spectrum of disabilities related to sound or audio.\n\nEach disability category can be further divided into three sub-categories:\n\n- **Permanent:** Disability does not go away.\n  - Example: Someone who is deaf\n- **Temporary:** The disability will go away in time.\n  - Example: Someone who has an ear infection\n- **Situational:** The environment someone is in plays a huge factor in how they interact with web content.\n  - Example: Someone who is at a loud sporting event\n\nFor an informative list on real-life disability situations, check [An Alphabet of Accessibility Issues](https://the-pastry-box-project.net/anne-gibson/2014-july-31), published by The Pastry Box Project.\n\nMicrosoft has created a downloadable PDF that looks into the area of inclusive design from a people perspective, with several informative examples. Navigate to the ‘Inclusive 101’ toolkit on the main page of [Microsoft’s Inclusive Design website](https://www.microsoft.com/design/inclusive/).\n\n## Internal resources\n\nIf you're GitHub staff and need help with accessibility:\n\n- Visit the #accessibility Slack channel to ask questions or discuss accessibility issues\n- Check the [github/accessibility](https://github.com/github/accessibility) repository (accessible to GitHub staff only) for information on events or learning resources\n- Attend the inclusive design office hours with @ichelsea on Tuesdays (the time alternates between 10am PST and 1pm PST every other week)\n\n## Support\n\nAccessibility is a priority for GitHub. If you ever encounter accessibility related issues when using github.com, please don’t hesitate to get in touch via [the contact page](https://support.github.com/contact) or email [support@github.com](mailto:support@github.com) with your concerns.\n\nFor information about the accessibility compliance of GitHub products, please refer to the [VPAT report, outlining §508 accessibility information for GitHub.com, GitHub Enterprise, and GitHub Desktop](https://government.github.com/accessibility/).\n","parent":{"relativeDirectory":"guides/accessibility","name":"accessibility-at-github"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/alternative-text-for-images.mdx","frontmatter":{"title":"Alternative text for images"},"rawBody":"---\ntitle: Alternative text for images\ndescription: Alternative text on images allows assistive technology like screen readers to understand the purpose of an image on a page or allow them to skip it if purely decorative.\n---\n\n## Overview\n\n> Text alternatives are a primary way for making information accessible because they can be rendered through any sensory modality (for example, visual, auditory or tactile) to match the needs of the user. Providing text alternatives allows the information to be rendered in a variety of ways by a variety of user agents. For example, a person who cannot see a picture can have the text alternative read aloud using synthesized speech.\n>\n> Source: https://www.w3.org/TR/UNDERSTANDING-WCAG20/text-equiv-all.html\n\n## Why?\n\nImages can make the web user experience better and more pleasant, especially for users with cognitive and learning disabilities. Not all images used in websites are accessible, and that can be a major barrier. Accessible images are beneficial for everyone, especially for people using screen readers and other assistive technologies, as well as search engine optimization (SEO).\n\nWhen screen readers come across images, graphs, and icons without an `alt` attribute, by default the screen reader will speak the name of the file, which most of the time can be unhelpful (for example: `final-final-truly-final-V2.jpg`).\n\nYou can read more about why alternative text for images is important in the [Web Accessibility Tutorials Guidance on how to create websites that meet WCAG\n](https://www.w3.org/WAI/tutorials/images/#why-is-this-important).\n\n## Guidelines and examples\n\n### Informative and decorative images\n\nTo help you determine the best way to communicate the information of an image to a screen reader user, you can use [the alt text decision tree provided by the W3C](https://www.w3.org/WAI/tutorials/images/decision-tree/).\n\nDepending the purpose of the images, they can be categorized into one of two categories: [informative](https://www.w3.org/WAI/tutorials/images/informative/) or [decorative](https://www.w3.org/WAI/tutorials/images/decorative/) images.\n\n- Informative images convey a simple concept or information that can be expressed in a short phrase or sentence. The `alt` text must contain the description of what is displayed visually in the image.\n- Decorative images don’t add information to the content of a page. For example, an image that is included to make the website more visually attractive. You will always get an affirmative answer to the question \"if the image was removed, would the user still get all the information from the page?\".\n\n### For designers\n\nWhen you create a new design and it includes images, include captions with a description for each of them. Annotate which images are informative and which ones are decorative.\n\n### For engineers\n\nAs you're developing a new component, feature, or page that contains an image, use proper [semantic HTML](/guides/accessibility/semantic-html) and use the `<img>` element with proper alternative text using the `alt` attribute.\n\nEvery `<img>` element must have an `alt` attribute. It could have content for informative images or be empty for decorative images, but it must always be present.\n\n### How to write good alt text\n\nA missing `alt` attribute is bad, but an `alt` attribute with wrong or useless information is not a better solution. When writing the `alt` text of an image, you should always have in mind some rules:\n\n- Keep it short. Avoid long, boring, or irrelevant information. The `alt` text should be the most concise description possible of the image’s purpose.\n- The alternative text should not include the words \"button\", \"link\", or \"image\". Screen readers already provide that information.\n- In [textual images](https://www.w3.org/WAI/tutorials/images/textual/) (images that contain words that are important to understanding the content), the words should be included in the text alternative.\n- Don't fill the `alt` text with keywords. The `alt` attribute is often misused as a place to store SEO keywords or copyright information.\n- Combine `alt` text with the caption or the content. If the image is sufficiently described in the text (for example, a simple diagram illustrating what's written in the web page text) it can have a brief `alt` text such as \"Diagram of work flow described above\".\n\n<DoDontContainer>\n  <Do>\n    <Caption>Every img element must have an 'alt' attribute.</Caption>\n    <Code className=\"language-html\">{`<img src=\"image1.jpg\" alt=\"A dog playing with a ball\" />`}</Code>\n    <br />\n    <Caption>Leave the 'alt' attribute empty for decorative.</Caption>\n    <Code className=\"language-html\">{`<img src=\"shape.png\" alt=\"\" />`}</Code>\n  </Do>\n  <Dont>\n    <Caption>Don't use an img element without an 'alt' attribute.</Caption>\n    <Code className=\"language-html\">{`<img src=\"image1.jpg\"/>`}</Code>\n  </Dont>\n</DoDontContainer>\n\nYou can read more tips in the [Web Accessibility Tutorials Guidance on how to create websites that meet WCAG\n](https://www.w3.org/WAI/tutorials/images/tips/).\n\n## Additional resources\n\n- [WebAIM Alternative Text](https://webaim.org/techniques/alttext/)\n- [Deep Dive: Making your images accessible](https://github.com/github/accessibility/blob/main/docs/deep-dive-notes/2022-01-26-images.md) (Only accessible to GitHub staff)\n- [Accessible Images For When They Matter Most\n  ](https://www.smashingmagazine.com/2020/05/accessible-images/)\n\n### Related WCAG guidelines and success criteria\n\n- [Guideline 1.1 Text Alternatives](https://www.w3.org/TR/WCAG21/#text-alternatives)\n- [Understanding Success Criterion 1.1.1: Non-text Content](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html)\n- [H37 Technique - Using alt attributes on img elements](https://www.w3.org/WAI/WCAG21/Techniques/html/H37.html)\n- [HTML Spec - 4.8.4.4 Requirements for providing text to act as an alternative for images](https://html.spec.whatwg.org/multipage/images.html#alt)\n","parent":{"relativeDirectory":"guides/accessibility","name":"alternative-text-for-images"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/announcements.mdx","frontmatter":{"title":"Assistive technology announcements"},"rawBody":"---\ntitle: Assistive technology announcements\ndescription: Events like toasts and status messages are visually communicated to GitHub users. Making sure those announcements are read via assistive technology allows users with low or no vision to get that status information.\n---\n\n## Overview\n\nThese guidelines will help you determine when assistive tools should output a message.\n\n## Guidelines\n\n- **Always: Announce location changes** — Help users understand where they are on a page. Maintain positional awareness.\n- **Always: Announce results of user actions** — Give feedback about the success or failure directly following a user action.\n- **Sometimes: Announce other changes** — Explore case-by-case when changes are disconnected from the user’s place and the success or failure of the user’s actions. For example:\n  - Distracting change announcements: When other users add issue comments; when presence indicators appear\n  - Essential change announcements: When log lines stream in on the GitHub Actions workflow run page\n\n## Additional resources\n\n- [Deep Dive: Page and Navigation transitions, Dynamic Content, and SPAs](https://github.com/github/accessibility/blob/main/docs/deep-dive-notes/2022-03-02-page-transitions.md) (only accessible to GitHub staff)\n- [Deep Dive: Save Patterns & Status Messages](https://github.com/github/accessibility/blob/main/docs/deep-dive-notes/2021-11-19-save-patterns-and-status-messages.md) (only accessible to GitHub staff)\n","parent":{"relativeDirectory":"guides/accessibility","name":"announcements"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/descriptive-buttons.mdx","frontmatter":{"title":"Descriptive buttons"},"rawBody":"---\ntitle: Descriptive buttons\ndescription: Labeling buttons properly let's users know what will happen when they activate the control, lessens errors, and increases confidence.\n---\n\n## Overview\n\nIn order for a button’s purpose to be clear to all users, it must have a meaningful name.\n\n### What is a meaningful name?\n\nA meaningful name describes the button’s purpose: the action that occurs when the button is activated (for example: removing a list item), and the action’s associated context (for example: the specific item to be removed). To avoid unnecessary verbosity, button names should be as succinct as possible while still being descriptive and unique.\n\nRefer to [Identifying GitHub comments](#identifying-github-comments) below for an example of a succinct, unique name. To explore how meaningful names can be set in code, refer to the [examples](#examples) below.\n\n### Why is a meaningful name necessary?\n\nClear and consistent labels set user expectations for button actions, giving users confidence that activating a button will have the outcome they expect.\n\nScreen readers (for example: VoiceOver) provide overlays to enable users to jump to specific types of elements, including buttons. Elements are listed by their names. When buttons don’t have meaningful names, it’s not possible to determine which action will be performed when selecting them from the list.\n\n## How to test names\n\nWhen reviewing buttons on a page, ensure the following are true:\n\n- Each button has a non-empty name. Refer to [ACT 97a4e1: Button has non-empty accessible name](https://www.w3.org/WAI/standards-guidelines/act/rules/97a4e1/).\n- When buttons perform the same action, they have the same name.\n- When buttons perform different actions, they don’t have the same name.\n\n## Guidelines\n\n### For designers\n\n- When including an unlabeled, icon-only button in a design, recommend an accessible name.\n- When including multiple buttons that peform the same function in a design, use the same label for each.\n\n### For engineers\n\n- When a button doesn’t have a visible label (for example: an [IconButton](https://primer.style/view-components/components/iconbutton)), provide an accessible name. Refer to [ARIA 14: Using `aria-label` to provide an invisible label where a visible label cannot be used](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA14).\n- Because `aria-label` doesn’t _supplement_ visible labels but rather _supplants_ them, when a button has a visible label, include that label in its accessible name. A good practice is to have the text of the label at the start of the name.\n- Don’t use `aria-label` when its content would be identical to a button’s visible label.\n- Don’t reuse the same (visible) label or (invisible) name for buttons which perform different actions.\n\n## Examples\n\n<DoDontContainer>\n  <Do>\n    <Code className=\"language-html\">{`<button type=\"button\">OK</button>`}</Code>\n    <Caption>The button does not have a redundant `aria-label` attribute.</Caption>\n  </Do>\n  <Dont>\n    <Code className=\"language-html\">{`<button type=\"button\">OK</button>`}</Code>\n    <Caption>The button has a redundant and unnecessary `aria-label` attribute.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <Code className=\"language-html\">\n      {`<button type=\"button\" aria-label=\"smockle’s profile\"><img alt=\"smockle\" src=\"https://avatars.githubusercontent.com/u/3104489?s=32\"></button>`}\n    </Code>\n    <Caption>The button should have an accessible name.</Caption>\n  </Do>\n  <Dont>\n    <Code className=\"language-html\">\n      {`<button type=\"button\"><img src=\"https://avatars.githubusercontent.com/u/3104489?s=32\"></button>`}\n    </Code>\n    <Caption>The button should not be missing a name.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Meaningful and unique names\n\nEach button in the example below has a unique name which describes its action (“Remove”) and its action’s context (for example: “'Apples'”).\n\n```HTML\n<script>\n  function removeItem(event) {\n    const item = event.target.closest(\"li\");\n    item?.parentNode.removeChild(item);\n  }\n</script>\n<ul>\n  <li>Apples <button onclick=\"removeItem(event)\" aria-label=\"Remove 'Apples'\" type=\"button\">❌</button></li>\n  <li>Bananas <button onclick=\"removeItem(event)\" aria-label=\"Remove 'Bananas'\" type=\"button\">❌</button></li>\n  <li>Cantaloupes <button onclick=\"removeItem(event)\" aria-label=\"Remove 'Cantaloupes'\" type=\"button\">❌</button></li>\n</ul>\n```\n\nAlthough each button in the example below performs a different action, they all have the same name: ❌ (“cross mark”). This name does not describe the action that occurs when a given button is activated, nor does it describe the action’s context.\n\n```HTML\n<script>\n  function removeItem(event) {\n    const item = event.target.closest(\"li\");\n    item?.parentNode.removeChild(item);\n  }\n</script>\n<ul>\n  <li>Apples <button onclick=\"removeItem(event)\" type=\"button\">❌</button></li>\n  <li>Bananas <button onclick=\"removeItem(event)\" type=\"button\">❌</button></li>\n  <li>Cantaloupes <button onclick=\"removeItem(event)\" type=\"button\">❌</button></li>\n</ul>\n```\n\n## Additional resources\n\n### Terminology: “label” vs “name”\n\nWhen you review the Web Content Accessibility Guidelines (WCAG) below, you’ll encounter the terms “label” and “name”. Here are the definitions given for each:\n\n- [label](https://www.w3.org/TR/WCAG22/#dfn-labels):\n\n  > text or other component with a text alternative that is presented to a user to identify a component within Web content\n\n- [name](https://www.w3.org/TR/WCAG22/#dfn-name):\n  > text by which software can identify a component within Web content to the user (Note: This is unrelated to the `name` attribute in HTML.)\n\nThe name may be hidden and only exposed by assistive technology, whereas a label is presented to all users. In many (but not all) cases, the label and the name are the same.\n\n### Related WCAG guidelines and success criteria\n\n- [SC 1.3.6 — Identify Purpose](https://www.w3.org/TR/WCAG22/#identify-purpose):\n\n  > …the purpose of user interface components…can be programmatically determined.\n\n- [SC 2.4.4 — Link Purpose (In Context)](https://www.w3.org/TR/WCAG22/#link-purpose-in-context):\n\n  > The purpose of each link can be determined from the link text alone or from the link text together with its programmatically determined link context…\n\n- [SC 2.4.9 — Link Purpose (Link Only)](https://www.w3.org/TR/WCAG22/#link-purpose-link-only):\n\n  > A mechanism is available to allow the purpose of each link to be identified from link text alone…\n\n- [SC 2.5.3 — Label in Name](https://www.w3.org/TR/WCAG22/#label-in-name):\n\n  > For user interface components with labels that include text…the name contains the text that is presented visually.\n\n- [SC 3.2.4 — Consistent Identification](https://www.w3.org/TR/WCAG22/#consistent-identification):\n\n  > Components that have the same functionality within a set of Web pages are identified consistently.\n\n- [SC 4.1.2 — Name, Role, Value](https://www.w3.org/TR/WCAG22/#name-role-value):\n\n  > For all user interface components…the name and role can be programmatically determined…\n\n### Related patterns and shared code\n\n#### Identifying GitHub comments\n\nWhen a button is associated with a specific comment, a comment indentifier should be included within the button’s name. [`reaction_target_identifier`](https://github.com/github/github/blob/016b875e0542c0781a3c6f5ed27c58c472cc6717/app/components/reactions/reactions_component.rb#L47-L51) (only accessible to GitHub staff) uses [`aria-label-date`](https://github.com/github/github/blob/9bea7b7d0d120df6b9b864fda39fe374479acc0d/app/components/application_component.rb#L68-L78) (only accessible to GitHub staff) to generate a concise, unique comment identifier.\n\nFor example, `reaction_target_identifier` could be used in a reply-to-comment button’s name. In all cases, `reaction_target_identifier` adds the comment’s author and timestamp; conditionally, as needed, `reaction_target_identifier` adds progressively-verbose date information:\n\n> - Reply to benjiallen, 2:45PM today\n> - Reply to benjiallen, 2:45PM yesterday\n> - Reply to benjiallen, 2:45PM on November 19\n> - Reply to benjiallen, 2:45PM on November 19, 2021\n","parent":{"relativeDirectory":"guides/accessibility","name":"descriptive-buttons"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/focus-management.mdx","frontmatter":{"title":"Focus management"},"rawBody":"---\ntitle: Focus management\ndescription: Managing focus within a page or application is essential for users to successfully navigate, complete actions, and understand where they are.\n---\n\n## Overview\n\nManaging focus within a page or application is essential for users to successfully navigate, complete actions, and understand where they are. A focus indicator is usually seen visually as a blue outline around an interactive element when that element has focus.\n\n## Why?\n\nNot all users are able to use a mouse to navigate a web page or application. Keyboard-only and screen reader users rely on navigating and using a web page with only a keyboard, so they will be unable to perform certain actions if they cannot navigate to all elements.\n\nTo meet [WCAG Guideline 2.1 (Keyboard Accessible)](https://www.w3.org/TR/WCAG21/#keyboard-accessible), all interactive elements need to be accessed and activated by a keyboard alone.\n\n## How to test focus management\n\nTo verify proper focus management, try using the feature or page with only a keyboard. Use the Tab key to navigate forward and Shift + Tab to move backwards. Some elements will use the arrow keys for keyboard navigation, such as toolbars and dropdowns.\n\nWhile using the feature, you should make sure that:\n\n- You can navigate to every interactive element (for example: buttons, form fields, links)\n- You see a visual focus indicator for every element (for example: a blue outline)\n- The tabbing order is logical based on the page structure and content\n- You are not trapped anywhere, and focus is never lost (for example: when deleting a comment, focus is returned to a logical place)\n- If you can trigger a new element (for example: a modal), focus is moved to that modal when opened, and returned to the page when closed\n\n## Guidelines\n\n### For designers\n\nIn your designs, annotate how the focus should move through various states of a feature, if applicable, for the user. Include where the focus should be when: an item is deleted, an item is added, an action triggers a page refresh, a modal is opened, a modal is closed, etc.\n\nKeep in mind high-contrast mode, dark mode, and light mode. Ensure the focus indicator meets the minimum color contrast ratio.\n\n### For engineers\n\nMost interactive elements will have a focus indicator automatically. For example, if you use a `<button>` element, it should automatically receive focus when using a keyboard. If you need to create your own focus indicator, you can do so with the CSS pseudo-class [`:focus`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus). You may also need to add/remove a class with JavaScript to apply/remove the focus indicator.\n\nA common complaint when using `:focus` is that when a user clicks on a button, for example, they see the focus indicator which isn't always necessary for a mouse user. This may lead to an engineer removing the `outline` entirely — never remove the focus indicator unless you are replacing it with a `border` or some other visual indicator. Using [`:focus-visible`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible) will prevent the focus indicator from being seen for mouse users, but show it for keyboard users.\n\nYou may need to programmatically determine where the focus should be when an event happens. For example, when you open a modal, you will need to programmatically move focus to an element inside of it. One way of doing this is by setting `document.activeElement` to the element you want to have focus.\n\nSee the [Primer Behaviors repo](https://github.com/primer/behaviors) for existing behaviors related to focus, such as focus trapping.\n\n## Examples\n\n### Complex components\n\nCertain components may have specific focus requirements. Let's use modals as an example. A modal is typically triggered by a button. When a user presses a button, focus needs to move to the modal, or it will be completely unusable to some users. The focus needs to remain inside the modal until it is dismissed. A common mistake is to not trap focus inside of the modal, which will allow a user to navigate to elements on the page behind the modal with the modal still open. Another consideration is where the focus should return when the modal is closed. Typically the element that triggered the modal is where focus should return, unless there is a more logical element. [See more information on expected modal behavior](https://www.w3.org/TR/wai-aria-practices-1.2/#dialog_modal).\n\n### Adding content\n\nWhen adding content to the page, focus should move to the first item that is added, unless a more logical spot is determined. For example: if there is a “Load more” button that reveals additional comments when pressed, the focus should move to the first comment that is newly added.\n\n### Removing content\n\nWhen removing content, focus should return to a logical spot. By default, if you remove an item and don't tell the focus where to go next, it will return to the `body` element and the user will need to navigate through the entire page again to get to where they were. For example, if deleting a comment within a thread, move the focus to either a “write comment” input if one exists, or the menu of the next comment. If there is no other comment, use the previous comment. This is just a suggestion, use best judgement when deciding what will be logical for a user.\n\n### Filtering\n\nFiltering is a very complex topic. Accessibility guidance will vary depending on the filter implementation, but when done right, focus management should only play a small role. For example, if you have five filters and apply the first filter, you do not want to be moved to the results because you may not be ready to move on. Focus should instead continue to remain on the selected element.\nFocus management really only applies when a selected filter is removed from the page. For instance, if a \"Clear\" filter is applied which removes the \"Clear\" element, follow the focus management guidance provided in [Removing content](#removing-content).\n\nIf the filter is implemented as a link causing a full page reload, the focus may get lost. In this implementation, focus management is a nice to have rather than a requirement. It is much more important to ensure there is a skip link and a proper heading structure is in place to support efficient navigation.\n\n## Additional resources\n\n### Good focus management\n\n- [Improve Accessibility in Your React App By Managing Focus in Mutable Content](https://medium.com/swlh/improve-accessibility-in-your-react-app-by-managing-focus-in-mutable-content-4ddf4ed92186)\n- [Focus management and inert](https://css-tricks.com/focus-management-and-inert/)\n- [Removing Headaches from Focus Management](https://developers.google.com/web/updates/2016/03/focus-start-point)\n- [Deep-dive: Focus management](https://github.com/github/accessibility/blob/main/docs/deep-dive-notes/2021-12-1-focus-managaement.md) (link only accessible to GitHub staff)\n\n### Related WCAG guidelines and success criteria\n\n- [2.1 Keyboard Accessible](https://www.w3.org/TR/WCAG21/#keyboard-accessible)\n- [2.4 Navigable](https://www.w3.org/TR/WCAG21/#navigable)\n- [2.4.3 Focus Order](https://www.w3.org/TR/WCAG21/#focus-order)\n- [2.4.7 Focus Visible](https://www.w3.org/TR/WCAG21/#focus-visible)\n","parent":{"relativeDirectory":"guides/accessibility","name":"focus-management"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/guidelines.mdx","frontmatter":{"title":"Accessibility guidelines"},"rawBody":"---\ntitle: Accessibility guidelines\ndescription: Basic guidelines for designers when creating or updating features.\n---\n\nimport Code from '@primer/gatsby-theme-doctocat/src/components/code'\n\nFor official guidance, always refer to the [WCAG 2.1 W3C documentation](https://www.w3.org/TR/WCAG21/). You can find failure examples for each WCAG standard, and techniques for fixing them in [How to Meet WCAG (Quick Reference)](https://www.w3.org/WAI/WCAG21/quickref/?versions=2.1&showtechniques=148&currentsidebar=%23col_customize#visual-presentation).\n\n## It starts with you\n\nAccessible experiences start with designers. Tacking on accessibility after a design is implemented costs businesses time and money, and it muddies the original design, leading to a poor user experience for people with and without disabilities.\n\nWhen we consider accessibility from the beginning, we design for everyone from the start.\n\nConsider how different people will experience your design. For an informative list on real-life disability situations, check [An Alphabet of Accessibility Issues](https://the-pastry-box-project.net/anne-gibson/2014-july-31), published in The Pastry Box Project.\n\n## Feature checklist\n\nIf you're designing a feature or experience in GitHub, use the following checklist to assess your design for accessibility:\n\n- [ ] Have you annotated the headings on your feature?\n- [ ] Have you defined the focus/tabbing order on your feature?\n- [ ] Have you added screen reader labels for elements that are not focusable? (Dynamic content changes, images and their alt text)\n- [ ] If this is a new page outside the GitHub monolith, are the landmarks annotated?\n- [ ] Does the text meet color contrast?\n- [ ] Do graphic objects meet color contrast?\n- [ ] With color removed, can you still understand the design?\n- [ ] Can all revealable information (hover card, tooltips, accordions) be accessed with a keyboard or a mouse?\n- [ ] If the user increases the text size to 200%, is the page still usable?\n- [ ] When the screen reduces in size (down to 320px wide), is everything usable without scrolling horizontally? (There are a few exceptions to this rule: check [1.4.10 - Reflow](https://www.w3.org/WAI/WCAG21/Understanding/reflow.html) for details)\n\n## Basic visual considerations\n\nWCAG 2.1 includes more nuanced considerations than what is listed here, but these basic considerations will give you a strong foothold into accessible design.\n\n### Color\n\n#### Contrast\n\nText and user interface components on a page must meet a specific minimum contrast ratio to pass WCAG 2.1 AA standards.\n\n**Why?** People with low vision may have trouble reading or understanding important information. Depending on the contrast ratio, users may not see the item at all. Besides being perceived as disabled items, this makes users struggle with actions like making sure they select the correct option.\n\n<DoDontContainer stacked>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/102424769-bc476b80-3fc0-11eb-9831-c229ada406c0.png\"\n      alt=\"\"\n    />\n    <Caption>Buttons with sufficient text contrast</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/102424747-afc31300-3fc0-11eb-9e98-ecd806f6e266.png\"\n      alt=\"\"\n    />\n    <Caption>Buttons with insufficient text contrast</Caption>\n  </Dont>\n</DoDontContainer>\n\n- **Normal text (14pt)**: 4.5:1 minimum contrast\n- **Large text (14pt bold + , 18pt +)**: 3:1 minimum contrast\n- **Graphical objects and user interface components**: 3:1 minimum contrast\n\n**Note:** Disabled controls do not need to hit any specific contrast levels.\n\nOfficial WCAG guidelines:\n\n- [1.4.3 - Contrast (Minimum)(Level AA)](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html)\n- [1.4.11 - Non-text Contrast (Level AA)](https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html)\n- [1.4.1 - Use of color (Level AA)](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-without-color.html)\n\n#### Use of color\n\nThe main point in the guideline [1.4.1 Use of Color](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-without-color.html) is to make sure that color isn't the sole identifier. If you have an important transition that is only a change in color, make sure that color change has a 3:1 contrast ratio.\n\nA great way to test for this is to navigate that experience in greyscale mode.\n\n<DoDontContainer stacked>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/102531800-cb2d2d00-4057-11eb-8372-ef42011d3e0a.png\"\n      alt=\"\"\n    />\n    <Caption>Use color and a different shape to indicate issue status</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/102531791-c4061f00-4057-11eb-955f-82e511b663d5.png\"\n      alt=\"\"\n    />\n    <Caption>Don't use only color to indicate issue status</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Typography\n\n#### Links\n\nAssistive technology users will frequently browse a list of links for easy navigation. For this reason, make sure that the link text is meaningful and unique. There should be as few duplicated references as possible to prevent confusion.\n\nFor more detail on accessible links, read the W3C's [Understanding 2.4.4 - Link Purpose](https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-in-context.html).\n\n<DoDontContainer stacked>\n  <Do>\n    <Code className=\"language-html\">\n      {`<p>\n  Find out more about <a href=\"#url\">GitHub Enterprise pricing</a>.<br />\n</p>`}\n    </Code>\n    <Caption>Make links meaningful and easy to understand</Caption>\n  </Do>\n  <Dont>\n    <Code className=\"language-html\">\n      {`<p>\n  To find out more about GitHub Enterprise pricing,\n  <a href=\"#url\">click here</a>.\n</p>`}\n    </Code>\n    <Caption>Don't create links that give no indication to the user</Caption>\n  </Dont>\n</DoDontContainer>\n\n#### Forms\n\n- All form inputs should have a visible label\n- Don't use placeholder text for titles, hints, or other important information.\n\n**Why?** Visible labels determine the purpose for inputs, and screen readers can read this information without extra code. If placeholder text contains important information and that information disappears when one starts to type, those with cognitive disabilities will have difficulty completing the form.\n\n#### Content on hover or focus\n\nHover cards and tool tips need to be approached with care. To meet the bare minimum for accessibility, tooltips need to be:\n\n- **Dismissible**: Be able to dismiss tooltips without moving the pointer or keyboard focus (unless it's an input error or does not cover other content).\n- **Hoverable**: Pointer can move over the hover content without the content disappearing.\n- **Persistent**: The tooltip doesn't dismiss itself without user action.\n\nFor more information read [1.4.13 Content on Hover or Focus](https://www.w3.org/WAI/WCAG21/Understanding/content-on-hover-or-focus.html).\n\n#### Text\n\nPeople using the web should be able to increase font size to 200% without losing content or functionality.\n\nIf you'd like to go the extra mile and meet AAA guidelines, you can make sure that:\n\n- The width of text doesn't exceed 80 characters or glyphs\n- Text isn't justified (align text to the left and right)\n\nRead Primer's [typography](/foundations/typography) guidelines for more detail about using type on GitHub.\n\n## Keyboard accessibility\n\nAll interactive elements need to be accessed and activated by a keyboard alone ([2.1 Keyboard Accessible](https://www.w3.org/TR/WCAG21/#keyboard-accessible)).\n\n- Tabbing should be used to access standalone controls (buttons, links, widgets), and arrow keys should be used to navigate within a composite control (group of standalone controls, list of checkboxes).\n- Some assistive technologies have keyboard combinations that override those of a web page, so don't rely on keyboard shortcuts as the only alternative to mouse actions.\n- Focus must be visible for all interactive elements. [Read more about focus management](/guides/accessibility/focus-management)\n\n## Resources\n\n### Understanding WCAG 2.1\n\n- [Knowbility.org](https://knowbility.org/search/?q=WCAG+2.1): Search for 'WCAG 2.1' on Knowbility to get a more clear and succinct interpretation of WCAG 2.1's official guidance.\n- The UK's Home Office designed [easy-to-read posters](https://github.com/UKHomeOffice/posters/blob/master/accessibility/dos-donts/posters_en-UK/accessibility-posters-set.pdf) on designing for accessibility, broken out into principles for various conditions. You can read about [designing the posters](https://accessibility.blog.gov.uk/2016/09/02/dos-and-donts-on-designing-for-accessibility/) on the team's accessibility blog.\n- The [a11yproject](https://www.a11yproject.com/resources/) includes a wealth of resources on web accessibility.\n\n### Pattern libraries\n\n- [WAI-ARIA Authoring Practices 1.2](https://www.w3.org/TR/wai-aria-practices-1.2/) is an in-depth list of UI patterns and how to implement them, from W3C.\n- [Inclusive components](https://inclusive-components.design/)\n- [a11ymatters patterns](https://www.a11ymatters.com/patterns) includes useful information for developers.\n\n### Screen readers\n\nTop three screen readers for computers ([data from WebAIM](https://webaim.org/projects/screenreadersurvey8/), August 2019):\n\n- NVDA (Windows)\n- JAWS (Windows)\n- VoiceOver (Mac)\n\nTop three screen readers for mobile devices ([data from WebAIM](https://webaim.org/projects/screenreadersurvey8/), August 2019):\n\n- VoiceOver (iOS)\n- TalkBack for Android (Android)\n- Voice Assistant (Android)\n\nKeep in mind that just like there are different browser implementations, there are also different assistive technologies and their behaviors can vary.\n","parent":{"relativeDirectory":"guides/accessibility","name":"guidelines"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/headings.mdx","frontmatter":{"title":"Headings"},"rawBody":"---\ntitle: Headings\ndescription: Headings play a critical role in communicating the structure of a page. Find out why they're critical and how to create an accessible hierarchy in your pages.\n---\n\n## Overview\n\nHeadings play a critical role in communicating the structure of a page. Heading levels range from `<h1>` to `<h6>`.\n\n### Best practices\n\n- Avoid skipping heading levels. `<h1>` should be followed by `<h2>` and so on.\n- Do not use heading elements solely for resizing text.\n- Avoid setting more than one `<h1>` per page. `<h1>` should be reserved to describe the page as a whole, similar to a page `<title>`. (Dialog headings are excepted from this rule.)\n\n## Why?\n\nA correct heading structure is critical for enabling users to navigate quickly within a page. Headings are by far the most common navigation technique for screen reader users.\n[67.7% of surveyed screen reader users](https://webaim.org/projects/screenreadersurvey9/#finding) responded that they are first likely to navigate via the headings when trying\nto find information on a lengthy web page. A proper heading structure also allows sighted users to visually scan and find what they want on a page quickly.\n\nAn improper heading structure can cause a confusing navigation experience.\n\n## Guidelines\n\n### For designers\n\nIn your designs, annotate the heading level. Properly labeled headings are one of the most important things a designer can do for developer handoff.\n\n### For engineers\n\nAs you're developing a page, use tools like [Accessibility Insights](https://accessibilityinsights.io/docs/en/web/overview/) and [HeadingsMap](https://chrome.google.com/webstore/detail/headingsmap/flbjommegcjonpdmenkdiocclhjacmbi/related?hl=en)\nto verify the heading structure. You may also inspect the DOM structure of your page using the browser inspector, but using an extension will surface heading levels more easily.\n\n## Examples\n\n<DoDontContainer stacked>\n  <Do>\n    <Caption>Do follow a clear heading hierarchy</Caption>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/157987874-e415dcc6-887f-4d8d-ab8a-bcdfbdad5e77.png\"\n      alt=\"A GitHub discussions page with sequential, h1, h2, h3, and h4 headings\"\n    />\n  </Do>\n  <Dont>\n    <Caption>\n      Don't use multiple h1s, skip over heading hierarchy for visual effect, or forget to label sections of information\n      with headings\n    </Caption>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/157987882-edb92d5a-1fd3-4ef6-b5bb-bd08851eacd8.png\"\n      alt=\"A GitHub discussion page with two h1 headings, which display an h3 before h2 headings\"\n    />\n  </Dont>\n</DoDontContainer>\n\n## Additional resources\n\n- [WebAIM: Headings](https://webaim.org/techniques/semanticstructure/#headings)\n- [W3: Headings](https://www.w3.org/WAI/tutorials/page-structure/headings/)\n- [Medium: Headings for the visually inclined](https://medium.com/@inkblotty/headings-for-the-visually-inclined-c537e87865f)\n\n### Related WCAG guidelines and success criteria:\n\n- [1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships)\n","parent":{"relativeDirectory":"guides/accessibility","name":"headings"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/index.mdx","frontmatter":{"title":"Accessibility"},"rawBody":"---\ntitle: Accessibility\ndescription: How to create accessible interfaces for GitHub.\n---\n\n<ChildPages of=\"Accessibility\" />\n","parent":{"relativeDirectory":"guides/accessibility","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/links.mdx","frontmatter":{"title":"Links"},"rawBody":"---\ntitle: Links\ndescription: Links help us navigate a website. Learn how to style links appropriately to keep them usable by all.\n---\n\nimport {Box} from '@primer/react'\nimport Code from '@primer/gatsby-theme-doctocat/src/components/code'\n\nimport doLinks31 from '../../../src/images/accessibility/links/do-links-3_1.png'\nimport dontLinks31 from '../../../src/images/accessibility/links/dont-links-3_1.png'\nimport doLinksIcon from '../../../src/images/accessibility/links/do-links-icon-or-shape.png'\nimport dontLinksIcon from '../../../src/images/accessibility/links/dont-links-icon-or-shape.png'\nimport doLinksUnderlined from '../../../src/images/accessibility/links/do-links-underlined.png'\nimport dontLinksUnderlined from '../../../src/images/accessibility/links/dont-links-underlined.png'\n\n## Overview\n\nLinks are user interface elements that _navigate_ you to a new place or new content. Contrast this with buttons, which are designed to _activate_ a feature.\n\n## Why?\n\nLinks can do things like help with page context, reference similar items of interest, and allow for endless connected information surfing through sites like Wikipedia. Links play a key part in your experience on the web, but without proper consideration they can be frustrating to use, skipped over, or completely unnoticed.\n\nFor screen reader assistive technology, links and buttons are expected to function differently from each other. If a link is activated and does not do what was expected, that can be disorienting and frustrating.\n\nA common way a screen reader might navigate the page is by going through a list of all the links on the page. Without context, \"read more\" or \"click here\" links are not helpful.\n\nPeople who have low or colorblind vision may have trouble identifying links that just use color to distinguish them from plain text, this is why keeping the underline styling on links within body text is important for identification.\n\n## How to test links\n\n### Functionality and purpose\n\nA link's function is to _navigate_ to a different page or new content. If instead a feature on the page is activated, use a `<button>`. [Learn when to use a link or button](https://accessibility-playbook.github.com/guidance/patterns/link-and-button-guidance).\n\nA link's purpose must be obvious from the link text alone. If you can't get an idea of where a link will take you based on the link text without reading the sourrounding text, the link text should be updated. [Learn how to write good link text](#writing-link-text).\n\nThis is important because screen readers allow users to browse through a list of links, where the link text is the only clue of where a link will take you.\n\n### Visual distinction & contrast\n\nLike normal text, a link must have a `4.5:1` contrast against the background color that it is placed on. Use a [contrast checker](https://webaim.org/resources/contrastchecker/) to validate that your link meets this required contrast.\n\nIf a link is sourrounded by text, it must be underlined or pass a `3:1` contrast against the sourrounding text as well. Alternativly an icon, a background shape or an outline can demarcate a link.\n\nSome examples of this are:\n\n- links within body text\n- a headline and subline which both are individual links\n- issue numbers or usernames within a commit line\n\n## Guidelines\n\n### For designers\n\n- Visually demarcate your links by using:\n  - the `accent.fg` color in combination with `fg.default` for the sourrounding text on any of the `canvas.[...]` colors\n  - an underline for the link text\n  - an icon before or after the link text\n  - using a background shape behind the link\n  - using a link color that has a `3:1` contrast against the sourrounding text color AND a `4.5:1` against the background color\n- Make sure a link's purpose can be understood from the link text alone, without needing the surrounding context.\n- Links should look like links, not buttons, except in rare circumstances, like calls to action.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/160483376-a88eb64f-ce80-4a11-93b5-6d882b1970eb.png\"\n      alt=\"Markdown paragraph with descriptive links\"\n    />\n    <Caption>Be descriptive with your links so that they can stand alone and be understood.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/160474793-2fd3085f-0813-43ed-8b43-c1a5f14aaea9.png\"\n      alt=\"Markdown paragraph with links like 'Click here' and 'find out more'\"\n    />\n    <Caption>Don't use generic terms like 'click here' that can't be understood out of context.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/160474794-06a75b30-06d3-475e-863f-605e8a6dad72.png\"\n      alt=\"Underlined username link in issue subheading\"\n    />\n    <Box\n      sx={{\n        marginTop: 2,\n        backgroundColor: 'neutral.subtle',\n        borderRadius: 6,\n      }}\n    >\n      <img width=\"550\" alt=\"Underlined links in paragraph\" src={doLinksUnderlined} />\n    </Box>\n    <Caption>Underline links in paragraphs and sentences</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/40274682/160474800-b505369e-1730-4c14-b426-70b5bd016a6c.png\"\n      alt=\"Issue subheader with none of the links underlined\"\n    />\n    <Box\n      sx={{\n        backgroundColor: 'neutral.subtle',\n        marginTop: 2,\n        borderRadius: 6,\n      }}\n    >\n      <img\n        width=\"550\"\n        alt=\"Links using underline to highlight important text instead of link\"\n        src={dontLinksUnderlined}\n      />\n    </Box>\n    <Caption>Don't use underlines for non-link highlights or forget to demarcate links</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <Box\n      sx={{\n        backgroundColor: 'neutral.subtle',\n        borderRadius: 6,\n      }}\n    >\n      <img\n        width=\"550\"\n        alt=\"Links using the accent color and a muted grey both with a 3:1 contrast against the default text color\"\n        src={doLinks31}\n      />\n    </Box>\n    <Caption>Use a link color that has a 3:1 contrast against the text color</Caption>\n  </Do>\n  <Dont>\n    <Box\n      sx={{\n        backgroundColor: 'neutral.subtle',\n        borderRadius: 6,\n      }}\n    >\n      <img\n        width=\"550\"\n        alt=\"Links using a color with a contrast smaller than 3:1 against the default text color\"\n        src={dontLinks31}\n      />\n    </Box>\n    <Caption>Don't use a color that has less than a 3:1 contrast against the text color for links</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <Box\n      sx={{\n        backgroundColor: 'neutral.subtle',\n        borderRadius: 6,\n      }}\n    >\n      <img width=\"550\" alt=\"Links with icon or background shape to demarcate it\" src={doLinksIcon} />\n    </Box>\n    <Caption>Use an icon or a background shape to demarcate a link</Caption>\n  </Do>\n  <Dont>\n    <Box\n      sx={{\n        backgroundColor: 'neutral.subtle',\n        borderRadius: 6,\n      }}\n    >\n      <img width=\"550\" alt=\"Links using other text styles to demaracte it\" src={dontLinksIcon} />\n    </Box>\n    <Caption>Don't use text styles like italic or bold to demarcate links</Caption>\n  </Dont>\n</DoDontContainer>\n\n### For engineers\n\n- Use Primer link components:\n  - [Link in Primer ViewComponents](https://primer.style/view-components/components/link)\n  - [Link in Primer React](https://primer.style/react/Link)\n- Don't override the link styling provided in the components\n- Make sure links receive our global focus indicator styling when navigating the page with a keyboard (reference: [Focus management](/guides/accessibility/focus-management))\n- Don't use the `title` attribute\n  - Content within a `title` is inaccessible for many users, such as touch-only and keyboard-only users. If additional content needs to be associated with a link consider using a [tooltip](https://primer.style/view-components/components/alpha/tooltip) or [alternatives to a tooltip](/guides/accessibility/tooltip-alternatives).\n- Avoid adding side effects to link click events. Links should navigate, not affect the page.\n- Don't force links to open in a new tab/window by setting the `target` property.\n- Links should always open in a new window when clicking while holding Command/Control.\n\n## Common mistakes\n\n- Only adding an underline to a link when it has focus or is hovered over\n- Underlining every link on the page. For example, a navigation list is a list of links but navigational links don't have to be underlined because the intent is understood and an underline is not needed to identify the interactive nature of the control.\n\n## Writing link text\n\nLink text should be descriptive enough to convey the destination without relying on the surrounding text. Screen reader users often tab through links on a page to quickly find content without needing to listen to the full page.\nWhen link text is too generic like \"Read more\", the destination of the link is not conveyed.\n\nIt may be acceptable in some scenarios to provide a more descriptive link text for screen reader users by setting the `aria-label`. However, this technique will result in divergence between the label and the text and is not an ideal, future-proof solution.\nWhenever possible, prefer a single descriptive link text that is available for both sighted users and screen reader users.\n\nIf you must resort to the ARIA technique to provide a descriptive link text, follow these principles:\n\n1. The visible text is included in full as part of the accessible name to avoid a violation of [SC 2.5.3: Label in Name](https://www.w3.org/WAI/WCAG21/Understanding/label-in-name.html).\n2. The sentence that the link is a part of is well-formed and grammatical when read with both the visible text and the accessible name.\n\n<DoDontContainer>\n  <Do>\n    <Caption>\n      Accessible name fully includes the visible link text, \"Learn more\" and is well-formed with either label.\n    </Caption>\n    <Code className=\"language-html\">{`There are various plans available. \n<a href=\"...\" aria-label=\"Learn more about GitHub pricing plans\">Learn more</a>`}</Code>\n    <br />\n  </Do>\n  <Dont>\n    <Caption>\n      Accessible name results in poorly-formed sentence, \"Learn more about keyboard shortcuts allow you to access common\n      commands more quickly\".{' '}\n    </Caption>\n    <Code className=\"language-html\">{`<a href=\"...\" aria-label=\"Learn more about keyboard shortcuts\">Keyboard shortcuts</a> allow you to access common commands more quickly.`}</Code>\n  </Dont>\n</DoDontContainer>\n\nAs demonstrated in the examples, this technique adds more complexity to the code and can introduce more problems than it solves so only use this technique if absolutely necessary.\n\n## Additional resources\n\n- [Color to Distinguish Links from Text](https://dequeuniversity.com/class/visual-design/color/distinguish-links-from-text) (requires a subscription to access the content)\n- [Accessibility Insights plugin](https://accessibilityinsights.io/en/): With the Accessibility Insights plugin installed, open the plugin, visit the **Assessment** option and select **7. Links**\n- [WebAIM: Links and Hypertext - Introduction to Links and Hypertext](https://webaim.org/techniques/hypertext/)\n- [erblint-github: Avoid generic link text](https://github.com/github/erblint-github/blob/main/docs/rules/accessibility/avoid-generic-link-text-counter.md)\n\n### Related WCAG guidelines and success criteria\n\n- [Understanding Success Criterion 4.1.2: Name, Role, Value](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html)\n- [Authoring Practices Guide - Links](https://www.w3.org/TR/wai-aria-practices-1.2/#link)\n- [Accessible Rich Internet Applications (WAI-ARIA) 1.2 (w3.org)](https://www.w3.org/TR/wai-aria-1.2/#link)\n- [Understanding Success Criterion 2.4.4: Link Purpose (In Context)](https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-in-context.html)\n","parent":{"relativeDirectory":"guides/accessibility","name":"links"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/semantic-html.mdx","frontmatter":{"title":"Semantic HTML"},"rawBody":"---\ntitle: Semantic HTML\ndescription: Understand when and how to use semantic HTML to improve the experience of the largest number of users possible.\n---\n\n## Overview\n\nSemantic HTML provides meaning to the content of a web page. It involves using the correct HTML element for the job. Semantic HTML breaks the page up into meaningful sections.\n\n## Why?\n\nMany groups of people benefit from properly used semantic HTML. Using the correct elements allows assistive technology to accurately convey the purpose of the content to the user. Without it, they will not be able to navigate easily. Other benefits of using semantic HTML are SEO and code readability.\n\n## How to test for semantic HTML\n\nHTML validators, automated tooling, unit tests, and linters are a few ways to test for proper HTML. Most automated tools can catch some incorrect usage of HTML elements. For example, if heading levels are out of order, it will be reported as a violation. Keep in mind that [automated tools only catch around 20-25% of accessibility errors](https://www.essentialaccessibility.com/blog/automated-accessibility-testing-tools-how-much-do-scans-catch#:~:text=For%20WCAG%202.1%20AA%20tests,by%20yes%20or%20no%20conditions.).\n\nThis is a subset of the tools available:\n\n- [HTML validator](https://validator.w3.org/)\n- Automated tools\n  - [aXe DevTools](https://www.deque.com/axe/devtools/)\n  - [Lighthouse](https://github.com/GoogleChrome/lighthouse)\n- Linting\n  - [Primer ViewComponents](https://github.com/primer/view_components/blob/main/docs/content/linting.md)\n  - [Primer React](https://github.com/primer/react/blob/main/contributor-docs/CONTRIBUTING.md#linting)\n  - [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)\n  - [erblint-github](https://github.com/github/erblint-github)\n\n## Guidelines\n\n### For designers\n\nIn your designs, annotate what HTML elements should be used for various parts of the design, if appropriate. Understand that most designs are achievable with CSS alone, agnostic of the HTML elements used.\n\n### For engineers\n\nThink about the content that will populate an element in order to determine what HTML element should be used. Are you building a navigation? Use the `<nav>` element instead of nested `<div>` elements. You may need to add interactivity to more complex elements, such as `<dialog>`. Some elements may require additional ARIA attributes to convey things such as state, but be careful to [use these only when necessary](https://www.w3.org/TR/using-aria/#notes2).\n\n## Common mistakes\n\n- Using improper elements to achieve the desired visual style\n  - Example: using an `<h1>` tag for a heading that should be an `<h3>` because the visual style of the `<h1>` is desired\n  - Solve: use CSS for visual styling\n- Using the `title` attribute\n  - It is inaccessible for many users, such as touch-only and keyboard-only users. Do not use.\n- Using improper markup\n  - Example: placing text in a `<div>` instead of a `<p>`\n  - Solve: use the proper element to depict the content that is inside\n- Using incorrect ARIA\n  - Example: using an `aria-label` on a non-interactive element such as a `<div>`\n  - Solve: only use ARIA when necessary, and if you _can_ use a native HTML element, you should. [More information on ARIA](https://www.w3.org/TR/using-aria/#notes2)\n- Duplicate IDs\n  - Example: two elements on the page with `id=\"anchor\"`\n  - Solve: use unique IDs for every element on the page\n- Decorative elements not marked as decorative\n  - Example: an `<hr>` element not being marked as decorative\n  - Solve: add `role=\"presentation\"` or `aria-hidden=\"true\"` to elements that are for decorative purposes only\n\n## Reading order\n\nScreen readers and other assistive technologies convey the information to the user in the order that it is marked up in the code, not necessarily how it looks on the page. Ensure the order matches a logical order of information presented. One way to verify this is to view the page without styles and see if the order of content is logical.\n\n## Additional resources\n\n- [Deep Dive: Semantic HTML and ARIA](https://github.com/github/accessibility/blob/main/docs/deep-dive-notes/2022-02-16-semantic-html-and-aria.md) (Only accessible to GitHub staff)\n- [List of semantic elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element)\n\n### Related WCAG guidelines and success criteria\n\n- [1.3.2 Meaningful Sequence](https://www.w3.org/TR/WCAG21/#meaningful-sequence)\n- [2.4.10 Section Headings](https://www.w3.org/TR/WCAG21/#section-headings)\n- [4.1.2 Name, Role, Value](https://www.w3.org/TR/WCAG21/#name-role-value)\n","parent":{"relativeDirectory":"guides/accessibility","name":"semantic-html"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/text-resize-and-respacing.mdx","frontmatter":{"title":"Text resize and respacing"},"rawBody":"---\ntitle: Text resize and respacing\ndescription: People on the web should be able to resize text to improve legibility without blocking or obscuring any other part of the UI.\n---\n\n## Overview\n\nUsers should be able to resize text and use custom text spacing without text being clipped, truncated, or obscured. In addition, interactive controls should not\nbreak.\n\n## Why?\n\nPeople with low-vision may rely on the browser's zoom functionality or update the font-size of a page to read content. Additionally, people with low-vision\nand people with dyslexia may increase text spacing with custom CSS to improve readability.\n\nWhen sites are built without adequate considerations around responsiveness (for example: setting fixed width and height, using non-relative font sizing), sites may become completely unreadable\nand unusable for some users.\n\n## How to test\n\n### Text resizing\n\nMost modern browsers support full-page zoom, while some also support text-only zoom (for example: Firefox). While WCAG does not specify how text should be resized, it is best practice for your\npage to be readable with full-page zoom and text-only zoom. Aside from using the browser zoom, some users may also resize text through browser font-size setting.\n\nTest your page by using browser zoom with magnification of up to 200%. Confirm that the text content does not overflow, overlap, or become truncated, and that interactive controls still work.\n\nLearn more about resize testing techniques at [TheA11yProject: Resize text](https://www.a11yproject.com/posts/resize-text/).\n\n### Text spacing\n\nModify text spacing according to the [WCAG text spacing testing guidelines](https://www.w3.org/WAI/WCAG21/Understanding/text-spacing.html). You can do this\nby changing the CSS using the browser inspector or by using a tool like [Steve Faulkner: text spacing bookmarklet](https://cdpn.io/stevef/debug/YLMqbo).\n\nConfirm that text is contained within the bounds of its container without overlapping or being cutoff.\n\n## Guidelines\n\n### For designers\n\nWhen creating a design, ensure that font sizes and element sizes are annotated with proper resizing techniques before handing it off to an engineer. There are a variety of techniques that\ncan be employed to ensure responsive text and space resizing. This includes avoiding setting fixed height on a container to allow text content to expand, and using relative units such as `em` and `rem` instead of `px`.\n\nLearn more about the techniques at: [WCAG Resize text techniques](https://www.w3.org/WAI/WCAG21/Understanding/resize-text.html#techniques) and [WCAG Text spacing techniques](https://www.w3.org/WAI/WCAG21/Understanding/text-spacing.html#techniques).\n\n### For engineers\n\nAs you're developing a feature, make sure to test the page using the resize techniques described in [How to test](#how-to-test). Ensure that [WCAG Resize text techniques](https://www.w3.org/WAI/WCAG21/Understanding/resize-text.html#techniques) and\n[WCAG Text spacing techniques](https://www.w3.org/WAI/WCAG21/Understanding/text-spacing.html#techniques) are employed.\n\n## Examples\n\n<DoDontContainer stacked>\n  <Do>\n    <Caption>Do ensure that the text does not overflow when text spacing is customized</Caption>\n    <img\n      width=\"600\"\n      alt=\"Screenshot of a GitHub issue description with adjusted text spacing. The issue description is contained within the bounds of the container even with adjusted text spacing \"\n      src=\"https://user-images.githubusercontent.com/16447748/157532517-38ae80a0-f5f8-47ec-b9fc-7d5ba5d27bd2.png\"\n    />\n  </Do>\n  <Do>\n    <Caption>\n      Do use the browser zoom functionality to verify that the page is readable and functional, and make adjustments if\n      necessary\n    </Caption>\n    <img\n      width=\"800\"\n      alt=\"Screenshot of a GitHub markdown toolbar that becomes unusable with overlapping controls at browser magnification of 200%\"\n      src=\"https://user-images.githubusercontent.com/16447748/157534278-daa67dbd-ecfb-4964-ab45-13d6037355a0.png\"\n    />\n  </Do>\n  <Dont>\n    <Caption>\n      Don't use a fixed height on text content containers. In the image below, the fixed height of the container causes\n      text to overflow out of bounds.\n    </Caption>\n    <img\n      width=\"600\"\n      alt=\"Screenshot of a GitHub issue description where the container has a fixed height, causing the authored long description to overflow out of bounds\"\n      src=\"https://user-images.githubusercontent.com/16447748/157533237-a18c1cfb-d962-4349-8cbd-a390174b4ebc.png\"\n    />\n  </Dont>\n</DoDontContainer>\n\n## Additional resources\n\n- [DigitalA11y: Understanding SC 1.4.4 Resize text](https://www.digitala11y.com/understanding-sc-1-4-4-resize-text/)\n- [DequeUniversity: 1.4.12 Text Spacing (AA)](https://dequeuniversity.com/resources/wcag2.1/1.4.12-text-spacing)\n\n### Related WCAG guidelines and success criteria\n\n- [1.4.4 Resize text](https://www.w3.org/WAI/WCAG21/Understanding/resize-text.html)\n- [1.4.12 Text spacing](https://www.w3.org/WAI/WCAG21/Understanding/text-spacing.html)\n","parent":{"relativeDirectory":"guides/accessibility","name":"text-resize-and-respacing"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/tools.mdx","frontmatter":{"title":"Accessibility tools"},"rawBody":"---\ntitle: Accessibility tools\ndescription: Tools to help you design accessible interfaces.\n---\n\nA selection of tools to help product designers design accessibly.\n\n### On testing color contrast\n\nWhen testing contrast be wary of tools that use color pickers. The picked color may differ depending on your color space settings and other factors. Always prefer direct value input.\n\n## Figma\n\n### [Accessibility sticker sheet](https://www.figma.com/file/o3Vhxw4SmBsUjeaVq3nF4y/Accessibility-Notation?node-id=0%3A1)\n\nThis Figma file includes annotations to use on your designs prior to developer hand off. These annotations let you note accessibility information like desired tab order, screen reader labels, headings, and landmarks. Pull directly from the file or turn on the accessibility annotations in your Figma assets list.\n\n![\"\"](https://user-images.githubusercontent.com/40274682/102533171-e6993780-4059-11eb-8e7c-5452070e2de0.png)\n\n### [A11y - Focus Orderer plugin](https://www.figma.com/community/plugin/731310036968334777/A11y---Focus-Orderer)\n\nSelect your elements in the desired tabbing order, add them to the plugin to get a visible layer label, and use the tab key to test the tab order from inside of Figma.\n\n**How does this help?** Instead of manually placing tab order stickers on your design, let the plugin do it for you, and you can tab through your design to see if the flow makes sense.\n\n![\"\"](https://user-images.githubusercontent.com/40274682/102416403-9dd87480-3fae-11eb-98c3-1b85046d98b7.png)\n\n### [Contrast plugin](https://www.figma.com/community/plugin/748533339900865323/Contrast)\n\nThis plugin will check the contrast of text, graphical objects, and even gradients.\n\n**How does this help?** Checking the color contrast is one of the most important steps to take as a designer. Now you can test contrast without leaving the design tool.\n\n![\"\"](https://user-images.githubusercontent.com/40274682/88444681-1c036700-cdd3-11ea-9be2-92eb651419d3.png)\n\n### [Color Blind plugin](https://www.figma.com/community/plugin/733343906244951586/Color-Blind)\n\nColor Blind allows you to view your designs in the eight different types of color vision deficiencies.\n\n![\"\"](https://user-images.githubusercontent.com/694831/103639152-3890f700-4f4e-11eb-9e7f-1fcd9582ad68.png)\n\n## System tools\n\n### [Sim Daltonism (MacOS)](https://apps.apple.com/us/app/sim-daltonism/id693112260?mt=12)\n\nFree application in the Mac App Store that can simulate various color blindness disorders.\n\n**How does this help?** When you're designing something that uses color (yes, that's everything), you can use this app to see the design as someone who has color blindness would see it, and check if it still makes sense.\n\n![\"\"](https://user-images.githubusercontent.com/40274682/88444732-5ff66c00-cdd3-11ea-97f6-350c2f5a6f32.png)\n\n### [Colour Simulations (Windows)](http://www.coloursimulations.com/)\n\nFree application for Windows that is comparable to Sim Daltonism on Mac.\n\n![\"\"](https://user-images.githubusercontent.com/40274682/103688232-5ce8d580-4f46-11eb-9b63-7a4ff7936517.png)\n\n## Web tools\n\n### [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)\n\nThe WebAIM contrast checker is the golden standard and does a good job explaining what the result means.\nAt GitHub the WebAIM contrast checker is the standard that has to be met.\n\nThere is also a [link contrast checker](https://webaim.org/resources/linkcontrastchecker/?fcolor=D9D9D9&bcolor=FFFFFF).\n\n![\"webaim contrast color checker website\"](https://user-images.githubusercontent.com/813754/188844756-2340bcbd-2630-4a5f-be4a-8796774601cc.png)\n\n### [Color Review](https://color.review/)\n\nColor review is fantastic if you're looking for help finding an accessible color in an existing palette.\n\n![\"\"](https://user-images.githubusercontent.com/40274682/88444756-90d6a100-cdd3-11ea-876c-1c850ae19223.png)\n","parent":{"relativeDirectory":"guides/accessibility","name":"tools"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/accessibility/tooltip-alternatives.mdx","frontmatter":{"title":"Tooltip alternatives"},"rawBody":"---\ntitle: Tooltip alternatives\ndescription: Most UI cases don't call for tooltips. Learn some alternative methods to use in place of tooltips.\n---\n\nimport {Box, Text} from '@primer/react'\n\n## Overview\n\nTooltips are often used to convey information. However, tooltips are rarely appropriate, and its misuse can result in a myriad of accessibility issues.\nAlways consider **not** using a tooltip for an improved user experience.\n\n## Why?\n\n- Tooltips are hidden by default making it easy to miss, so they should never be used to convey critical information.\n- Tooltips are never accessible on mobile devices.\n- Tooltips should **never** be set on non-interactive elements (for example, `div`, `span`, `p`), and should only ever be set on interactive elements (for example, `button`, `a`). Tooltips on non-interactive elements are not accessible to keyboard users and screen reader users.\n\n## Guidelines\n\n### For designers\n\n- Reserve tooltips for components like icon buttons.\n- Keep your tooltip text minimal.\n- Only include tooltips on other components as a last resort.\n- **Never** include tooltips on non-interactive components (`div`, `span`, `p`).\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      alt=\"Icon buttons with tooltips for edit, favorite, and sponsor\"\n      src=\"https://user-images.githubusercontent.com/40274682/160182083-a97ba63f-a297-4613-bb52-d4a8ef10cc10.png\"\n    />\n    <Caption>Use a tooltip to give a text label to an icon button</Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      alt=\"Non-interactive text element activating a long and wordy tooltip on hover\"\n      src=\"https://user-images.githubusercontent.com/40274682/160182084-948a7969-9c84-4c08-8801-4d8a5253b1ce.png\"\n    />\n    <Caption>Don't use tooltips on non-interactive elements</Caption>\n  </Dont>\n</DoDontContainer>\n\n<Box\n  mb={3}\n  display=\"flex\"\n  alignItems=\"flex-start\"\n  alignItems=\"center\"\n  flexDirection={['column', 'column', 'column', 'column', 'row']}\n  sx={{gap: 3}}\n>\n  <Box as=\"p\" mt=\"0\">\n    <h4>Annotations</h4>If you have an appropriate tooltip in your design, annotate the tooltip carefully with the\n    preferred type (whether it's a label or description) to ensure proper semantics.\n  </Box>\n  <img\n    width=\"456\"\n    alt=\"Mock of an icon button and its tooltip with an annotation pointing to the tooltip with 'label' text\"\n    src=\"https://user-images.githubusercontent.com/40274682/160183578-4f66e628-c207-47a4-8520-00a37e26def4.png\"\n  />\n</Box>\n\n### For developers\n\nIf you come across a design or a page with a tooltip on a static element (for example, `div`, `span`, `p`), remove it. Consult a designer for an alternative way of conveying the information.\n\nIf you determine that tooltips are appropriate for your use case, make sure to carefully follow guidelines set in [Primer ViewComponents: Tooltip component](https://primer.style/view-components/components/alpha/tooltip).\n\n## Alternatives to tooltips\n\n### 1. Persist the content\n\nIf possible, persist the content so it's always available rather than using a tooltip, which hides content by default. This ensures that the content is always discovered and surfaced to users regardless of device.\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      alt=\"Information about how many discussions can be pinned added to the confirmation dialog\"\n      src=\"https://user-images.githubusercontent.com/40274682/160192785-13764229-7c42-4fa9-b752-b2ec741d4d4a.png\"\n    />\n    <Caption>Find an appropriate permanent place to display additional information.</Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      alt=\"Information about how many discussions can be pinned within tooltip on non-interactive element\"\n      src=\"https://user-images.githubusercontent.com/40274682/160192791-2d69905a-bd1f-4508-9c0a-9e968b6d4ac3.png\"\n    />\n    <Caption>Don't use a tooltip to add additional helpful information</Caption>\n  </Dont>\n</DoDontContainer>\n\n### 2. Don't duplicate content\n\nIf the tooltip duplicates content that is already available on the page, remove it.\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      alt=\"Pointer hovering over a link with no tooltip\"\n      src=\"https://user-images.githubusercontent.com/40274682/160201665-0f3bf527-fef7-4d79-b81b-af194385be5d.png\"\n    />\n    <Caption>Remove any duplicate tooltip text.</Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      alt=\"Screenshot of tooltip with GitHub username, @inkblotty, on a static span that says @inkblotty\"\n      src=\"https://user-images.githubusercontent.com/40274682/160201667-d90e076d-7441-45f4-b0b6-620693921105.png\"\n    />\n    <Caption>Don't set tooltips that duplicate the trigger element content.</Caption>\n  </Dont>\n</DoDontContainer>\n\n### 3. Use a modal\n\nConsider using a modal, which is accessible for mobile users and allows you to structure content that may otherwise be crammed into a tooltip.\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"456\"\n      alt=\"Screenshot of GitHub Actions page with a modal that conveys workflow file information about a runner\"\n      src=\"https://user-images.githubusercontent.com/40274682/160210527-2319e408-d433-407f-aac2-66eaf9e63246.png\"\n    />\n    <Caption>Do use a pattern that is accessible to a larger number of users such as a modal</Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"456\"\n      alt=\"Screenshot of GitHub Actions page using a tooltip on a static element to convey long workflow file information\"\n      src=\"https://user-images.githubusercontent.com/40274682/160210534-52361d76-8dad-480e-b7a8-eb9332370a53.png\"\n    />\n    <Caption>Don't place long content inside a tooltip</Caption>\n  </Dont>\n</DoDontContainer>\n\n### 4. Use a summary disclosure\n\nConsider using a summary disclosure that is accessible for mobile users and also offers the ability to show or hide content.\n\n<DoDontContainer>\n  <Do>\n    <img\n      width=\"800\"\n      alt=\"Screenshot of GitHub pricing page that uses a summary disclosure to hide and show additional information on each point\"\n      src=\"https://user-images.githubusercontent.com/40274682/160211684-6c102dd6-4039-4c7b-8c52-eeeb71a27db5.png\"\n    />\n    <Caption>Do use a pattern that is accessible to a larger number of users such as a summary disclosure</Caption>\n  </Do>\n  <Dont>\n    <img\n      width=\"800\"\n      alt=\"Screenshot of GitHub pricing page using a tooltip to hide and show long descriptions on each point\"\n      src=\"https://user-images.githubusercontent.com/40274682/160211686-c0cc0dd5-8659-4e72-b9dd-d60369ffa1d7.png\"\n    />\n    <Caption>Don't use tooltips on non-interactive elements</Caption>\n  </Dont>\n</DoDontContainer>\n\n### Other\n\nIf you are unsure which alternative is more suited to your scenario and need help, consult a designer or the GitHub Accessibility team (if you are GitHub staff) for advice.\n\n## Additional resources\n\n- [Your tooltips are bogus](https://heydonworks.com/article/your-tooltips-are-bogus/)\n- [erb lint rule: NoAriaLabelMisuseCounter](https://github.com/github/erblint-github/blob/main/docs/rules/accessibility/no-aria-label-misuse-counter.md#no-aria-label-misuse-counter)\n","parent":{"relativeDirectory":"guides/accessibility","name":"tooltip-alternatives"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/contribute/content.mdx","frontmatter":{"title":"Content"},"rawBody":"---\ntitle: Content\ndescription: These guidelines are specific to and focused on GitHub product interfaces.\n---\n\nimport Code from '@primer/gatsby-theme-doctocat/src/components/code'\n\nYour first port of call for general content guidelines should be [GitHub’s content guide](https://github.com/github/brand/blob/main/content.md) (link only accessible to GitHub staff), followed by the [Microsoft Style Guide](https://docs.microsoft.com/en-us/style-guide/welcome/).\n\n## UI content principles\n\nKeep the following principles in mind when creating UI content for GitHub.\n\n### 1. Keep it clear\n\nAim for a seventh-grade or below reading level. This means you should write text that is straightforward, without trying to be creative with words.\n\nThere are some useful tools you can use to test your content for simplicity and reading level:\n\n- [Grammarly](https://www.grammarly.com/)\n- [Hemingway](http://www.hemingwayapp.com/)\n- [Automatic Readability Checker](https://www.readabilityformulas.com/free-readability-formula-tests.php)\n\n### 2. Keep it consistent\n\nRefer to the same actions, sections, labels, landing pages, and so on, the same way across the product. But don’t sacrifice clarity over consistency.\n\n## Voice and tone\n\nGitHub’s voice is:\n\n- Clear but not cold\n- Conversational but not jargon-y\n- Inclusive but not disingenuous\n- Helpful but not overly-prescriptive\n\nTone is how you express personality and mood depending on the situation. GitHub’s tone is almost always **informal and positive**, with adjustments when needed depending on the channel, audience, and emotional state of the audience.\n\nYou should consider the context of when a user will read something, keeping in mind that:\n\n- Humor isn’t welcome in all situations, for example: in errors, when waiting, or when something fails.\n- Error messages should be understandable by humans.\n\nRead more about GitHub’s [voice and tone in the content guide](https://github.com/github/brand/blob/main/content.md#voice-and-tone) (link only accessible to GitHub staff).\n\n## Top 10 rules\n\nIf you’re in a hurry, these are the most important content guidelines to keep in mind, in no particular order.\n\n- Write in plain English, don’t sound like a robot.\n- Be brief, remove unnecessary words like adjectives and adverbs.\n- Use active voice.\n- Use sentence case, and when in doubt, don’t capitalize.\n- Always capitalize GitHub correctly.\n- Avoid gendered language.\n- Do not use slang or culturally-specific references.\n- Do not use “here” or “click here” in calls to action.\n- Be very thoughtful when introducing humor to the interface.\n- Have someone else proofread your text.\n\n## Content guidelines\n\n### Acronyms and abbreviations\n\nUse acronyms when they are more widely used than the spelled out term.\n\n“Pull request” should never be abbreviated. It’s always lowercase unless it’s starting a sentence.\n\n<!-- TODO: Where do we abbreviate? Months -->\n\n<!--\n### Alternative text\nTODO: In which cases should the UI include alternative text that doesn’t come for free with Primer.\n\nDo not replace text with emojis.\n-->\n\n### Dates and time\n\nWhen referring to times, use am and pm, and not any other variation (a.m., A.M., AM).\n\n<!-- TODO: Dates. -->\n\n### Emojis\n\nAvoid using emojis, but when you do:\n\n- Use them only at the end of a sentence\n- Use only well-recognized emojis\n- Do not repeat emojis\n- Use emojis that will work well in both dark and light modes\n\n<!-- See also alternative text. -->\n\n### Error messages\n\nBe friendly and helpful, and avoid jargon. Do not blame the user.\n\n<DoDontContainer>\n  <Do indented>\n    <em>Enter a name</em><br />\n    <em>Your name must be between 2 and 20 characters</em>\n  </Do>\n  <Dont indented>\n    <em>Error 1234567890</em><br />\n    <em>You forgot to add your name</em>\n  </Dont>\n</DoDontContainer>\n\nBe specific.\n\n<DoDontContainer>\n  <Do indented>\n    <em>Enter a credit card number</em>\n  </Do>\n  <Dont indented>\n    <em>Field required</em>\n  </Dont>\n</DoDontContainer>\n\nIn most cases, apologizing won't fix the problem. As a rule, do not apologize too much in any situation in the UI.\n\n<DoDontContainer>\n  <Do indented>\n    <em>All checks failed</em>\n  </Do>\n  <Dont indented>\n    <em>Sorry, all checks failed</em>\n  </Dont>\n</DoDontContainer>\n\nDo not try to be funny or humorous.\n\n<DoDontContainer>\n  <Do indented>\n    <em>Some checks failed</em>\n  </Do>\n  <Dont indented>\n    <em>Oops, some checks failed</em>\n  </Dont>\n</DoDontContainer>\n\n\n### Feedback\n\nFeedback should be clear and reassuring, using the same terms used by the UI elements that triggered it. Don't try to be funny, and avoid jargon.\n\n<DoDontContainer>\n  <Do indented>\n    <em>Issue transfer in progress</em><br /><br />\n    Feedback message when transferring an issue, using the same term (\"transfer\") as the trigger button\n  </Do>\n  <Dont indented>\n    <em>Moving the issue</em><br /><br />\n    Feedback message that uses a different term (\"moving\") than the trigger button\n  </Dont>\n</DoDontContainer>\n\n<!-- TODO: More confirmation messages. Save, close, dismiss. -->\n\n### Forms\n\nUse sentence case for form titles, labels, and fields.\nDo not include colons in form labels.\n\n<!-- TODO: Error messages, form validation examples. -->\n\n### Labels and buttons\n\nAll labels and button text should be in sentence case, and not include punctuation.\n\n<DoDontContainer>\n  <Do indented>\n    <em>Save email preferences</em><br />\n    <em>1 linked pull request</em><br />\n    <em>12 days ago</em>\n  </Do>\n  <Dont indented>\n    <em>Save email preferences.</em><br />\n    <em>1 Linked pull request</em><br />\n    <em>12 Days ago</em>\n  </Dont>\n</DoDontContainer>\n\n<Note>\n  When a sentence or label starts with a number (for example, “2 references”), the number is the first word, and the\n  rest of the sentence should be in lowercase.\n</Note>\n\nAction labels should start with an imperative verb that clearly indicates what to expect.\n\n<DoDontContainer>\n  <Do indented>\n    <em>Save preferences</em>\n  </Do>\n</DoDontContainer>\n\nAction labels can be shortened to only include an adjective and a noun.\n\n<DoDontContainer>\n  <Do indented>\n    <em>New issue</em>\n  </Do>\n</DoDontContainer>\n\nUse “sign in” rather than “log in”.\n\n### Links\n\nLink text should be meaningful and unique, with as few duplicated references as possible to prevent confusion. Ideally the link itself, or, alternatively, its programmatically determined context, should provide information about where the link will take you, and help users decide whether to follow the link. Examples of programmatically determined context can be aria labels, or text within the same paragraph as the link.\n\n<DoDontContainer stacked>\n  <Do indented>\n    <em>You can find out more about our speakers at the <a href=\"https://githubuniverse.com/\" target=\"_blank\">GitHub Universe site</a></em>\n  </Do>\n</DoDontContainer>\n\nSet the context of the image link from the text within the same container.\n\n<DoDontContainer stacked>\n  <Do indented>\n    <Code className=\"language-html\">\n      {`<a href=\"/pricing\">\n   <img src=\"pricing.png\" alt=\"\">\n   Pricing information\n</a>`}\n    </Code>\n  </Do>\n</DoDontContainer>\n\nNever say “here” or “click here”.\n\n<DoDontContainer stacked>\n  <Dont indented>\n    <em>Click here to find out more about our speakers at GitHub Universe.</em>\n  </Dont>\n</DoDontContainer>\n\n<!--\n### Numbers\nTODO: Commas, truncation, rounding up or down. Do units have a space, KB, MB, etc.?\n-->\n\n### Punctuation\n\nHeadings, labels and buttons should not include punctuation. In most cases, exclamation marks are not appropriate — most things aren't _that_ exciting.\n\n<DoDontContainer>\n  <Do indented>\n    <em>No code scanning alerts found</em>\n  </Do>\n  <Dont indented>\n    <em>No code scanning alerts found!</em>\n  </Dont>\n</DoDontContainer>\n\n### References to UI\n\nWhen referring to unclickable page names and sections, write them as they appear in the interface in quotation marks.\n\n<DoDontContainer>\n  <Do indented>\n    <em>Go to the “Email notifications settings” section.</em>\n  </Do>\n</DoDontContainer>\n\nWhen referring to button or link text that a user should click on, use bold text without quotation marks. Make sure all UI references match the capitalization in the interface. If you’re writing for a mobile app experience, use “tap”, instead of “click”.\n\n<DoDontContainer>\n  <Do indented>\n    <em>Click <strong>Save</strong></em>\n  </Do>\n</DoDontContainer>\n\nWhen referring to a folder, use a code tag.\n\n<DoDontContainer>\n  <Do indented>\n\n_Open the `docs` folder._\n\n  </Do>\n</DoDontContainer>\n\n### Subject\n\nIn most instances, address the user as \"you\" and items \"owned\" by the user as \"your\" or \"yours\".\n\n<DoDontContainer>\n  <Do indented>\n    <em>Update your profile</em>\n  </Do>\n  <Dont indented>\n    <em>Update my profile</em>\n  </Dont>\n</DoDontContainer>\n\nSome exceptions exist and are usually related to legal language, such as when a user needs to agree to terms, or confirm a destructive action.\n\n<DoDontContainer>\n  <Do indented>\n    <em>I have read the Terms of Service</em><br />\n    <em>I understand, convert this issue to a discussion</em>\n  </Do>\n</DoDontContainer>\n\n<!--\n### Text truncation\nTODO: Examples of truncation: dates, large numbers, long file names.\n-->\n\n## What to avoid\n\n- Do not say that something is “easy”, “quick”, or that the user “just” needs to do something.\n- Do not capitalize common terms. Only proper nouns and product names should be capitalized.\n- Do not use emoji in UI content, or to replace words.\n- Use the word “and” instead of an ampersand or the “+” sign.\n- Do not use exclamation marks to indicate excitement, most actions aren’t.\n- Do not use the greater than and less than symbols to indicate steps in a flow.\n- Do not use semicolons: they are hard to get right and can be replaced by a period most times.\n\n## How to get help\n\nIf you need clarification and can’t find an answer in [GitHub’s content guide](https://github.com/github/brand/blob/main/content.md) (link only accessible to GitHub staff) or the [Microsoft Style Guide](https://docs.microsoft.com/en-us/style-guide/welcome/), or would like your UI content to be reviewed, please start a discussion in github/primer and someone in the team will get back to you. If your query is urgent, you can ask directly in the [#primer](https://github.slack.com/archives/CSGAVNZ19) channel.\n","parent":{"relativeDirectory":"guides/contribute","name":"content"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/contribute/design.mdx","frontmatter":{"title":"Design"},"rawBody":"---\ntitle: Design\ndescription: Guidelines for building design patterns using Primer.\n---\n\nDesign flexible, robust, and repeatable patterns that build on a set of solid foundations.\n\n## Design system foundations\n\nPrimer is the stable trusted layer. At its foundations are typography, color, spacing, and layout.\n\n➡️ [Primer design guidelines](https://primer.style/design/)\n\n## Upcoming patterns and proposals\n\nTo avoid duplicated efforts and to accommodate upcoming changes, keep up with the Primer Roadmap.\n\n➡️ [Primer Roadmap](https://github.com/orgs/github/projects/2759/views/29) (GitHub staff only)\n\n## Context and use cases\n\nWhen creating a new pattern, we advise starting with an audit of similar patterns that already exist as well as identifying opportunity areas where the new pattern can be used. Consider as many different use cases as possible. The goal is to create patterns that are flexible, reusable, and that solve concrete problems.\n\nFinally, consider where a pattern will live in the context of a system. A pattern designed for a specific context is not likely to be considered a reusable component.\n\n## Share early, and often\n\nThere are many opportunities to get feedback from Primer maintainers.\n\n**Systems designers** provide extra context and considerations for designing with system-wide considerations\n**Accessibility designers** provide context and considerations for accessible and inclusive design\n**Product designers** consider the designs in the context of their own product area and whether their specific use cases could benefit from your work\n**Design engineers** can consider how something may be implemented, what is realistic within the existing constraints, and what is unfeasible.\n\nThere are different ways you can ask for and get feedback:\n\n- (GitHub staff only) [Open an issue requesting a Primer Design Review](https://github.com/github/primer/#need-a-primer-pattern-or-octicon-)\n- (GitHub staff only) Attend Primer or Primer Accessibility open office hours\n\n## Design checklist\n\nAll design patterns for Primer Library consideration should at minimum:\n\n- [ ] **Leverage Primer**: Leverages the foundational building blocks and tools of Primer. Reuses or extends existing patterns and primitives rather than creating overrides\n  - [ ] Colors, spacing, sizes, and typographic styles from [@primer/primitives](https://github.com/primer/primitives/)\n  - [ ] All icons come from [@primer/octicons](https://github.com/primer/octicons/)\n  - [ ] Considers the criteria in the [responsive design guidelines](https://primer.style/design/foundations/responsive)\n- [ ] **Maintain high design quality:** Visually in harmony with GitHub UI and all visual elements are used are in their correct context\n- [ ] **Prioritize code as a top concern:** Designed with code quality and component API top of mind\n- [ ] **Be inclusive:** Designs follow Primer [accessibility guidelines](https://primer.style/design/guides/accessibility/guidelines) and considers a global audience\n- [ ] **Have documentation:** Design patterns are [documented](https://primer.style/design/guides/contribute/documentation) for easy adoption\n","parent":{"relativeDirectory":"guides/contribute","name":"design"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/contribute/documentation.mdx","frontmatter":{"title":"Documentation"},"rawBody":"---\ntitle: Documentation\ndescription: Primer documentation should express the voices and contributions of different people, but for it to be useful it’s important to be consistent in tone and structure. \n---\n\nPlease read and follow these guidelines carefully when writing documentation, so that as many people as possible can benefit from Primer.\n\n## Primer documentation principles\n\n### Concise but friendly\nA large proportion of readers want to find an answer that helps them complete a task, so don't waste their time with unnecessary words. That doesn't mean talking like a robot though: a sprinkling of humor is fine as long as it doesn't make the documentation harder to parse or distract from instructions.\n\n### Universally understood\nAvoid using phrases or referencing examples that are only familiar internally at GitHub. Assume readers are either members of the public or new to GitHub.\n\n### Production quality\nCode examples should promote what we'd like to see used in production. People copy and paste code examples as a starting point for building interfaces, and/or reference the guidelines for examples of correct implementation. While examples might be simpler than what we'd use in production, the code should promote best practices and follow our principles and accessibility standards.\n\n## Audience\nPrimer documentation is primarily aimed at GitHub designers and engineers at various levels of experience, but folks in other areas will also benefit from and use the guidelines.\n\n### Assumed knowledge\n\n**Do:**\n- In design docs, assume the reader knows basic design concepts and principles, such as the need for consistency, and terms such as “white space” or “scale”.\n- When referring to GitHub-specific terminology, link to a glossary of terms, or another document where the reader can learn more.\n- When referring to terms and ideas the reader may want to know more about, link to authoritative sources, such as [MDN](https://developer.mozilla.org/en-US/) and the [W3C](https://www.w3.org/).\n- In non-engineering docs, use code examples as necessary to ensure consistency and appropriate usage, but don't assume expertise in any programming language.\n\n**Don’t:**\n- Don’t assume the reader knows about internal GitHub terminology.\n\n## Voice and tone\n\n- Write as you speak, then tidy it up.\n- Write affirmative sentences wherever possible. \n- Be clear and concise. \n- Use [imperative mood](https://en.wikipedia.org/wiki/Imperative_mood), so that instructions are clear. \n- Remove unnecessary words, like adverbs, and keep sentences and paragraphs short.\n- Don’t sound like a robot or too formal.\n- Don’t use sarcasm or irony, they may not translate well.\n- Avoid double negatives.\n- Avoid using expressions like “easy”, “simply”, “quick”, “just”. \n- Avoid idioms, they can be hard to understand and translate.\n  - **Do:** “As a general rule”\n  - **Don’t:** “As a rule of thumb”\n- Don't use the passive voice to avoid using the word “you” (but remove it if unnecessary).\n  - **Do:** “Open Figma”, “Submit an issue if you find a bug”\n  - **Don’t:** “Figma can be opened”, “You can open Figma”, “If a bug is found, submit an issue”\n- Avoid the possessive \"our\", and avoid addressing Primer as \"our design system”.\n\t- **Do:** “In the Figma library…”\n\t- **Don’t:** “In our Figma library…”\n- Use \"we\" consistently to refer to the Design Systems / Infrastructure team, not to GitHub as a whole.\n\n## Grammar and usage\n\nFollow the [GitHub content guidelines](https://github.com/github/brand/blob/main/content.md) (this link is only accessible to GitHub staff), in particular:\n\n- Follow US spelling.\n  - **Do:** “Color palette”\n  - **Don’t:** “Colour palette”\n- Use sentence case for titles.\n  - **Do:** “Utility classes”\n  - **Don’t:** “Utility Classes”\n- Capitalize only [proper nouns](https://en.wikipedia.org/wiki/Proper_noun) and [product names](https://github.com/github/brand/blob/main/content.md#products-ecosystem-and-programs) (this link is only accessible to GitHub staff).\n  - **Do:** “Open a pull request\"\n  - **Don't:** \"Open a Pull Request\"\n- Avoid positional language.\n  - **Do:** “The list that follows”\n  - **Don’t:** “The list below”\n- Use contractions.\n  - **Do:** “Don’t use this class”, “We’re happy to see you!”\n  - **Don’t:** “Do not use this class”, “We are happy to see you.”\n- Exclamation points are OK, in moderation.\n\nYou may also refer to the content style guide for GitHub docs (accessible to GitHub staff only), in specific:\n- [Keyboard shortcuts](https://github.com/github/docs-internal/blob/main/contributing/content-style-guide.md#keyboard-shortcuts)\n- [Procedural steps](https://github.com/github/docs-internal/blob/main/contributing/content-style-guide.md#procedural-steps)\n- [Titles](https://github.com/github/docs-internal/blob/main/contributing/content-style-guide.md#procedural-steps) (of articles)\n- [User interface elements](https://github.com/github/docs-internal/blob/main/contributing/content-style-guide.md#procedural-steps)\n\n## Images and other examples\n\nUse this [Figma template](https://www.figma.com/file/YQT3nlmvSdZRPBnkDXvTFk/Doctocat-content-template?node-id=0%3A1) (accessible to GitHub staff only) to create images that are consistent across Primer documentation.\n\nWhen creating images with example UI for docs make sure that:\n- All documentation examples should be of real github.com examples\n- Examples only include the most important part of the UI, and don't try to show the entire UI\n- Use meaningful copy (for example, use \"New issue\" instead of \"Button\" as the text inside a button)\n\n## References\n\n- If mentioning or referring to other styles and documentation, always link to the source.\n- Reference an existing guide by linking to it, rather than duplicating the content. However, if this makes the documentation harder to follow, consider providing that reference in the document itself (for example: spacing scale, abbreviations).\n\n## Publishing checklist\n\n- Spellcheck text with an automated tool\n- Spellcheck UI text in image examples\n- Ask someone else to proofread the document including images - they may catch something you missed\n- Test all the links\n  - Indicate links that only work for GitHub staff (for example, \"for GitHub staff only\", or \"only accessible to GitHub staff\")\n- Verify there isn’t any private or sensitive information\n- Verify that all images include an alt text\n\n## Documenting components\n\nWhen documenting components, consider the core elements needed to convey its main purpose and proper usage within the UI.\n\nSee our full [documentation guidelines here](https://primer.style/contribute/documentation/).\n\n### Documentation preferences\n\n- Use sentence case when referring to component names. Do not capitalize the component in the middle of a sentence.\n  - **Do:** It's recommended to always show a heading to give users a permanent description of the comment box.\n  - **Don't:** It's recommended to always show a heading to give users a permanent description of the Comment box.\n\n- When writing the component description, introduce the component directly, without \"a\" or \"an\":\n  - **Do:** Action menu is a component based on action list for creating a menu of actions that expands through a trigger button.\n  - **Don't:** An action menu is a component based on action list for creating a menu of actions that expands through a trigger button.\n\n### Component documentation structure\n\n#### Description\n\nThe description appears directly under the title of the component. It may be automatically pulled from component-metadata, and can be edited as needed.\n\n- What is this component, and how would you describe it to someone who has never used it before? This description should be concise and shouldn't include usage information, which is covered below this section.\n\n#### Usage\n\n- When to use this component\n- Best practices\n- Do/Don't examples\n\n#### Anatomy\n\n- Describe the elements that make up the component, including typography, spacing, and styles. This can also include sub components, if there are any. See [Action list](/components/action-list#anatomy) as an example.\n\n#### Options\n\n- Different sizes, typography options, layout variations, spacing, etc.\n- Different applications of the component in context\n\n#### Interactions\n\n- If there are specific behaviors or interactions that the consumer of this documentation should be aware of, it's important to document here. Is it clickable, or static, and does it have any specific interactions based on state? Are there multiple types of behavior, and when does each get applied? See [Autocomplete](/components/autocomplete#sort-and-filter-behavior) as an example.\n\n#### Accessibility\n\n- Any component-specific accessibility considerations should be documented. This could include keyboard navigation, touch targets, and any specific usage guidelines with regards to assistive technology. See [Segmented control](/components/segmented-control#accessibility).\n\n#### Related components and patterns\n\n## Review process\n\nAll pull requests for new and updated guidelines should be reviewed and approved by a member of the Design Infrastructure team. \n\n## Resources\n\n- [Docs writing tips video](https://github.rewatch.com/video/o73hl5dh5hntp3xc-primer-docs-writing-tips) (only accessible to GitHub staff)\n- [Design guidelines template](https://github.com/primer/design/blob/master/CONTRIBUTING.md#design-guidelines-template)\n","parent":{"relativeDirectory":"guides/contribute","name":"documentation"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/contribute/how-to-contribute.mdx","frontmatter":{"title":"How to contribute"},"rawBody":"---\ntitle: How to contribute\ndescription: Contributions to Primer can take many different formats to align with your skills and available time.\n---\n\nThere are several ways you can contribute to and participate in Primer:\n\n1. Participate in discussions\n2. Propose a new UI pattern\n3. Improve the documentation\n4. Design or build new patterns\n5. Give us feedback and report bugs\n6. Contribute to our open source repos\n\nAll contributions to Primer need to follow our [code of conduct](https://github.com/github/primer/blob/main/CODE_OF_CONDUCT.md).\n\nIf at any time you get stuck or need help, head to #primer on Slack or start a discussion in github/primer with your question.\n\n<Note>Please note that at this time, we are not looking for external contributions from non-GitHub staff. Some of the links included in these documents are only available to GitHub staff.</Note>\n\n## Participate in discussions\n\nIf you have a question, feedback or suggestion, you can start a new [discussion](https://github.com/github/primer/discussions) (GitHub staff only), or have a look at existing ones.\n\nPrimer office hours are held once a week and anyone at GitHub can join, ask questions and participate in ongoing conversations. The office hours Zoom invite links are posted in Slack before the meeting starts.\n\n## Propose a new UI pattern\n\nIf you'd like to propose a new Primer pattern, big or small, let's talk! The best way to get started, especially if your proposal is in its early stages, is to start a new [discussion](https://github.com/github/primer/discussions) (GitHub staff only).\n\nIf you're more certain about what you need, please open a [pattern request issue](https://github.com/github/primer/issues/new?assignees=&labels=type%3A+request&template=0-request.md&title=%5BRequest%5D+) (GitHub staff only). We will get back to you after our weekly backlog triaging session.\n\n## Improve the documentation\n\nDocumentation is a core part of Primer, and, just as design and code, we’re always trying to make it better and more useful. If you notice something missing, a typo, or have an idea of how the docs can be improved, please start a new [discussion](https://github.com/github/primer/discussions), or submit a pull request with a fix (you can do this directly via the “Edit this page on GitHub” link on the footer of docs pages).\n\nRead the Primer guidelines for [writing documentation](https://primer.style/contribute/documentation).\n\n## Design or build new patterns\n\nYou can contribute to new patterns either by design, prototype and build proofs of concept, test in dotcom, or directly to our Primer open source repos.\n\nPlease read the [guidelines on designing Primer patterns](https://primer.style/contribute/design).\n\nFrom the [Primer project board](https://github.com/orgs/github/projects/2759) (GitHub staff only), you can grab anything from **Unprioritized backlog** and **Up next** — just reach out to us first in Slack or the issue itself.\n\n## Give us feedback and report bugs\n\nIf you spot something that doesn’t look right in our design, code or documentation, open an issue and we'll triage it accordingly.\n\n## Contribute to our open source repos\n\nWhen contributing to Primer open source repos, please follow the repo's contributing guidelines:\n\n- [Primer CSS](https://github.com/primer/css/blob/main/CONTRIBUTING.md)\n- [Primer React](https://github.com/primer/react/blob/main/contributor-docs/CONTRIBUTING.md)\n- [Primer ViewComponents](https://primer.style/view-components/contributing)\n- [Octicons](https://github.com/primer/octicons/blob/main/CONTRIBUTING.md)\n","parent":{"relativeDirectory":"guides/contribute","name":"how-to-contribute"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/contribute/index.mdx","frontmatter":{"title":"Contribution guidelines"},"rawBody":"---\ntitle: Contribution guidelines\n---\n\nIf you're interested in contributing to Primer, you can find all the information you need here, including:\n\n- [How to contribute](/guides/contribute/how-to-contribute)\n- [Design contributions](/guides/contribute/design)\n- [Writing UI content](/guides/contribute/content)\n- [Writing documentation](/guides/contribute/documentation)\n\nFor contribution guidelines for specific Primer implementations, please go to its respective repository:\n\n- [Primer React contribution guidelines](https://github.com/primer/react/blob/main/contributor-docs/CONTRIBUTING.md)\n- [Primer ViewComponents contribution guidelines](https://primer.style/view-components/contributing)\n\n<Note>\n  Please note that at this time, we are not looking for external contributions from non-GitHub staff. Some of the links\n  included in these documents are only available to GitHub staff.\n</Note>\n","parent":{"relativeDirectory":"guides/contribute","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/development/index.mdx","frontmatter":{"title":"Development"},"rawBody":"---\ntitle: Development\ndescription: Learn how to build with Primer.\n---\n\n<ChildPages of=\"Development\" />\n","parent":{"relativeDirectory":"guides/development","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/development/react.mdx","frontmatter":{"title":"React"},"rawBody":"---\ntitle: React\ndescription: Get started using Primer React components in your React application.\nsource: https://github.com/primer/react\n---\n\n## Getting started\n\n1. Install `@primer/react` and its peer dependencies:\n\n   ```bash\n   npm install @primer/react react react-dom styled-components\n   ```\n\n2. Wrap the root of your application with `ThemeProvider` and `BaseStyles`:\n\n   ```jsx\n   import {ThemeProvider, BaseStyles} from '@primer/react'\n\n   function App() {\n     return (\n       <ThemeProvider>\n         <BaseStyles>\n           <div>...</div>\n         </BaseStyles>\n       </ThemeProvider>\n     )\n   }\n   ```\n\n3. Import components from `@primer/react` and use them in your application:\n\n   ```jsx\n   import {Button} from '@primer/react'\n\n   function MyComponent() {\n     return <Button>Click me</Button>\n   }\n   ```\n\n## More information\n\nSee the [primer/react repository](https://github.com/primer/react/tree/main/docs/content) for more information about how to use and contribute to Primer React. For component-specific documentation, check out the React section of component guidelines (example: [ActionList](/components/action-list/react)).\n","parent":{"relativeDirectory":"guides/development","name":"react"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/figma/contribute.mdx","frontmatter":{"title":"How to contribute"},"rawBody":"---\ntitle: How to contribute\ndescription: We love contributions and are happy to support you.\n---\n\nimport createBranchImg from '../../../src/images/figma/create-branch.png'\nimport createBranchDialogImg from '../../../src/images/figma/create-branch-dialog.png'\nimport requestReviewImg from '../../../src/images/figma/request-review.png'\nimport mergeDialogImg from '../../../src/images/figma/merge-dialog.png'\nimport requestDialogImg from '../../../src/images/figma/request-dialog.png'\n\n\n## How can you contribute\n\nCurrently only **GitHub employees** can contribute to **Primer Web**, due to how Figma handles open source files. \nTo make changes you first need to [create a branch](https://www.youtube.com/watch?v=tbNCGEC2G1E) from Primer Web and name it `@username/changes-being-made`. \nFor example: `@lukasoppermann/update-button-radius`.\n\nWhen you are satisfied with the changes you made, request a review from the [direct responsible individual](https://github.com/primer/figma/blob/main/CONTRIBUTION.md#contribute-new-components-or-updates) (DRI) of the file. If you are not sure who that is, reach out in the #primer-figma slack channel.\n\nOnce your branch is approved, a maintainer will take care of merging and publishing the changes to the library.\n\nWe use this process to make sure no accidental changes get added to the library. It also allows us to better track changes added by a branch. Think of it as a repo that does not allow direct pushes to the main branch.\n\n<ImageBox caption=\"Select “Create branch...” from the dropdown or via the command palette\">\n  <img\n    width=\"410\"\n    alt=\"Screenshot showing how to create a branch in figma\"\n    src={createBranchImg}\n  />\n</ImageBox>\n\n<ImageBox caption=\"Name your branch “@username/changes-being-made”\" paddingX>\n  <img\n    width=\"293\"\n    alt=\"Screenshot showing the create branch dialog in figma\"\n    src={createBranchDialogImg}\n  />\n</ImageBox>\n\n<ImageBox caption=\"When you are done request a review to get your changes merged.\">\n  <img\n    width=\"730\"\n    alt=\"Screenshot showing the request review option in figma\"\n    src={requestReviewImg}\n  />\n</ImageBox>\n\n<ImageBox caption=\"Select the DRI for the file to review. Reach out in the internal #primer-figma channel if you are not sure who to add.\" paddingX>\n  <img\n    width=\"568\"\n    alt=\"Screenshot showing the merge dialog in figma\"\n    src={mergeDialogImg}\n  />\n</ImageBox>\n\n<ImageBox caption=\"Add a detailed message describe what you changed and why.\" paddingX>\n  <img\n    width=\"506\"\n    alt=\"Screenshot showing the request review text dialog in figma\"\n    src={requestDialogImg}\n  />\n</ImageBox>\n","parent":{"relativeDirectory":"guides/figma","name":"contribute"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/figma/getting-started.mdx","frontmatter":{"title":"Getting started"},"rawBody":"---\ntitle: Getting started\n---\nimport {LinkExternalIcon} from '@primer/octicons-react'\n\n## What are Primer Figma libraries?\nThe Primer Figma libraries contain UI components and design tokens (styles) that our teams at GitHub use to design GitHub. The components contained within Primer match what is available for developers in Primer React Components, Primer ViewComponents, and Primer CSS.\n\n## Installation\nTo use a library in Figma enable (install) it from the **assets** tab (`option` + `2`).\nYou can also directly open the *team library* view via the command palette or with the shortcut `option` + `cmd` + `o`.\n\n<ImageBox caption=\"Navigate to the assets tab in the left sidebar and press the book icon to open the libraries overview.\">\n  <img\n    width=\"490\"\n    alt=\"Screenshot showing the assets tab in figma\"\n    src=\"https://user-images.githubusercontent.com/813754/221525999-d0278cec-d79c-40fc-8150-532f97549dc8.png\"\n  />\n</ImageBox>\n\n<ImageBox caption=\"Enable all libraries you need in your file.\">\n  <img\n    width=\"443\"\n    alt=\"Screenshot showing the library overview in figma\"\n    src=\"https://user-images.githubusercontent.com/813754/221527802-76638b6b-be81-4c87-b3e8-63d543537a9c.png\"\n  />\n</ImageBox>\n\n\n## Understanding styles\nFigma libraries like `Primer Primitives` install styles for you to use. In contrast to *local styles* they don't show up in the sidebar.\nHowever once you open a selection to choose a color style, text style, etc. you will see the styles from team libraries as well.\n\nTo quickly find a style you can use the search box. E.g. use `accent` to bring up all accent colors.\n\n<ImageBox caption=\"Color style selector and color style selector with search for 'accent'\">\n  <img\n    width=\"443\"\n    alt=\"Screenshot showing the style selector in figma\"\n    src=\"https://user-images.githubusercontent.com/813754/221531315-605cba02-de29-4834-a01b-ef8dc391fe21.png\"\n  />\n</ImageBox>\n\n<a href=\"https://help.figma.com/hc/en-us/articles/360039238753-Styles-in-Figma\">Learn more about Figma styles <LinkExternalIcon /></a>\n\n## Understanding components\nAt GitHub, we have created a [set of guidelines](https://github.com/primer/figma/blob/main/docs/authoring-components.md) that contributors and maintainers can reference when creating and updating components.\n\nComponents in our libraries have been built to be easy to understand for consumers. When possible try to keep components small and simple. Avoid advanced methods/tricks if possible. \n\n### Variants and component properties\nTo make components dynamic, we favor [component properties <LinkExternalIcon />](https://help.figma.com/hc/en-us/articles/5579474826519-Explore-component-properties) over nesting, so users don't have to override parts of a component manually. \n\nWhenever possible use components as they are without *detaching*.\n\n<a href=\"https://help.figma.com/hc/en-us/articles/360038662654-Guide-to-components-in-Figma\">Learn more about Figma components <LinkExternalIcon /></a>\n","parent":{"relativeDirectory":"guides/figma","name":"getting-started"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/guides/figma/index.mdx","frontmatter":{"title":"Figma"},"rawBody":"---\ntitle: Figma\ndescription: Getting started with Figma for GitHub.\n---\n\nimport {Box} from '@primer/react'\n\n<ImageBox caption=\"Primer is a part of the Figma community and can be found using its Figma handle of @primer\">\n  <img\n    width=\"656\"\n    alt=\"Screenshot of the Primer profile within the Figma community\"\n    src=\"https://user-images.githubusercontent.com/10384315/93832644-3028e080-fc2b-11ea-88d1-a7515c04fe39.png\"\n  />\n</ImageBox>\n\nDesign teams at GitHub use Figma as the single source of truth, collaboration, and exploration. Access to the GitHub Figma organization is currently only available to members of the GitHub team. Public access to any shared libraries and files is available from the [Primer Figma Community page](https://www.figma.com/@primer).\n\n## Team libraries\n\nGitHub's uses Figma to distribute Primer through team libraries. Each library covers a different part of the system, allowing a designer to only use what's needed. Any team within GitHub's Figma organization can create and distribute their own team/project specific libraries, but all of the core asset libraries for Primer can be found in the Primer team's \"[Core libraries (internal)](https://www.figma.com/files/797266083973274396/project/8172024/Core-libraries)\" project or the [primer community page](https://www.figma.com/@primer). They include the following:\n\n- Primer Primitives ([internal](https://www.figma.com/file/B5XPE8IwGPIZDAvN7jqWqx/Primer-Primitives) | [community](https://www.figma.com/community/file/854766928300977832)): All of the color, type, and spacing styles used within Primer.\n- Primer Web ([internal](https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=1406%3A0&t=kY6ZvRffnaGOaUib-1) | [community](https://www.figma.com/community/file/854767373644076713)): UI components used to design for GitHub's web interfaces.\n- [Primer Mobile (internal only)](https://www.figma.com/file/csCViryWkkXwBsK1aLrO0X/Primer-Mobile): UI components used to design for GitHub's native mobile platforms.\n- [Octicons](https://www.figma.com/community/file/809920999413919915): GitHub's custom icon library.\n\n## Interface templates\n\n<ImageBox caption=\"Example templates from Primer Interfaces and Primer Email\">\n  <img\n    width=\"656\"\n    alt=\"screenshot of repo home page and email template\"\n    src=\"https://user-images.githubusercontent.com/10384315/93832849-d1b03200-fc2b-11ea-98ff-685f22236f6f.png\"\n  />\n</ImageBox>\n\nIn addition to asset libraries for components and styles, you can also use template libraries to jump-start the design process.\n\n- [Primer Interfaces](https://www.figma.com/file/Y2xJLFBrU7yyiDLlEkQXcF/Primer-Interfaces): Templates for common views and UI patterns found within GitHub's web product.\n- [Primer Email](https://www.figma.com/file/MZM32u6Q80DOvOGlDCNIyc/Primer-Email): Templates used to design product emails for GitHub.\n\n## Support\n\nGitHub's Figma organization is currently maintained by GitHub's Design Infrastructure team. For any questions or comments please reach out to us either in our Slack [#primer-figma](https://github.slack.com/archives/C049REXSRBQ) channel or by submitting an issue in the [github/primer repo](https://github.com/github/primer/issues/new/choose).\n\nFor additional support specific to Figma, please reference the [Figma Help Center](https://help.figma.com/hc/en-us).\n","parent":{"relativeDirectory":"guides/figma","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/native/cli/components.mdx","frontmatter":{"title":"Components"},"rawBody":"---\ntitle: Components\ndescription: Design guidance on how we format content in in the Terminal through text formatting, color and font weights.\n---\n\nimport {DoDontContainer, Do, Dont, Caption} from '@primer/gatsby-theme-doctocat'\n\n## Syntax\n\nWe show meaning or objects through syntax such as angled brackets, square brackets, curly brackets, parenthesis, and color.\n\n### Branches\n\nDisplay branch names in brackets and/or cyan\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497467-7cf94a73-4b35-4352-81a4-a6c00d1f3486.png\"\n  alt=\"A branch name in brackets and cyan\"\n/>\n\n### Labels\n\nDisplay labels in parenthesis and/or gray\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497505-182904ee-019e-41c9-825f-cf21ecbabdfb.png\"\n  alt=\"A label name in parenthesis and gray\"\n/>\n\n### Repository\n\nDisplay repository names in bold where appropriate\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497508-3d5f1879-54f0-4c8f-9156-9143e35eec3a.png\"\n  alt=\"A repository name in bold\"\n/>\n\n### Help\n\nUse consistent syntax in [help pages](https://github.com/cli/cli/blob/trunk/docs/command-line-syntax.md) to explain command usage.\n\n#### Literal text\n\nUse plain text for parts of the command that cannot be changed\n\n```bash\ngh help\n```\n\n<Caption>The argument help is required in this command</Caption>\n\n#### Placeholder values\n\nUse angled brackets to represent a value the user must replace. No other expressions can be contained within the angled brackets.\n\n```bash\ngh pr view <issue-number>\n```\n\n<Caption>Replace \"issue-number\" with an issue number</Caption>\n\n#### Optional arguments\n\nPlace optional arguments in square brackets. Mutually exclusive arguments can be included inside square brackets if they are separated with vertical bars.\n\n```bash\ngh pr checkout [--web]\n```\n\n<Caption>The argument `--web` is optional.</Caption>\n\n```bash\ngh pr view [<number> | <url>]\n```\n\n<Caption>The \"number\" and \"url\" arguments are optional.</Caption>\n\n#### Required mutually exclusive arguments\n\nPlace required mutually exclusive arguments inside braces, separate arguments with vertical bars.\n\n```bash\ngh pr {view | create}\n```\n\n#### Repeatable arguments\n\nEllipsis represent arguments that can appear multiple times\n\n```bash\ngh pr close <pr-number>...\n```\n\n#### Variable naming\n\nFor multi-word variables use dash-case (all lower case with words separated by dashes)\n\n```bash\ngh pr checkout <issue-number>\n```\n\n#### Additional examples\n\nOptional argument with placeholder:\n\n```bash\n<command> <subcommand> [<arg>]\n```\n\nRequired argument with mutually exclusive options:\n\n```bash\n<command> <subcommand> {<path> | <string> | literal}\n```\n\nOptional argument with mutually exclusive options:\n\n```bash\n<command> <subcommand> [<path> | <string>]\n```\n\n## Prompts\n\nGenerally speaking, prompts are the CLI’s version of forms.\n\n- Use prompts for entering information\n- Use a prompt when user intent is unclear\n- Make sure to provide flags for all prompts\n\n### Yes/No\n\nUse for yes/no questions, usually a confirmation. The default (what will happen if you enter nothing and hit enter) is in caps.\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497458-36deca06-477d-47e6-8656-d83b71edbe82.png\"\n  alt=\"An example of a yes/no prompt.\"\n/>\n\n### Short text\n\nUse to enter short strings of text. Enter will accept the auto fill if available\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497453-0d3fc9a0-96e7-4285-8a28-464abad66ad6.png\"\n  alt=\"An example of a short text prompt.\"\n/>\n\n### Long text\n\nUse to enter large bodies of text. E key will open the user’s preferred editor, and Enter will skip.\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497445-4397c8e2-5900-4863-b5f7-bb6ceaba34d8.png\"\n  alt=\"An example of a long text prompt.\"\n/>\n\n### Radio select\n\nUse to select one option\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497450-589acfd9-f1a4-45da-a9e3-146cc48452a4.png\"\n  alt=\"An example of a radio select prompt\"\n/>\n\n### Multi select\n\nUse to select multiple options\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497447-5a6628d8-339a-479a-8a72-fea5ac78df2a.png\"\n  alt=\"An example of a multi select prompt\"\n/>\n\n## State\n\nThe CLI reflects how GitHub.com displays state through [color](/native/cli/foundations#color) and [iconographhy](/native/cli/foundations#iconography).\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497462-02b78963-a977-4801-aef1-c693787aca62.png\"\n  alt=\"A collection of examples of state from various command outputs\"\n/>\n\n## Progress indicators\n\nFor processes that might take a while, include a progress indicator with context on what’s happening.\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497460-92b83be7-829a-4b78-adeb-f2d369f95a8a.png\"\n  alt=\"An example of a loading spinner when forking a repository\"\n/>\n\n## Headers\n\nWhen viewing output that could be unclear, headers can quickly set context for what the user is seeing and where they are.\n\n### Examples\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497394-b2ec59b2-5082-41ee-9ccb-2bbe80f21fe5.png\"\n  alt=\"An example of the header of the gh pr create command\"\n/>\n<Caption>\n  The header of the \"gh pr create\" command reassures the user that they're creating the correct pull request\n</Caption>\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497378-70bbe5b1-74dc-4b95-a329-c8f7e2908bae.png\"\n  alt=\"An example of the header of the gh pr list command\"\n/>\n<Caption>The header of the \"gh pr list\" command sets context for what list the user is seeing</Caption>\n\n## Lists\n\nLists use tables to show information.\n\n- State is shown in color.\n- A header is used for context.\n- Information shown may be branch names, dates, or what is most relevant in context.\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497378-70bbe5b1-74dc-4b95-a329-c8f7e2908bae.png\"\n  alt=\"An example of gh pr list\"\n/>\n\n## Detail views\n\nSingle item views show more detail than list views. The body of the item is rendered indented. The item’s URL is shown at the bottom.\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497374-4410111c-b2c9-4f04-8bab-1acd7bcd4135.png\"\n  alt=\"An example of gh issue view\"\n/>\n\n## Empty states\n\nMake sure to include empty messages in command outputs when appropriate.\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497357-142ef375-ea50-4156-b00a-82f511935b11.png\"\n  alt=\"The empty state of the gh pr status command\"\n/>\n<Caption>The empty state of \"gh pr status\"</Caption>\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497363-b43175f4-9b3a-4ad8-8a1e-b9c3bf31e042.png\"\n  alt=\"The empty state of the gh issue list command\"\n/>\n<Caption>The empty state of \"gh issue list\"</Caption>\n\n## Help pages\n\nHelp commands can exist at any level:\n\n- Top level (`gh`)\n- Second level (`gh [command]`)\n- Third level (`gh [command] [subcommand]`)\n\nEach can be accessed using the `--help` flag, or using `gh help [command]`.\n\nEach help page includes a combination of different sections.\n\n### Required sections\n\n- Usage\n- Core commands\n- Flags\n- Learn more\n- Inherited flags\n\n### Other available sections\n\n- Additional commands\n- Examples\n- Arguments\n- Feedback\n\n### Example\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497399-8a13ace4-d795-4014-ac23-5ecfd5eac237.png\"\n  alt=\"The output of gh help\"\n/>\n","parent":{"relativeDirectory":"native/cli","name":"components"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/native/cli/foundations.mdx","frontmatter":{"title":"Foundations"},"rawBody":"---\ntitle: Foundations\ndescription: Design concepts and constraints that can help create a better Terminal like experience for GitHub.\n---\n\nimport {DoDontContainer, Do, Dont, Caption} from '@primer/gatsby-theme-doctocat'\n\n## Language\n\nLanguage is the most important tool at our disposal for creating a clear, understandable product. Having clear language helps us create memorable commands that are clear in what they will do.\n\nWe generally follow this structure:\n\n| gh  | `<command>` | `<subcommand>` | [value] | [flags]   | [value] |\n| --- | ----------- | -------------- | ------- | --------- | ------- |\n| gh  | issue       | view           | 234     | --web     | -       |\n| gh  | pr          | create         | -       | --title   | “Title” |\n| gh  | repo        | fork           | cli/cli | --clone   | false   |\n| gh  | pr          | status         | -       | -         | -       |\n| gh  | issue       | list           | -       | --state   | closed  |\n| gh  | pr          | review         | 234     | --approve | -       |\n\n**Command:** The object you want to interact with\n\n**Subcommand:** The action you want to take on that object. Most `gh` commands contain a command and subcommand. These may take arguments, such as issue/PR numbers, URLs, file names, OWNER/REPO, etc.\n\n**Flag:** A way to modify the command, also may be called “options”. You can use multiple flags. Flags can take values, but don’t always. Flags always have a long version with two dashes `(--state)` but often also have a shortcut with one dash and one letter `(-s)`. It’s possible to chain shorthand flags: `-sfv` is the same as `-s -f -v`\n\n**Values:** Are passed to the commands or flags\n\n- The most common command values are:\n  - Issue or PR number\n  - The “owner/repo” pair\n  - URLs\n  - Branch names\n  - File names\n- The possible flag values depend on the flag:\n  - `--state` takes `{closed | open | merged}`\n  - `--clone` is a boolean flag\n  - `--title` takes a string\n  - `--limit` takes an integer\n\n_Tip: To get a better sense of what feels right, try writing out the commands in the CLI a few different ways._\n\n<DoDontContainer>\n  <Do>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497420-8ab255c3-62b4-42d7-a126-028984471cb2.png\"\n      width=\"100%\"\n    />\n    <Caption>Use a flag for modifiers of actions</Caption>\n  </Do>\n  <Dont>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497413-06bb4d3c-e543-45d1-99f4-9e2cfc218179.png\"\n      width=\"100%\"\n    />\n    <Caption>Avoid making modifiers their own commands</Caption>\n  </Dont>\n</DoDontContainer>\n\n**When designing your command’s language system:**\n\n- Use [GitHub language](/native/cli/getting-started#make-it-feel-like-github)\n- Use unambiguous language that can’t be confused for something else\n- Use shorter phrases if possible and appropriate\n\n<DoDontContainer>\n  <Do>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497419-5b3785c7-5360-4553-975d-27c492feb5d9.png\"\n      width=\"100%\"\n    />\n    <Caption>Use language that can't be misconstrued</Caption>\n  </Do>\n  <Dont>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497411-0d5c778e-e03a-49da-9628-d0d34d11c4ec.png\"\n      width=\"100%\"\n    />\n    <Caption>\n      Avoid language that can be interpreted in multiple ways (\"open in browser\" or \"open a pull request\" here)\n    </Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497417-c8e5d51c-9280-4cae-9b4b-6a3f70b88786.png\"\n      width=\"100%\"\n    />\n    <Caption>Use understood shorthands to save characters to type</Caption>\n  </Do>\n  <Dont>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497409-678c95f4-0c47-41ac-b81b-f1cadfe69516.png\"\n      width=\"100%\"\n    />\n    <Caption>Avoid long words in commands if there's a reasonable alternative</Caption>\n  </Dont>\n</DoDontContainer>\n\n## Typography\n\nEverything in a command line interface is text, so type hierarchy is important. All type is the same size and font, but you can still create type hierarchy using font weight and space.\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497511-7162553d-a1a7-4703-a640-b349ba06e7bf.png\"\n  alt=\"An example of normal weight, and bold weight. Italics is striked through since it's not used.\"\n/>\n\n- People customize their fonts, but you can assume it will be a monospace\n- Monospace fonts inherently create visual order\n- Fonts may have variable unicode support\n\n### Accessibility\n\nIf you want to ensure that a screen reader will read a pause, you can use a:\n\n- period (`.`)\n- comma (`,`)\n- colon (`:`)\n\n## Spacing\n\nYou can use the following to create hierarchy and visual rhythm:\n\n- Line breaks\n- Tables\n- Indentation\n\n<DoDontContainer stacked>\n  <Do>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497385-27dc586e-92c9-414f-9b19-92688f096119.png\"\n    />\n    <Caption>Use space to create more legible output</Caption>\n  </Do>\n  <Dont>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497381-34fff043-bcc9-4307-9459-f1a549ca399b.png\"\n    />\n    <Caption>Not using space makes output difficult to parse</Caption>\n  </Dont>\n</DoDontContainer>\n\n## Color\n\nTerminals reliably recognize the 8 basic ANSI colors. There are also bright versions of each of these colors that you can use, but less reliably.\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497351-fd41be98-14fc-4b52-b8dc-32fb65f76eb2.png\"\n  alt=\"A table describing the usage of the 8 basic colors.\"\n/>\n\n### Things to note\n\n- Background color is available but we haven’t taken advantage of it yet.\n- Some terminals do not reliably support 256-color escape sequences.\n- Users can customize how their terminal displays the 8 basic colors, but that’s opt-in (for example, the user knows they’re making their greens not green).\n- Only use color to [enhance meaning](/components/icon#usage), not to communicate meaning.\n\n## Iconography\n\nSince graphical image support in terminal emulators is unreliable, we rely on Unicode for iconography. When applying iconography consider:\n\n- People use different fonts that will have varying Unicode support\n- Only use iconography to [enhance meaning](/components/icon#usage), not to communicate meaning\n\n_Note: In Windows, Powershell’s default font (Lucida Console) has poor Unicode support. Microsoft suggests changing it for more Unicode support._\n\n**Symbols currently used:**\n\n```bash\n✓ \tSuccess\n- \tNeutral\n✗   Failure\n+ \tChanges requested\n! \tAlert\n```\n\n<DoDontContainer>\n  <Do>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497402-6d7a375c-9530-4f8b-82e1-06653f42e15b.png\"\n      width=\"100%\"\n    />\n    <Caption>Use checks for success messages</Caption>\n  </Do>\n  <Dont>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497405-ce95e7f7-574c-4aae-ae52-0c4ef2c6b050.png\"\n      width=\"100%\"\n    />\n    <Caption>Don't use checks for failure messages</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497406-95470c4c-7d90-4254-b7a2-39371eee716c.png\"\n      width=\"100%\"\n    />\n    <Caption>Use checks for success of closing or deleting</Caption>\n  </Do>\n  <Dont>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497407-373927e0-ab3b-44e6-846d-1d1d70bc6c01.png\"\n      width=\"100%\"\n    />\n    <Caption>Don't use alerts when closing or deleting</Caption>\n  </Dont>\n</DoDontContainer>\n\n## Scriptability\n\nMake choices that ensure that creating automations or scripts with GitHub commands is obvious and frictionless. Practically, this means:\n\n- Create flags for anything interactive\n- Ensure flags have clear language and defaults\n- Consider what should be different for terminal vs machine output\n\n### In terminal\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497378-70bbe5b1-74dc-4b95-a329-c8f7e2908bae.png\"\n  alt=\"An example of gh pr list\"\n/>\n\n### Through pipe\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497375-a872df76-840a-489b-b0ed-61e37afed9c8.png\"\n  alt=\"An example of gh pr list piped through the cat command\"\n/>\n\n### Differences to note in machine output\n\n- No color or styling\n- State is explicitly written, not implied from color\n- Tabs between columns instead of table layout, since `cut` uses tabs as a delimiter\n- No truncation\n- Exact date format\n- No header\n\n## Customizability\n\nBe aware that people exist in different environments and may customize their setups. Customizations include:\n\n- **Shell:** shell prompt, shell aliases, PATH and other environment variables, tab-completion behavior\n- **Terminal:** font, color scheme, and keyboard shortcuts\n- **Operating system**: language input options, accessibility settings\n\nThe CLI tool itself is also customizable. These are all tools at your disposal when designing new commands.\n\n- Aliasing: [`gh alias set`](https://cli.github.com/manual/gh_alias_set)\n- Preferences: [`gh config set`](https://cli.github.com/manual/gh_config_set)\n- Environment variables: `NO_COLOR`, `EDITOR`, etc\n","parent":{"relativeDirectory":"native/cli","name":"foundations"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/native/cli/getting-started.mdx","frontmatter":{"title":"Getting started"},"rawBody":"---\ntitle: Getting started\ndescription: Primer is also a design system for Terminal like implementations of GitHub. If you’re just starting out with creating those kind of experiences, here’s a list of principles and design foundations to get you started.\n---\n\nimport {DoDontContainer, Do, Dont, Caption} from '@primer/gatsby-theme-doctocat'\n\n## Principles\n\n### Reasonable defaults, easy overrides\n\nOptimize for what most people will need to do most of the time, but make it easy for people to adjust it to their needs. Often this means considering the default behavior of each command, and how it might need to be adjusted with flags.\n\n### Make it feel like GitHub\n\nUsing this tool, it should be obvious that it’s GitHub and not anything else. Use details that are specific to GitHub, such as language or color. When designing output, reflect the GitHub.com interface as much as possible and appropriate.\n\n<DoDontContainer>\n  <Do>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497434-62e03bc6-8b64-4f08-8d0d-c931def35c03.png\"\n      width=\"100%\"\n    />\n    <Caption>Use language accurate to GitHub.com</Caption>\n  </Do>\n  <Dont>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497426-4c1d30df-91df-4e42-a293-ad590768f20d.png\"\n      width=\"100%\"\n    />\n    <Caption>Don't use language that GitHub.com doesn't use</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497433-e050966e-a102-4d50-93c3-bfa6d7251560.png\"\n      width=\"100%\"\n    />\n    <Caption>Use sentence case</Caption>\n  </Do>\n  <Dont>\n    <img\n      alt=\"\"\n      src=\"https://user-images.githubusercontent.com/980622/215497423-4eeea07a-7a2e-4af7-a486-c9a773c29454.png\"\n      width=\"100%\"\n    />\n    <Caption>Don't use title case</Caption>\n  </Dont>\n</DoDontContainer>\n\n#### Resources\n\n- [GitHub Brand Content Guide](https://brand.github.com)\n\n### Reduce cognitive load\n\nCommand line interfaces are not as visually intuitive as graphical interfaces. They have very few affordances (indicators of use), rely on memory, and are often unforgiving of mistakes. We do our best to design our commands to mitigate this.\n\nReducing cognitive load is necessary for [making an accessible product](https://www.w3.org/TR/coga-usable/#summary) .\n\n#### Ways to reduce cognitive load\n\n- Include confirm steps, especially for riskier commands\n- Include headers to help set context for output\n- Ensure consistent command language to make memorizing easier\n- Ensure similar commands are visually and behaviorally parallel. \\* For example, any create command should behave the same\n- Anticipate what people might want to do next. \\* For example, we ask if you want to delete your branch after you merge.\n- Anticipate what mistakes people might make\n\n### Bias towards terminal, but make it easy to get to the browser\n\nWe want to help people stay in the terminal wherever they might want to maintain focus and reduce context switching, but when it’s necessary to jump to GitHub.com make it obvious, fast, and easy. Certain actions are probably better to do in a visual interface.\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497436-cccc800d-4f68-4a40-8a93-3f6b5ae741b2.png\"\n  alt=\"A prompt asking 'What's next?' with the choice 'Preview in browser' selected.\"\n/>\n<Caption>A preview in browser step helps users create issues and pull requests more smoothly.</Caption>\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497438-3b664837-0182-4d94-9433-f9a59ad642ff.png\"\n  alt=\"The gh pr create command with title and body flags outputting a pull request URL.\"\n/>\n<Caption>Many commands output the relevant URL at the end.</Caption>\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497440-5d1f2ebb-b8b8-4dc6-8104-68c125dd85d0.png\"\n  alt=\"The gh issue view command with the --web flag. The output is opening a URL in the browser.\"\n/>\n<Caption>Web flags help users jump to the browser quickly</Caption>\n\n## Process\n\nWhen designing for the command line, consider:\n\n### 1. What the command does\n\n- What makes sense to do from a terminal? What doesn’t?\n- What might people want to automate?\n- What is the default behavior? What flags might you need to change that behavior?\n- What might people try and fail to do and how can you anticipate that?\n\n### 2. What the command is called\n\n- What should the [command language system](/native/cli/foundations#language) be?\n- What should be a command vs a flag?\n- How can you align the language of the new command with the existing commands?\n\n### 3. What the command outputs\n\n- What can you do to make the CLI version [feel like the GitHub.com version](/native/cli/getting-started#make-it-feel-like-github), using [color](/native/cli/foundations#color), [language](/native/cli/foundations#language), [spacing](/native/cli/foundations#spacing), info shown, etc?\n- How should the [machine output](/native/cli/foundations#scriptability) differ from the interactive behavior?\n\n### 4. How you explain your command\n\n- You will need to provide a short and long description of the command for the [help pages](/components/help).\n\n### 5. How people discover your command\n\n- Are there ways to integrate CLI into the feature where it exists on other platforms?\n\n## Prototyping\n\nWhen designing for GitHub CLI, there are several ways you can go about prototyping your ideas.\n\n### Google Docs\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497389-fc902fb0-e0c0-40f7-a745-d6469af09936.png\"\n  alt=\"A screenshot of the Google Docs template\"\n/>\n\nBest for simple quick illustrations of most ideas\n\nUse [this template](https://docs.google.com/document/d/1JIRErIUuJ6fTgabiFYfCH3x91pyHuytbfa0QLnTfXKM/edit?usp=sharing), or format your document with these steps:\n\n1. Choose a dark background (File > Page Setup > Page Color)\n1. Choose a light text color\n1. Choose a monospace font\n\n#### Tips\n\n- Mix it up since people’s setups change so much. Not everyone uses dark background!\n- Make use of the document outline and headers to help communicate your ideas\n\n### Figma\n\n<img\n  src=\"https://user-images.githubusercontent.com/980622/215497367-3d6febe7-3565-4ff1-9725-fc7b6eaa25a3.png\"\n  alt=\"A screenshot of the Figma library\"\n/>\n\nIf you need to show a process unfolding over time, or need to show a prototype that feels more real to users, Figma or code prototypes are best.\n\n[**Figma library**](https://www.figma.com/file/zYsBk5KFoMlovE4g2f4Wkg/Primer-Command-Line) (accessible to GitHub staff only)\n","parent":{"relativeDirectory":"native/cli","name":"getting-started"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/native/cli/index.mdx","frontmatter":{"title":"CLI"},"rawBody":"---\ntitle: CLI\ndescription: These guidelines are a collection of principles, foundations and usage guidelines for designing GitHub command line products.\n---\n\n<ChildPages of=\"CLI\" />\n","parent":{"relativeDirectory":"native/cli","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/native/desktop/foundations.mdx","frontmatter":{"title":"Foundations"},"rawBody":"---\ntitle: Foundations\n---\n\nThese are the foundational design concepts and constraints that can help inform design decisions. The core considerations for GitHub Desktop include platform differences and relationships to Primer Web guidelines.\n\n## Color\n\nThe color scheme file is the only element inherited directly from Primer CSS. For the most part, Deskotp uses the same palette as Primer CSS, with a few exceptions:\n\n- Use blue for the primary buttons (rather than the green buttons on github.com)\n- Use blue for tab underlines (orange is used on github.com)\n\n### Dark mode\n\nGitHub Desktop has a dark mode users can choose in their app preferences. It's displayed using a theme that essentially converts all the elements to their dark mode equivalents.\n\n## Iconography\n\nimport icons from '../../images/desktop-icons.png'\n\nGitHub Desktop uses [octicons](https://primer.style/octicons/), but doesn't inherit updates, instead they're duplicated into the Desktop code base. There are icons that are unique to Desktop:\n\n- Stash: Uses the octicon for ‘modified’ but made to appear stacked\n- Commit co-author: Person with plus sign\n- Avatar default: The old version (a filled in silhouette with rounded container) is used instead of the newer outlined style due to the context\n- Force push icon: Push arrow with outline of two more arrows to make it look more extreme\n- Repo force push: Repo with arrow with triple outline above\n\n<img src={icons} alt=\"\" />\n\nSome older octicons have also been used in the illustrations (check mark, question mark, ufo with speech bubble with telescope, planet with thumbs up).\n\n## Illustrations\n\nGitHub Desktop has its own set of illustrations, which were adopted from a previous GitHub Universe with a space theme. Illustrations primarily show up in the welcome wizard and empty states for lists areas. Because Desktop has a dark mode, hard-coded colors need to look good on either white or dark gray backgrounds. They are composed of 1 or 2 swatches that get swapped out with a css invert filter on. If a shadow is included in the illustration, it needs to be translucent.\n\nAll of the illustrations can be found in the [desktop repo](https://github.com/desktop/desktop/tree/development/app/static/common).\n\n## Platforms\n\nDesktop is built using Electron, which allows it to be cross-platform. With Electron, it’s possible to implement anything that can be implemented on github.com, and more. For example, in the future, multiple desktop windows could be part of the app experience. Though Electron enables a cross-platform app, there are a few key differentiating features between macOS and Windows that need to be considered when designing for GitHub Desktop.\n\n### Button order\n\n#### Button order on macOS\n\nThe secondary button is always on the left, whether it’s the default or cancel, and the primary action is on the right. This is aligned with the Primer guidelines used on github.com.\n\nExample: \"Cancel | Let’s Do This\"\n\n#### Button order on Windows\n\nThe default button is always on the far right and the primary action is on the left. This differs from the Primer guidelines and should be taken into consideration for Windows users.\n\nExample: \"Let’s do this | Cancel\"\n\n### Capitalization\n\n#### Capitalization on macOS\n\nTitle case is used for headlines and buttons. This is different from Primer guidelines, so it needs to be taken into consideration.\n\nExample: \"Current Repository\"\n\n#### Capitalization on Windows\n\nSentence case is used for headlines and buttons, which is aligned with Primer guidelines.\n\nExample: \"Current repository\"\n\n### Menu bar\n\n#### Menu bar on macOS\n\nThe menu bar on macOS sits at the top of the screen, disconnected from the GitHub Desktop window. The system menu bar is used.\n\n#### Menu bar on Windows\n\nThe menu bar on Windows sits directly on top of the GitHub Desktop UI, with no separation or ability to disconnect it. The menu bar is a custom design, so when considering changing elements in the topbar (the top of the Desktop interface), consider the Windows menu bar in relation.\n\n## Relationship to Primer Web\n\nGitHub Desktop's architecture and Primer Web are not compatible. For that reason, Desktop has its own set of components and CSS that leverage Primer Web, and doesn't take advantage of Primer updates to the code directly, with the exception of the color scheme file.\n\n## Spacing\n\nGitHub Desktop uses a 10 pixel grid (different from the 8px grid used by Primer). Changing the spacing scale has been considered and is documented in [this PR](https://github.com/desktop/desktop/compare/spacing-scale-spike-v2).\n\n## System Elements\n\nThe following UI elements use system-generated code that has not been customized or styled:\n\n- Context menus\n- Tooltips\n- Dropdowns\n- Menu bar on macOS (Windows uses a custom menu bar)\n\n## Typography\n\nGitHub Desktop uses system fonts. When creating design mockups for GitHub Desktop, consider that:\n\n- In Figma, use macOS fonts (Primer Web defaults) for mocking up designs, unless the feature is Windows-specific.\n- Windows' system font is Segoe UI, and type styles for Windows are included in the Figma library to make it easy to switch from SF Pro to Segoe to show the difference between Mac and Windows screens. Segoe UI reads a little smaller and tighter, so it may be worth adjusting the point size to make it feel consistent with macOS.\n- Styles and sizes follow the same guidelines as Primer Web, with the addition of `text-x-small` (11pt and used for all small, secondary text).\n\n[Download Segoe UI (Mac only)](https://aka.ms/SegoeFonts)\n","parent":{"relativeDirectory":"native/desktop","name":"foundations"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/native/mobile/index.mdx","frontmatter":{"title":"Mobile"},"rawBody":"---\ntitle: Mobile\ndescription: These guidelines are a collection of principles, foundations and usage guidelines for designing GitHub's native iOS and Android apps.\n---\n\n<ChildPages of=\"Mobile\" />\n","parent":{"relativeDirectory":"native/mobile","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/native/mobile/platforms.mdx","frontmatter":{"title":"Platforms"},"rawBody":"---\ntitle: Platforms\ndescription: GitHub builds mobile apps for iOS, iPad, and Android devices. All the applications are built natively, using modern languages like Kotlin and Swift. Our goal is to provide an experience that respects people's decisions to use different operating systems.\n---\n\nWe try to design apps that feel at home on their respective platform, taking advantage of the unique functionality that exists within each ecosystem. At the same time, we lean on GitHub's design language of colors, iconography, copywriting, and visual design, to provide a coherent cross-platform experience to people.\n\n## GitHub\n\nWhile we do our best to leverage platform technologies on Android and iOS, we also use components, colors, iconography, and other elements from GitHub's design infrastructure to provide understandable and cohesive experiences across all platforms.\n\n**Recommended resources:**\n\n- [Primer Interface Guidelines](/)\n- [Octicons](https://primer.style/octicons/)\n\n## Responsive web\n\nThe mobile apps complement GitHub's responsive web efforts. The web – and the value of the URL – remain a core part of GitHub's product philosophy. Because of this, we do our best to provide escape hatches from the apps to the mobile website whenever possible. We do this by including Share actions in the navigation bar whenever possible.\n\n<img\n  src=\"https://user-images.githubusercontent.com/1923260/87459988-6150b900-c5c9-11ea-8443-516286ecd133.png\"\n  alt=\"Native app header with a share icon\"\n/>\n\nConversely, many experiences can be better when we remove the URL and allow users to take advantage of a more gesture-based, fluid app experience. For example, when triaging notifications, it can often feel faster and easier to swipe notifications done, rather than tapping through them one at a time. Because these experiences can be so powerful, we also provide prompts in the mobile browser to open GitHub's native app.\n\n<img\n  src=\"https://user-images.githubusercontent.com/1923260/87459929-4b42f880-c5c9-11ea-887d-4a95814d3198.png\"\n  alt=\"Responsive web view of GitHub.com with a top banner to open in the mobile app\"\n/>\n\n<img\n  src=\"https://user-images.githubusercontent.com/1923260/87461174-4121f980-c5cb-11ea-840b-6ca574b68825.png\"\n  alt=\"\"\n  role=\"presentation\"\n  width=\"100%\"\n/>\n\n## Android\n\nOur Android application leans on the [Material Design Spec](https://material.io/design) to provide usable, understandable, and responsive applications.\n\n**Recommended resources:**\n\n- [Material Design](https://material.io/design)\n- [Material Components](https://material.io/components)\n- [About Material Shape](https://material.io/design/shape/about-shape.html#shaping-material)\n- [The Type System](https://material.io/design/typography/the-type-system.html#type-scale)\n- [Material Baseline Figma Kit](https://www.figma.com/community/file/778763161265841481)\n- [Material Design Dark Theme Figma Kit](https://www.figma.com/community/file/787036571667088922)\n- [How to Design a Dark Theme Using Material](https://www.youtube.com/watch?v=9NDLR3COU7Y)\n- [Material Sound](https://material.io/design/sound/about-sound.html#principles)\n- [Understanding Motion](https://material.io/design/motion/understanding-motion.html#principles)\n- [Material Surfaces](https://material.io/design/environment/surfaces.html#material-environment)\n- [Understanding Layout](https://material.io/design/layout/understanding-layout.html#)\n- [Understanding Navigation](https://material.io/design/navigation/understanding-navigation.html)\n- [The Color System](https://material.io/design/color/the-color-system.html#color-usage-and-palettes)\n\nBe sure to explore past [Google I/O videos](https://design.google/library/io-2019-our-definitive-guide-design/) to learn about designing great native Android applications.\n\n## iOS and iPadOS\n\nOur iOS and iPadOS applications lean on the [Human Interface Guidlines](https://developer.apple.com/design/human-interface-guidelines/) to provide responsive, accessibly, and performant applications.\n\n**Recommended resources:**\n\n- [iOS Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/ios/overview/themes/)\n- [Design for iPad](https://developer.apple.com/videos/play/wwdc2020/10206/)\n- [Design with iOS pickers, menus, and actions](https://developer.apple.com/videos/play/wwdc2020/10205/)\n- [Design for the iPadOS pointer](https://developer.apple.com/videos/play/wwdc2020/10640/)\n- [Designing for iPhone X](https://developer.apple.com/videos/play/tech-talks/801/)\n- [Designing Audio-Haptic Experiences](https://developer.apple.com/videos/play/wwdc2019/810/)\n- [Visual Design and Accessibility](https://developer.apple.com/videos/play/wwdc2019/244/)\n- [Designing Fluid Interfaces](https://developer.apple.com/videos/play/wwdc2018/803/)\n- [Intentional Design](https://developer.apple.com/videos/play/wwdc2018/802/)\n- [Designing with Dark Mode](https://developer.apple.com/videos/play/wwdc2018/210/)\n- [Designing Sound](https://developer.apple.com/videos/play/wwdc2017/803/)\n\nBe sure to explore past [WWDC session videos about design](https://developer.apple.com/videos/all-videos/?q=design) to learn more about designing great mobile experiences on iOS and iPadOS.\n","parent":{"relativeDirectory":"native/mobile","name":"platforms"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/components/icon.mdx","frontmatter":{"title":"Icon"},"rawBody":"---\ntitle: Icon\nfigma: https://www.figma.com/file/1ljgTFkT5NKNRfq5hw07JQ/Octicons?node-id=1%3A2&t=Lz5afoq1bbWrD9Yt-1\ndescription: Icons at GitHub are called Octicons, which are available in various implementations including React, Figma, Rails, and Styled System.\n---\n\nimport {Box, Text} from '@primer/react'\nimport ComponentLayout from '~/src/layouts/component-layout'\nexport default ComponentLayout\n\n<img\n  width=\"960\"\n  alt=\"An image of multiple icons placed in a grid\"\n  src=\"https://user-images.githubusercontent.com/980622/210349372-9392f4b3-4902-4fd3-ab6f-fbd3587f208a.png\"\n/>\n\n## Library\n\nAt Primer, we utilize the [Octicons](https://primer.style/octicons) icon library. This package is available in [Ruby](https://primer.style/octicons/packages/ruby), [Jekyll](https://primer.style/octicons/packages/jekyll), [JavaScript](https://primer.style/octicons/packages/javascript), [React](https://primer.style/octicons/packages/react) and [Styled System](https://primer.style/octicons/packages/styled-system).\n\n## Usage\n\nIcons are most appropriate for representing simple, recognizable concepts or actions. When choosing icons for your design system, consider the following guidelines:\n\n1. Where possible use icons to supplement text, rather than replacing it.\n2. Make sure that the meaning of icons is clear when used without accompanying text.\n3. Choose icons that are easy to recognize and accurately depict the concept or action.\n4. Maintain consistency in the use of icons across your product or brand.\n5. Avoid using icons for complex or abstract concepts that may be confusing to some users.\n6. Adhere to predetermined icon sizes to ensure legibility and ease of recognition.\n7. Test the effectiveness of your icons with users to ensure that they are understood and useful in navigating the interface.\n\n## Color\n\nTo ensure that icons are effective and legible in different color modes, it is recommended to use our [functional foreground colors](/foundations/color#foregrounds).\n\nMany of our components are designed to automatically set the color of icons to a predetermined color. For example, flash banners are configured to set the icon to the matching [role color](/foundations/color#foregrounds) by default.\n\n<img\n  width=\"960\"\n  alt=\"A flash banner showing a warning icon in orange with the text 'Your password was reset recently.'\"\n  src=\"https://user-images.githubusercontent.com/980622/210349549-e7444c43-bb52-4a84-b00e-13962a22377a.png\"\n/>\n\nSome icons should always be shown in a specific colors when used within a specific context. This helps to effectively convey their intended meaning and provide a consistent user experience. Here are a few examples:\n\n|                                                                                                                                                                                                                                Example                                                                                                                                                                                                                                 | Icon                                            | Color variable                                 | Usage                                   |\n| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ----------------------------------------------- | ---------------------------------------------- | --------------------------------------- |\n|                                            <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm6.5-.25A.75.75 0 017.25 7h1a.75.75 0 01.75.75v2.75h.25a.75.75 0 010 1.5h-2a.75.75 0 010-1.5h.25v-2h-.25a.75.75 0 01-.75-.75zM8 6a1 1 0 100-2 1 1 0 000 2z\" fill=\"#0366D6\"></path></svg>                                             | [info](https://primer.style/octicons/info-16)   | [fg.accent](/foundations/color#foregrounds)    | Important information                   |\n|                                                                                             <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z\" fill=\"#22863A\"></path></svg>                                                                                              | [check](https://primer.style/octicons/check-16) | [fg.success](/foundations/color#foregrounds)   | Successful, passing, or positive result |\n|                                                                  <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z\" fill=\"#D73A49\"></path></svg>                                                                   | [x](https://primer.style/octicons/x-16)         | [fg.danger](/foundations/color#foregrounds)    | Error, danger, or negative result       |\n| <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z\" fill=\"#B08800\"></path></svg> | [alert](https://primer.style/octicons/alert-16) | [fg.attention](/foundations/color#foregrounds) | Warning                                 |\n\n## Specific use cases\n\nCertain [Octicons](https://primer.style/octicons/) are designed for specific use cases and their meaning should not be changed. Most icons also have a predefined color variable, those should not be changed unless placed on colorful/dark backgrounds like buttons. In this case the [fg.onEmphasis](/foundations/color#foregrounds) color can be used. Please refer to the table below for icons with specific guidelines.\n\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Icon                                                                                | Context      | Color variable                                 | Usage                                                                                        |\n| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ----------------------------------------------------------------------------------- | ------------ | ---------------------------------------------- | -------------------------------------------------------------------------------------------- |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#57606A\"><path d=\"M11.93 8.5a4.002 4.002 0 01-7.86 0H.75a.75.75 0 010-1.5h3.32a4.002 4.002 0 017.86 0h3.32a.75.75 0 010 1.5zm-1.43-.75a2.5 2.5 0 10-5 0 2.5 2.5 0 005 0z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | [git-commit](https://primer.style/octicons/git-commit-16)                           | Commit       | [fg.muted](/foundations/color#foregrounds)     | Individual or groups of commits.                                                             |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#1A7F37\"><path d=\"M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z\"></path><path d=\"M8 0a8 8 0 110 16A8 8 0 018 0zM1.5 8a6.5 6.5 0 1013 0 6.5 6.5 0 00-13 0z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | [issue-opened](https://primer.style/octicons/issue-opened-16)                       | Issue        | [fg.success](/foundations/color#foregrounds)   | A newly opened issue that needs attention.                                                   |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#8250DF\"><path d=\"M11.28 6.78a.75.75 0 00-1.06-1.06L7.25 8.69 5.78 7.22a.75.75 0 00-1.06 1.06l2 2a.75.75 0 001.06 0l3.5-3.5z\"></path><path d=\"M16 8A8 8 0 110 8a8 8 0 0116 0zm-1.5 0a6.5 6.5 0 10-13 0 6.5 6.5 0 0013 0z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | [issue-closed](https://primer.style/octicons/issue-closed-16)                       | Issue        | [fg.done](/foundations/color#foregrounds)      | A done/closed issue.                                                                         |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#1A7F37\"><path d=\"M5.029 2.217a6.5 6.5 0 019.437 5.11.75.75 0 101.492-.154 8 8 0 00-14.315-4.03L.427 1.927A.25.25 0 000 2.104V5.75A.25.25 0 00.25 6h3.646a.25.25 0 00.177-.427L2.715 4.215a6.491 6.491 0 012.314-1.998zM1.262 8.169a.75.75 0 00-1.22.658 8.001 8.001 0 0014.315 4.03l1.216 1.216a.25.25 0 00.427-.177V10.25a.25.25 0 00-.25-.25h-3.646a.25.25 0 00-.177.427l1.358 1.358a6.501 6.501 0 01-11.751-3.11.75.75 0 00-.272-.506z\"></path><path d=\"M9.06 9.06a1.5 1.5 0 11-2.12-2.12 1.5 1.5 0 012.12 2.12z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | [issue-reopened](https://primer.style/octicons/issue-reopened-16)                   | Issue        | [fg.success](/foundations/color#foregrounds)   | A reopened issue.                                                                            |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                  <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#57606A\"><path d=\"M14.307 11.655a.75.75 0 01.165 1.048 8.05 8.05 0 01-1.769 1.77.75.75 0 01-.883-1.214 6.552 6.552 0 001.44-1.439.75.75 0 011.047-.165zm-2.652-9.962a.75.75 0 011.048-.165 8.05 8.05 0 011.77 1.769.75.75 0 01-1.214.883 6.552 6.552 0 00-1.439-1.44.75.75 0 01-.165-1.047zM6.749.097a8.074 8.074 0 012.502 0 .75.75 0 11-.233 1.482 6.558 6.558 0 00-2.036 0A.751.751 0 016.749.097zM.955 6.125a.75.75 0 01.624.857 6.558 6.558 0 000 2.036.75.75 0 11-1.482.233 8.074 8.074 0 010-2.502.75.75 0 01.858-.624zm14.09 0a.75.75 0 01.858.624c.13.829.13 1.673 0 2.502a.75.75 0 11-1.482-.233 6.558 6.558 0 000-2.036.75.75 0 01.624-.857zm-8.92 8.92a.75.75 0 01.857-.624 6.558 6.558 0 002.036 0 .75.75 0 11.233 1.482c-.829.13-1.673.13-2.502 0a.75.75 0 01-.624-.858zm-4.432-3.39a.75.75 0 011.048.165 6.552 6.552 0 001.439 1.44.751.751 0 01-.883 1.212 8.05 8.05 0 01-1.77-1.769.75.75 0 01.166-1.048zm2.652-9.962A.75.75 0 014.18 2.74a6.556 6.556 0 00-1.44 1.44.751.751 0 01-1.212-.883 8.05 8.05 0 011.769-1.77.75.75 0 011.048.166z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                  | [issue-draft](https://primer.style/octicons/issue-draft-16)                         | Issue        | [fg.muted](/foundations/color#foregrounds)     | A draft issue.                                                                               |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#1A7F37\"><path d=\"M1.5 3.25a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zm5.677-.177L9.573.677A.25.25 0 0110 .854V2.5h1A2.5 2.5 0 0113.5 5v5.628a2.251 2.251 0 11-1.5 0V5a1 1 0 00-1-1h-1v1.646a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm0 9.5a.75.75 0 100 1.5.75.75 0 000-1.5zm8.25.75a.75.75 0 101.5 0 .75.75 0 00-1.5 0z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | [git-pull-request](https://primer.style/octicons/git-pull-request-16)               | Pull request | [fg.success](/foundations/color#foregrounds)   | A new unmerged pull request that needs attention.                                            |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#CF222E\"><path d=\"M3.25 1A2.25 2.25 0 014 5.372v5.256a2.251 2.251 0 11-1.5 0V5.372A2.251 2.251 0 013.25 1zm9.5 5.5a.75.75 0 01.75.75v3.378a2.251 2.251 0 11-1.5 0V7.25a.75.75 0 01.75-.75zm-2.03-5.273a.75.75 0 011.06 0l.97.97.97-.97a.748.748 0 011.265.332.75.75 0 01-.205.729l-.97.97.97.97a.751.751 0 01-.018 1.042.751.751 0 01-1.042.018l-.97-.97-.97.97a.749.749 0 01-1.275-.326.749.749 0 01.215-.734l.97-.97-.97-.97a.75.75 0 010-1.06zM2.5 3.25a.75.75 0 101.5 0 .75.75 0 00-1.5 0zM3.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zm9.5 0a.75.75 0 100 1.5.75.75 0 000-1.5z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | [git-pull-request-closed](https://primer.style/octicons/git-pull-request-closed-16) | Pull request | [fg.danger](/foundations/color#foregrounds)    | A closed pull request that wasn't merged.                                                    |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#57606A\"><path d=\"M3.25 1A2.25 2.25 0 014 5.372v5.256a2.251 2.251 0 11-1.5 0V5.372A2.251 2.251 0 013.25 1zm9.5 14a2.25 2.25 0 110-4.5 2.25 2.25 0 010 4.5zM2.5 3.25a.75.75 0 101.5 0 .75.75 0 00-1.5 0zM3.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zm9.5 0a.75.75 0 100 1.5.75.75 0 000-1.5zM14 7.5a1.25 1.25 0 11-2.5 0 1.25 1.25 0 012.5 0zm0-4.25a1.25 1.25 0 11-2.5 0 1.25 1.25 0 012.5 0z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | [git-pull-request-draft](https://primer.style/octicons/git-pull-request-draft-16)   | Pull request | [fg.muted](/foundations/color#foregrounds)     | A draft pull request.                                                                        |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#8250DF\"><path d=\"M5.45 5.154A4.25 4.25 0 009.25 7.5h1.378a2.251 2.251 0 110 1.5H9.25A5.734 5.734 0 015 7.123v3.505a2.25 2.25 0 11-1.5 0V5.372a2.25 2.25 0 111.95-.218zM4.25 13.5a.75.75 0 100-1.5.75.75 0 000 1.5zm8.5-4.5a.75.75 0 100-1.5.75.75 0 000 1.5zM5 3.25a.75.75 0 100 .005V3.25z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | [git-merge](https://primer.style/octicons/git-merge-16)                             | Pull request | [fg.done](/foundations/color#foregrounds)      | A merged request.                                                                            |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#57606A\"><path d=\"M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 010-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 11-1.072 1.05A2.495 2.495 0 012 11.5zm10.5-1h-8a1 1 0 00-1 1v6.708A2.486 2.486 0 014.5 9h8zM5 12.25a.25.25 0 01.25-.25h3.5a.25.25 0 01.25.25v3.25a.25.25 0 01-.4.2l-1.45-1.087a.249.249 0 00-.3 0L5.4 15.7a.25.25 0 01-.4-.2z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | [repo](https://primer.style/octicons/repo-16)                                       | Repository   | [fg.muted](/foundations/color#foregrounds)     | A public repository.                                                                         |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#9A6700\"><path d=\"M1 2.5A2.5 2.5 0 013.5 0h8.75a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0V1.5h-8a1 1 0 00-1 1v6.708A2.492 2.492 0 013.5 9h2.75a.75.75 0 010 1.5H3.5a1 1 0 100 2h2.75a.75.75 0 010 1.5H3.5A2.5 2.5 0 011 11.5v-9z\"></path><path d=\"M9 10.168V9a3 3 0 116 0v1.168c.591.281 1 .884 1 1.582v2.5A1.75 1.75 0 0114.25 16h-4.5A1.75 1.75 0 018 14.25v-2.5c0-.698.409-1.3 1-1.582zM13.5 10V9a1.5 1.5 0 00-3 0v1z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | [repo-locked](https://primer.style/octicons/repo-locked-16)                         | Repository   | [fg.attention](/foundations/color#foregrounds) | A private repository. Not to be confused with [lock](https://primer.style/octicons/lock-16). |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"#24292F\"><path  d=\"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 01-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 010 8c0-4.42 3.58-8 8-8z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | [mark-github](https://primer.style/octicons/mark-github-16)                         | Branding     | [fg.default](/foundations/color#foregrounds)   | See our [GitHub brand guidelines](https://brand.github.com/).                                |\n| <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 45 16\" width=\"45\" height=\"16\" fill=\"#24292F\"><path d=\"M8.81 7.35v5.74c0 .04-.01.11-.06.13 0 0-1.25.89-3.31.89-2.49 0-5.44-.78-5.44-5.92S2.58 1.99 5.1 2c2.18 0 3.06.49 3.2.58.04.05.06.09.06.14L7.94 4.5c0 .09-.09.2-.2.17-.36-.11-.9-.33-2.17-.33-1.47 0-3.05.42-3.05 3.73s1.5 3.7 2.58 3.7c.92 0 1.25-.11 1.25-.11v-2.3H4.88c-.11 0-.19-.08-.19-.17V7.35c0-.09.08-.17.19-.17h3.74c.11 0 .19.08.19.17zm35.85 2.33c0 3.43-1.11 4.41-3.05 4.41-1.64 0-2.52-.83-2.52-.83s-.04.46-.09.52c-.03.06-.08.08-.14.08h-1.48c-.1 0-.19-.08-.19-.17l.02-11.11c0-.09.08-.17.17-.17h2.13c.09 0 .17.08.17.17v3.77s.82-.53 2.02-.53l-.01-.02c1.2 0 2.97.45 2.97 3.88zM27.68 2.43c.09 0 .17.08.17.17v11.11c0 .09-.08.17-.17.17h-2.13c-.09 0-.17-.08-.17-.17l.02-4.75h-3.31v4.75c0 .09-.08.17-.17.17h-2.13c-.08 0-.17-.08-.17-.17V2.6c0-.09.08-.17.17-.17h2.13c.09 0 .17.08.17.17v4.09h3.31V2.6c0-.09.08-.17.17-.17zm8.26 3.64c.11 0 .19.08.19.17l-.02 7.47c0 .09-.06.17-.17.17H34.6c-.07 0-.14-.04-.16-.09-.03-.06-.08-.45-.08-.45s-1.13.77-2.52.77c-1.69 0-2.92-.55-2.92-2.75V6.25c0-.09.08-.17.17-.17h2.14c.09 0 .17.08.17.17V11c0 .75.22 1.09.97 1.09s1.3-.39 1.3-.39V6.26c0-.11.06-.19.17-.19zm-17.406 5.971h.005a.177.177 0 01.141.179v1.5c0 .07-.03.14-.09.16-.1.05-.74.22-1.27.22-1.16 0-2.86-.25-2.86-2.69V8.13h-1.11c-.09 0-.17-.08-.17-.19V6.58c0-.08.05-.15.13-.17.07-.01 1.16-.28 1.16-.28V3.96c0-.08.05-.13.14-.13h2.16c.09 0 .14.05.14.13v2.11h1.59c.08 0 .16.08.16.17v1.7c0 .11-.07.19-.16.19h-1.59v3.131c0 .47.27.83 1.05.83.247 0 .481-.049.574-.05zM12.24 6.06c.09 0 .17.08.17.17v7.37c0 .18-.05.27-.25.27h-1.92c-.17 0-.3-.07-.3-.27V6.26c0-.11.08-.2.17-.2zm29.99 3.78c0-1.81-.73-2.05-1.5-1.97-.6.04-1.08.34-1.08.34v3.52s.49.34 1.22.36c1.03.03 1.36-.34 1.36-2.25zM11.19 2.68c.75 0 1.36.61 1.36 1.38 0 .77-.61 1.38-1.36 1.38-.77 0-1.38-.61-1.38-1.38 0-.77.61-1.38 1.38-1.38zm7.34 9.35v.001l.01.01h-.001l-.005-.001v.001c-.009-.001-.015-.011-.024-.011z\"></path></svg> | [logo-github](https://primer.style/octicons/logo-github-16)                         | Branding     | [fg.default](/foundations/color#foregrounds)   | See our [GitHub brand guidelines](https://brand.github.com/).                                |\n\n## Sizes\n\n<img\n  width=\"960\"\n  alt=\"The x-circle icon shown in three different sizes.\"\n  src=\"https://user-images.githubusercontent.com/980622/210349362-fdcef7ea-7c22-4473-a1fd-d435037b2a86.png\"\n/>\n\nOcticons are available in three sizes: `12px`, `16px` and `24px`. To maintain consistency in stroke width and legibility, it is important to use these icons only at their designated sizes.\n\nThe smaller set of `12px` icons is available for use in specific, condensed user interface contexts. These icons are listed below and should only be used in the appropriate context.\n\n|                                                                                                                              Example                                                                                                                              | Icon                                                                    | Usage                                                                                                                          |\n| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |\n| <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" width=\"12\" height=\"12\"><path d=\"M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 01-1.146 1.954H1.33A1.313 1.313 0 01.183 9.058zM7 7V3H5v4zm-1 3a1 1 0 100-2 1 1 0 000 2z\"></path></svg> | [alert-fill](https://primer.style/octicons/alert-fill-12)               | For cautionary messaging or to inform the user that an action requires attention                                               |\n|                    <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" width=\"12\" height=\"12\"><path d=\"M6 0a6 6 0 110 12A6 6 0 016 0zm-.705 8.737L9.63 4.403 8.392 3.166 5.295 6.263l-1.7-1.702L2.356 5.8l2.938 2.938z\"></path></svg>                     | [check-circle-fill](https://primer.style/octicons/check-circle-fill-12) | For positive messaging to inform the user that an action is successful, complete, or that they may continue through a workflow |\n|                                                       <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" width=\"12\" height=\"12\"><path d=\"M6 0a6 6 0 110 12A6 6 0 016 0zm3 5H3v2h6z\"></path></svg>                                                        | [no-entry-fill](https://primer.style/octicons/no-entry-fill-12)         | Indicate an ending or that the user is blocked and cannot continue                                                             |\n|     <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" width=\"12\" height=\"12\"><path d=\"M1.757 10.243a6.001 6.001 0 118.488-8.486 6.001 6.001 0 01-8.488 8.486zM6 4.763l-2-2L2.763 4l2 2-2 2L4 9.237l2-2 2 2L9.237 8l-2-2 2-2L8 2.763z\"></path></svg>     | [x-circle-fill](https://primer.style/octicons/x-circle-fill-12)         | For negative messaging to inform the user that an error has occurred as a result of an action or an action is unavailable      |\n|       <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" width=\"12\" height=\"12\"><path d=\"M6 8.8c-.2 0-.4-.1-.5-.2L2.2 5.3c-.3-.3-.3-.8 0-1.1.3-.3.8-.3 1.1 0L6 6.9l2.7-2.7c.3-.3.8-.3 1.1 0 .3.3.3.8 0 1.1L6.6 8.5c-.2.2-.4.3-.6.3z\"></path></svg>       | [chevron-down](https://primer.style/octicons/chevron-down-12)           | Indicates that a collapsible section is currently open                                                                         |\n|      <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" width=\"12\" height=\"12\"><path d=\"M4.7 10c-.2 0-.4-.1-.5-.2-.3-.3-.3-.8 0-1.1L6.9 6 4.2 3.3c-.3-.3-.3-.8 0-1.1.3-.3.8-.3 1.1 0l3.3 3.2c.3.3.3.8 0 1.1L5.3 9.7c-.2.2-.4.3-.6.3z\"></path></svg>      | [chevron-right](https://primer.style/octicons/chevron-right-12)         | Indicates that a collapsible section is currently closed                                                                       |\n\nMaintaining the original size of icons is important for visual consistency, legibility, accessibility, and simplifying the design process. Resizing icons should be avoided.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/209154753-14d8d1c9-0e9c-46e4-a392-43021a65a612.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A pencil icon shown in their original 16px and 24px size.\"\n    />\n    <Caption>Keep icons in their original size.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/209154759-7b1ef599-e4bd-4a75-869f-71de72329ddc.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A pencil icon scaled up from 16px to 24px demonstrating how the stroke increased while upscaling. Another pencil icon is scaled down from 24px to 16px and demonstrates how the stroke became too thin.\"\n    />\n    <Caption>Don't resize icons.</Caption>\n  </Dont>\n</DoDontContainer>\n\n## System vs user-selectable\n\nThere are two types of icons: `system` and `user-selectable` icons.\n\n`System` are used to represent core actions and concepts within the user interface. These icons are typically used consistently throughout the product and are an important part of our visual language. Examples of `system` icons might include a [trash](https://primer.style/octicons/trash-16) icon for deleting items, or a [plus-circle](https://primer.style/octicons/plus-circle-16) icon for adding new items.\n\n`User-selectable` icons, on the other hand, are used to allow users to customize their experience or make a personal connection with the product. `User-selectable` icons are typically less central to the functionality of the user interface and may be changed by the user as desired.\n\nAt GitHub we currently use emojis as `user-selectable` icons as they are widely recognized and understood, making them an effective way to convey emotions or personality. One benefit of using emojis as `user-selectable` icons is that they are visually distinct from the `system` icons used in the design system. This helps users to easily understand that the emojis are optional and can be selected by the user, rather than being a part of the core functionality of the user interface.\n\nUsing [Octicons](https://primer.style/octicons/) as `user-selectable` icons is strongly discouraged as that could create a confusing experience when used in the wrong context. For example, a user could pick a [issue-closed](https://primer.style/octicons/issue-closed-16) icon and use the label `In progress`.\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/209167301-278f8dff-70a1-4bc3-9ad9-335fb365bd67.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A navigation side bar with multiple items including 'To do', 'Learning' and ''Ready to go. Each item has a emoji assigned and is displayed on the left of the text.\"\n    />\n    <Caption>Use emojis as user-selectable icons.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/209167308-0c8cca85-5d78-4c60-b69b-13f5afbf0254.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A navigation side bar with multiple items including 'To do', 'Learning' and ''Ready to go. Each item has an octicon assigned that is displayed on the left of the text.\"\n    />\n    <Caption>Don't use Octicons for user-selectable icons.</Caption>\n  </Dont>\n</DoDontContainer>\n\n## States\n\nTo display the state of an action, use a stroke and fill icon combination or its opposite version if available. For \"off\" or \"empty\" states, use the outline icon.\n\n### Predefined pairs\n\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Icons                                                                                                                                                               | Usage                             |\n| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |\n|                                                                                                                                                                                                                       <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.565 20.565 0 008 13.393a20.561 20.561 0 003.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.75.75 0 01-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5zM8 14.25l-.345.666-.002-.001-.006-.003-.018-.01a7.643 7.643 0 01-.31-.17 22.075 22.075 0 01-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.08 22.08 0 01-3.744 2.584l-.018.01-.006.003h-.002L8 14.25zm0 0l.345.666a.752.752 0 01-.69 0L8 14.25z\"></path></svg> / <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M7.655 14.916L8 14.25l.345.666a.752.752 0 01-.69 0zm0 0L8 14.25l.345.666.002-.001.006-.003.018-.01a7.643 7.643 0 00.31-.17 22.08 22.08 0 003.433-2.414C13.956 10.731 16 8.35 16 5.5 16 2.836 13.914 1 11.75 1 10.203 1 8.847 1.802 8 3.02 7.153 1.802 5.797 1 4.25 1 2.086 1 0 2.836 0 5.5c0 2.85 2.045 5.231 3.885 6.818a22.075 22.075 0 003.744 2.584l.018.01.006.003h.002z\"></path></svg>                                                                                                                                                                                                                        | [heart](https://primer.style/octicons/heart-16) / [heart-fill](https://primer.style/octicons/heart-fill-16)                                                         | Sponsor / Sponsoring              |\n|                                                                                                                                                                                                                                                                                                                                                                              <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z\"></path></svg> / <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                              | [star](https://primer.style/octicons/star-16) / [star-fill](https://primer.style/octicons/star-fill-16)                                                             | Star / Unstar                     |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M8 16A8 8 0 108 0a8 8 0 000 16zm3.78-9.72a.75.75 0 00-1.06-1.06L6.75 9.19 5.28 7.72a.75.75 0 00-1.06 1.06l2 2a.75.75 0 001.06 0l4.5-4.5z\"></path></svg> / <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M2.343 13.657A8 8 0 1113.657 2.343 8 8 0 012.343 13.657zM6.03 4.97a.75.75 0 00-1.06 1.06L6.94 8 4.97 9.97a.75.75 0 101.06 1.06L8 9.06l1.97 1.97a.75.75 0 101.06-1.06L9.06 8l1.97-1.97a.75.75 0 10-1.06-1.06L8 6.94 6.03 4.97z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | [check-circle](https://primer.style/octicons/check-circle-16) / [x-circle-fill](https://primer.style/octicons/x-circle-fill-16)                                     | Pass / Fail                       |\n|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path d=\"M.513 1.513A1.75 1.75 0 011.75 1h3.5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 00.2.1H13a1 1 0 011 1v.5H2.75a.75.75 0 000 1.5h11.978a1 1 0 01.994 1.117L15 13.25A1.75 1.75 0 0113.25 15H1.75A1.75 1.75 0 010 13.25V2.75c0-.464.184-.91.513-1.237z\"></path></svg> / <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path d=\"M1.75 1A1.75 1.75 0 000 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0016 13.25v-8.5A1.75 1.75 0 0014.25 3H7.5a.25.25 0 01-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | [file-directory-open-fill](https://primer.style/octicons/file-directory-open-fill-16) / [file-directory-fill](https://primer.style/octicons/file-directory-fill-16) | Directory open / Directory closed |\n|                                                                                                                                      <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path d=\"M8 16a2 2 0 001.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 008 16z\"></path><path fill-rule=\"evenodd\" d=\"M8 1.5A3.5 3.5 0 004.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.018.018 0 00-.003.01l.001.006c0 .002.002.004.004.006a.017.017 0 00.006.004l.007.001h10.964l.007-.001a.016.016 0 00.006-.004.016.016 0 00.004-.006l.001-.007a.017.017 0 00-.003-.01l-1.703-2.554a1.75 1.75 0 01-.294-.97V5A3.5 3.5 0 008 1.5zM3 5a5 5 0 0110 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.518 1.518 0 0113.482 13H2.518a1.518 1.518 0 01-1.263-2.36l1.703-2.554A.25.25 0 003 7.947V5z\"></path></svg> / <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M8 1.5c-.997 0-1.895.416-2.534 1.086A.75.75 0 014.38 1.55 5 5 0 0113 5v2.373a.75.75 0 01-1.5 0V5A3.5 3.5 0 008 1.5zM4.182 4.31L1.19 2.143a.75.75 0 10-.88 1.214L3 5.305v2.642a.25.25 0 01-.042.139L1.255 10.64A1.518 1.518 0 002.518 13h11.108l1.184.857a.75.75 0 10.88-1.214l-1.375-.996a1.196 1.196 0 00-.013-.01L4.198 4.321a.733.733 0 00-.016-.011zm7.373 7.19L4.5 6.391v1.556c0 .346-.102.683-.294.97l-1.703 2.556a.018.018 0 00-.003.01.015.015 0 00.005.012.017.017 0 00.006.004l.007.001h9.037zM8 16a2 2 0 001.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 008 16z\"></path></svg>                                                                                                                                       | [bell](https://primer.style/octicons/bell-16) / [bell-slash](https://primer.style/octicons/bell-slash-16)                                                           | Subscribe / Unsubscribe           |\n|                                                                                                                                                                                                                                                                                                                                                                                                    <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M4.75 2.5a.25.25 0 00-.25.25v9.91l3.023-2.489a.75.75 0 01.954 0l3.023 2.49V2.75a.25.25 0 00-.25-.25h-6.5zM3 2.75C3 1.784 3.784 1 4.75 1h6.5c.966 0 1.75.784 1.75 1.75v11.5a.75.75 0 01-1.227.579L8 11.722l-3.773 3.107A.75.75 0 013 14.25V2.75z\"></path></svg> / <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M1.19 1.143a.75.75 0 10-.88 1.214L3 4.305v9.945a.75.75 0 001.206.596L8 11.944l3.794 2.902A.75.75 0 0013 14.25v-2.703l1.81 1.31a.75.75 0 10.88-1.214l-2.994-2.168a1.09 1.09 0 00-.014-.01L4.196 3.32a.712.712 0 00-.014-.01L1.19 1.143zM4.5 5.39v7.341l3.044-2.328a.75.75 0 01.912 0l3.044 2.328V10.46l-7-5.07zM5.865 1a.75.75 0 000 1.5h5.385a.25.25 0 01.25.25v3.624a.75.75 0 001.5 0V2.75A1.75 1.75 0 0011.25 1H5.865z\"></path></svg>                                                                                                                                                                                                                                                                                                                                                                                                    | [bookmark](https://primer.style/octicons/bookmark-16) / [bookmark-slash](https://primer.style/octicons/bookmark-slash-16)                                           | Save / Unsave                     |\n| <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M1.679 7.932c.412-.621 1.242-1.75 2.366-2.717C5.175 4.242 6.527 3.5 8 3.5c1.473 0 2.824.742 3.955 1.715 1.124.967 1.954 2.096 2.366 2.717a.119.119 0 010 .136c-.412.621-1.242 1.75-2.366 2.717C10.825 11.758 9.473 12.5 8 12.5c-1.473 0-2.824-.742-3.955-1.715C2.92 9.818 2.09 8.69 1.679 8.068a.119.119 0 010-.136zM8 2c-1.981 0-3.67.992-4.933 2.078C1.797 5.169.88 6.423.43 7.1a1.619 1.619 0 000 1.798c.45.678 1.367 1.932 2.637 3.024C4.329 13.008 6.019 14 8 14c1.981 0 3.67-.992 4.933-2.078 1.27-1.091 2.187-2.345 2.637-3.023a1.619 1.619 0 000-1.798c-.45-.678-1.367-1.932-2.637-3.023C11.671 2.992 9.981 2 8 2zm0 8a2 2 0 100-4 2 2 0 000 4z\"></path></svg> / <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path fill-rule=\"evenodd\" d=\"M.143 2.31a.75.75 0 011.047-.167l14.5 10.5a.75.75 0 11-.88 1.214l-2.248-1.628C11.346 13.19 9.792 14 8 14c-1.981 0-3.67-.992-4.933-2.078C1.797 10.832.88 9.577.43 8.9a1.618 1.618 0 010-1.797c.353-.533.995-1.42 1.868-2.305L.31 3.357A.75.75 0 01.143 2.31zm3.386 3.378a14.21 14.21 0 00-1.85 2.244.12.12 0 00-.022.068c0 .021.006.045.022.068.412.621 1.242 1.75 2.366 2.717C5.175 11.758 6.527 12.5 8 12.5c1.195 0 2.31-.488 3.29-1.191L9.063 9.695A2 2 0 016.058 7.52l-2.53-1.832zM8 3.5c-.516 0-1.017.09-1.499.251a.75.75 0 11-.473-1.423A6.23 6.23 0 018 2c1.981 0 3.67.992 4.933 2.078 1.27 1.091 2.187 2.345 2.637 3.023a1.619 1.619 0 010 1.798c-.11.166-.248.365-.41.587a.75.75 0 11-1.21-.887c.148-.201.272-.382.371-.53a.119.119 0 000-.137c-.412-.621-1.242-1.75-2.366-2.717C10.825 4.242 9.473 3.5 8 3.5z\"></path></svg> | [eye](https://primer.style/octicons/eye-16) / [eye-closed](https://primer.style/octicons/eye-closed-16)                                                             | Watch / Unwatch                   |\n|                                                                                                                                                                                              <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path d=\"M2 7.25A5.225 5.225 0 017.25 2a5.222 5.222 0 014.767 3.029A4.472 4.472 0 0116 9.5c0 2.505-1.995 4.5-4.5 4.5h-8A3.474 3.474 0 010 10.5c0-1.41.809-2.614 2.001-3.17zm1.54.482a.75.75 0 01-.556.832c-.86.22-1.484.987-1.484 1.936 0 1.124.876 2 2 2h8c1.676 0 3-1.324 3-3s-1.324-3-3-3a.75.75 0 01-.709-.504A3.72 3.72 0 007.25 3.5C5.16 3.5 3.5 5.16 3.5 7.25c.002.146.014.292.035.436l.004.036.001.008z\"></path></svg> / <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"16\" height=\"16\"><path d=\"M7.25 2c-.69 0-1.351.13-1.957.371a.75.75 0 10.554 1.394c.43-.17.903-.265 1.403-.265a3.72 3.72 0 013.541 2.496.75.75 0 00.709.504c1.676 0 3 1.324 3 3a3 3 0 01-.681 1.92.75.75 0 001.156.955A4.496 4.496 0 0016 9.5a4.472 4.472 0 00-3.983-4.471A5.222 5.222 0 007.25 2zM.72 1.72a.75.75 0 011.06 0l2.311 2.31c.03.025.056.052.08.08l8.531 8.532.035.034 2.043 2.044a.749.749 0 01-.326 1.275.749.749 0 01-.734-.215l-1.8-1.799a4.54 4.54 0 01-.42.019h-8A3.474 3.474 0 010 10.5c0-1.41.809-2.614 2.001-3.17a5.218 5.218 0 01.646-2.622L.72 2.78a.75.75 0 010-1.06zM3.5 7.25c.004.161.018.322.041.481a.75.75 0 01-.557.833c-.86.22-1.484.986-1.484 1.936 0 1.124.876 2 2 2h6.94L3.771 5.832A3.788 3.788 0 003.5 7.25z\"></path></svg>                                                                                                                                                                                               | [cloud](https://primer.style/octicons/cloud-16) / [cloud-offline](https://primer.style/octicons/cloud-offline-16)                                                   | Cloud online / Cloud offline      |\n\nMaintaining consistency by adhering to the predefined pairs is important to avoid inconsistencies, as demonstrated in the following examples\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/210356419-d37ecec3-97b4-45f3-bdf9-b6dd9d4b856f.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A completed 'upload artifacts' block with a check-circle icon and a failed 'upload artifacts' with a x-circle-fill icon.\"\n    />\n    <Caption>Stick to predefined icon pairs.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/210356422-b3fde0b8-c20d-4c8c-907d-a945646823d6.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"A completed 'upload artifacts' block with a check-circle icon and a failed 'upload artifacts' with a x icon.\"\n    />\n    <Caption>Create your own icon pairs.</Caption>\n  </Dont>\n</DoDontContainer>\n\n<DoDontContainer>\n  <Do>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/210348769-210b0bfd-7371-4748-9d30-d45700b879a1.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"Two examples of correct off states for buttons. A 'Save' button with a outline bookmark icon and 'Unsave' button with a bookmark-slash icon. A 'Subscribe' button with a bell icon and 'Unsubscribe' button with a bell-slash icon.\"\n    />\n    <Caption>For \"off\" or \"empty\" states, use the slash icon.</Caption>\n  </Do>\n  <Dont>\n    <img\n      src=\"https://user-images.githubusercontent.com/980622/210348770-8f77bd7f-6e00-4dc6-8a0c-db791c8ae0e8.png\"\n      role=\"presentation\"\n      width=\"456\"\n      alt=\"Two examples of wrong off states for buttons. A 'Save' button with a bookmark icon and 'Unsave' button with a bookmark-filled icon. A 'Subscribe' button with a outline bell icon and 'Unsubscribe' button with a filled bell-filled icon.\"\n    />\n    <Caption>Don't use filled icons for representing \"off\" or \"empty states\".</Caption>\n  </Dont>\n</DoDontContainer>\n\n## Creating new icons\n\nIf you are unable to find the icon you need in our [Octicons](https://primer.style/octicons/) library, you may want to create a new icon. Follow our [Octicons design guidelines](https://primer.style/octicons/guidelines/design) for guidance on creating a new icon that fits with the visual language of our design system. Keep in mind that new icons should be added only when they are necessary and meet the guidelines for use.\n","parent":{"relativeDirectory":"components","name":"icon"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/native/mobile/foundations.mdx","frontmatter":{"title":"Foundations"},"rawBody":"---\ntitle: Foundations\ndescription: Design concepts and constraints that can help create a better mobile experiences for GitHub.\n---\n\n## Spacing and layout\n\nIn general, our apps conform to an 8-point grid layout. However, we defer many component sizes, spacings, and layouts to the platform (iOS + Android) in order to let them deal with cross-device responsiveness, tablet transformations, and OS accessibility settings. When designing custom components, make sure elements are spaced and aligned to an 8-point grid (half-steps of 4pts are included).\n\n- [HIG: Adaptivity and Layout](https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/)\n- [Material Spacing](https://material.io/design/layout/spacing-methods.html#baseline-grid)\n\n## Color\n\nBecause we support dark mode and high contrast color variants, working with colors on mobile requires a few special workflows and considerations. Our core color system is maintained in the [Mobile Design Toolkit](https://www.figma.com/file/csCViryWkkXwBsK1aLrO0X/Mobile-Design-Toolkit?node-id=1%3A532) Figma file. This is the source of truth. Changes here will propogate out to the Figma Team Library, the [Mobile Design Toolkit](https://www.figma.com/community/plugin/848205889935107396/Mobile-Design-Toolkit) plugin, and eventually into the iOS and Android apps as Xcassets and XML files.\n\nAdding and updating colors does take time and attention to detail. This should not deter us from iterating, adding new colors, or adjust color values when we find they are not working in production. The following notes and videos are meant to capture the existing processes.\n\n### Primer base\n\nWe use the [Primer Primitives](https://www.figma.com/file/B5XPE8IwGPIZDAvN7jqWqx/Primer-Primitives?node-id=0%3A1&viewport=609%2C529%2C0.383825421333313) color values as our starting point for working with color in mobile. We always want to be inheriting upstream changes to different values.\n\n<img\n  width=\"1638\"\n  alt=\"Primer Primitives base colors displayed together\"\n  src=\"https://user-images.githubusercontent.com/1923260/87474815-f01d0000-c5e0-11ea-9b22-b6f43ad073c6.png\"\n/>\n\n### Spectrum colors\n\nBecause the mobile apps support dark mode, we want to make minor adjustments to the Primer colors so that they remain clear in a dark environment. Generally, we do this by increasing brightness (improve contrast) and decreasing saturation (reducing vibration). By doing this, we end up with a light/dark pairing for each color in the Primer system.\n\n<img\n  width=\"1641\"\n  alt=\"Primer colors extended to support a dark mode variant\"\n  src=\"https://user-images.githubusercontent.com/1923260/87474820-f14e2d00-c5e0-11ea-9891-9c71fe5776d8.png\"\n/>\n\n### Functional colors\n\nWhen we begin implementing colors into the codebase, we immediately bump into two problems:\n\n1. Using Spectrum values like `gray-500` are not descriptive, and will lead to confusion about when to use which value\n2. To support dark mode and high contrast mode, we would have to use four separate Spectrum values to account for each variant (e.g. `gray100` in dark mode, `gray900` in light mode).\n\nTo combat this, we abstract our Spectrum values into _Functional colors_. Functional colors describe their purpose in the application. For example, `iconTertiary` or `textPrimary`. These values are more readable to humans, and provide inherent context about when they should be used.\n\nAdditionally, functional colors _abstract dark mode and high contrast mode_. For example, a functional color `textSecondary` might wrap the following sets of rules:\n\n- In light mode, normal contrast, use `gray800`\n- In light mode, high contrast, use `gray850`\n- In dark mode, normal contrast, use `gray200`\n- In dark mode, high contrast, use `gray150`\n\nUsing code generation, we can dynamically extract XML files for Android, and Xcassets for iOS that contain these color abstractions.\n\n**Note:** Our functional color system is a work in progress! We currently cover text, icons, backgrounds, badges, and borders. But we should expect to expand and refine this system over time as we encounter new use cases and opportunities for clear abstraction.\n\n<img\n  width=\"1010\"\n  alt=\"Example functional color set up showing icon colors\"\n  src=\"https://user-images.githubusercontent.com/1923260/87474825-f1e6c380-c5e0-11ea-92b7-56e3c983fc5d.png\"\n/>\n\n## Iconography\n\nOur mobile apps use GitHub's icon system, [Octicons](/octicons). Octicons come in two sizes, 16px and 24px.\n\n[Star the Octicons repo](https://github.com/primer/octicons) to follow along with the Octicons project. Open issues and pull requests to get support or ask for new icon additions to the system.\n\n### Icon colors\n\nIn the Mobile Design Toolkit we have two functional icon colors: `iconPrimary` and `iconSecondary`. Each of these colors implements a different brightness of gray, adding visual prominence to more important or actionable icons. But when should you use either of these colors? And when should an icon be gray versus our blue `link` color?\n\n#### Link blue icons\n\nIn general, an icon should be blue if it is:\n\n- Used in a navigation bar or toolbar. In other words, it is part of the app chrome.\n- It is a primary, highly-desirable action for a user to take on any given screen.\n\nWe strive to use as few `link` tinted elements in a content view in order to draw attention to only the most important actionable interface elements. Adding too many blue buttons and icons dilutes the power of the color as a way to draw attention.\n\n| Example                                                                                                                      | Notes                                                                                                                                                                                                                                                                                                       |\n| ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| ![repo profile example](https://user-images.githubusercontent.com/1923260/87456404-1ed8ad80-c5c4-11ea-8fbf-4f252a429881.png) | On the repo profile, we follow our rules that nav bar iconography is `link` blue, because it's part of the app's chrome. The icons in the `Star` and `Watch` buttons are also blue to match the button labels and draw attention to the highly-desirable actions that we want users to take on this screen. |\n| ![triage sheet example](https://user-images.githubusercontent.com/1923260/87456413-213b0780-c5c4-11ea-95d9-b0932af9c2d4.png) | In the triage sheet, the primary purpose of this sheet is to manage assignees for a given issue. Because the _purpose_ of this view is to manage (or more likely, to add) assignees, we make the `( + )` icons blue.                                                                                        |\n\n#### Gray icons\n\nGenerally, an icon could be filling one of four roles:\n\n- An icon that represents and _important actionable activity_, but is not the primary purpose of the view\n- An icon that represents an _unimportant actionable activity_\n- An icon that is _not actionable_ and serves as a _primary_ supporting graphic of a piece of text or a view\n- An icon that is _not actionable_ and only serves as a _decorative_ accessory\n\nGenerally, important actionable elements and primary supporting graphics should use `iconPrimary`, while unimportant actionable elements and decorative accessories use `iconSecondary`.\n\nLet's look at some examples:\n\n| Example                                                                                                                          | Notes                                                                                                                                                                                                                                                        |\n| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| ![user profile example](https://user-images.githubusercontent.com/1923260/88214970-3b09c980-cc18-11ea-91f4-7f470bbda304.png)     | The header metatdata icons are unimportant decorative accessories, and not actionable, so we tint them `secondary`. The Pinned section icon is not actionable, but is an important accessory to distinguish this content section, so it is tinted `primary`. |\n| ![settings example](https://user-images.githubusercontent.com/1923260/88214976-3d6c2380-cc18-11ea-986b-f91d646f236f.png)         | The accessory icons are not actionable, and not important decorations, so they are tinted `secondary`.                                                                                                                                                       |\n| ![repo profile example](https://user-images.githubusercontent.com/1923260/88214979-3e04ba00-cc18-11ea-9fee-051fc94a1854.png)     | The branch icon in the code browsing section header is an unactionable accessory tinted `secondary`.                                                                                                                                                         |\n| ![commit details example](https://user-images.githubusercontent.com/1923260/88214981-3e9d5080-cc18-11ea-827c-2e0f19611677.png)   | The commit icon is an important accessory, despite not being actionable, so it is tinted `primary`.                                                                                                                                                          |\n| ![search typeahead example](https://user-images.githubusercontent.com/1923260/88214984-3f35e700-cc18-11ea-8722-dd3106611c34.png) | The search typeahead icons are important supporting accessories to quickly distinguish the typeahead options, so they are tinted `primary`.                                                                                                                  |\n| ![edit favorites example](https://user-images.githubusercontent.com/1923260/88214987-3fce7d80-cc18-11ea-8831-065d30dd4ff5.png)   | The remove buttons when editing favorites are actionable, but not the primary action on this view, so they are tinted `secondary`.                                                                                                                           |\n\n#### Other icon colors\n\nIt's possible for icons to be other colors besides gray and blue! For example, we use yellow star icons to indicate that you, the viewer, have starred a repository. We also use green eye icons to indicate that you are watching a repository. You might also find pink hearts when working with sponsors. And of course, we use green, red, and purple as issue and pull request icon tints to represent states (open, closed, merged).\n\n| Example                                                                                                                        | Notes                                                                                                                                                                                                                                          |\n| ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| ![starred repo example](https://user-images.githubusercontent.com/1923260/87458726-9fe57400-c5c7-11ea-86a1-b057644a45ac.png)   | In this example, the Star button gets a gray label and yellow icon to communicate the _state_ of the viewer's relationship to this repository. The gray label de-emphasizes the button, because un-starring is a generally undesirable action. |\n| ![commit details example](https://user-images.githubusercontent.com/1923260/88214981-3e9d5080-cc18-11ea-827c-2e0f19611677.png) | The state of the PR where this commit was created is tinted purple to indicate the PR was merged, therefore this commit was merged, too.                                                                                                       |\n\n## Typography\n\nWhile we can define our own custom type styles at any time, we prefer to lean on system defaults. System defaults allow us to inherit an enormous amount of functionality for free: dynamic type sizes, bi-directionality, dark mode, voiceover, internationalization, and more.\n\n- [iOS Typography Guidelines](https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/typography/)\n- [The Material Design Type Scale](https://material.io/design/typography/the-type-system.html#type-scale)\n\nOur Android app takes advantage of the [Material Theming](https://material.io/design/material-theming/overview.html#material-theming) spec that allows us to use [Inter](https://rsms.me/inter/) as our default typeface, providing a more clear reading experience for interface text.\n\n### Type colors\n\nThere are currently six functional colors used in the mobile toolkit:\n\n- `textPrimary`\n- `textSeconary`\n- `textTertiary`\n- `textPlaceholder`\n- `link`\n\nIt is up to each designer's judgment, and through our critique process, to decide on the correct text values used for a screen. In general, for the `primary` → `tertiary` values, these should map closely to the visual hierarchy or importance hierarchy of content on a screen.\n\n<img\n  width=\"578\"\n  alt=\"Image showing a repo profile list item and how typographic hierarchy maps to colors\"\n  src=\"https://user-images.githubusercontent.com/1923260/88214609-b159fc00-cc17-11ea-954b-cfafcc42936c.png\"\n/>\n\nThe `link` color will render a blue color, affording an actionable element on the screen (like button, or a link).\n","parent":{"relativeDirectory":"native/mobile","name":"foundations"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/native/desktop/index.mdx","frontmatter":{"title":"Desktop"},"rawBody":"---\ntitle: Desktop\ndescription: These guidelines are a collection of principles, foundations and usage guidelines for designing GitHub Desktop.\n---\n\n<ChildPages of=\"Desktop\" />\n","parent":{"relativeDirectory":"native/desktop","name":"index"}},{"fileAbsolutePath":"/home/runner/work/design/design/content/native/desktop/getting-started.mdx","frontmatter":{"title":"Getting started"},"rawBody":"---\ntitle: Getting started\n---\n\nimport DesktopChangesView from '../../images/desktop-changesview.png'\n\n## Getting started\n\nGitHub Desktop is a git workflow tool built on Electron. It's available on both macOS and Windows and was designed to feel like a native application, considering the core differences between the two platforms. It's meant to look platform agnostic and neutral, rather than mimicking the Primer styles used on github.com. These guidelines cover the basic principles and foundation elements to consider when designing for Desktop.\n\n<img src={DesktopChangesView} alt=\"\" />\n\n## Principles\n\nFollow these principles to help guide your design choices.\n\n### Promote good git behavior\n\nEncourage using git sucessfully so that users can better communicate the work they've done to their teams and for their own records. For example, we encourage well written commit messages by making partial committing easy.\n\n### Balance the spectrum between “git” and “magic”\n\nConsider what the UI explicitly shows the user and what is hidden behind controls and feels like \"magic\". It's important to achieve a good balance between these two paradigms, so that users can understand what is happening and troubleshoot when necessary.\n\n### Prioritize beginners over advanced developers\n\nAlways consider the needs of, and optimize for, beginner developers in favor of advanced developers.\n\n### Help developers learn as they go\n\nUse git terminology and add clarifying information and hints throughout to help users understand just enough of what’s going on behind the scenes. When git language is used accurately, users can more easily troubleshoot and learn concepts quickly.\n\n### Put what’s next front and center\n\nAlways make it clear what the next step is after any given action. This helps beginner develolpers to learn common workflows.\n\nYou can read more about how GitHub Desktop makes product decisions in the\n[\"What is GitHub Desktop and who is it for?\"](https://github.com/desktop/desktop/blob/development/docs/process/what-is-desktop.md) document.\n","parent":{"relativeDirectory":"native/desktop","name":"getting-started"}}]}}}