{"data":{"allMdx":{"nodes":[{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/ActionList.mdx","frontmatter":{"title":"ActionList"},"rawBody":"---\ncomponentId: action_list\ntitle: ActionList\nstatus: Beta\nsource: https://github.com/primer/react/tree/main/src/ActionList\nstorybook: '/react/storybook?path=/story/composite-components-actionlist'\ndescription: An ActionList is a list of items that can be activated or selected. ActionList is the base component for many menu-type components, including ActionMenu and SelectPanel.\n---\n\nimport {Avatar} from '@primer/react'\nimport {ActionList} from '@primer/react'\nimport {LinkIcon, AlertIcon, ArrowRightIcon} from '@primer/octicons-react'\nimport InlineCode from '@primer/gatsby-theme-doctocat/src/components/inline-code'\n\n<Box sx={{border: '1px solid', borderColor: 'border.default', borderRadius: 2, padding: 6, marginBottom: 3}}>\n  <ActionList sx={{width: 320}}>\n    <ActionList.Item>\n      <ActionList.LeadingVisual>\n        <LinkIcon />\n      </ActionList.LeadingVisual>\n      github.com/primer\n      <ActionList.Description variant=\"block\">\n        A React implementation of GitHub's Primer Design System\n      </ActionList.Description>\n    </ActionList.Item>\n    <ActionList.Item>\n      <ActionList.LeadingVisual>\n        <Avatar src=\"https://github.com/mona.png\" />\n      </ActionList.LeadingVisual>\n      mona\n      <ActionList.Description>Monalisa Octocat</ActionList.Description>\n    </ActionList.Item>\n    <ActionList.Item variant=\"danger\">\n      <ActionList.LeadingVisual>\n        <AlertIcon />\n      </ActionList.LeadingVisual>\n      4 vulnerabilities\n      <ActionList.TrailingVisual>\n        <ArrowRightIcon />\n      </ActionList.TrailingVisual>\n    </ActionList.Item>\n  </ActionList>\n</Box>\n\n```js\nimport {ActionList} from '@primer/react'\n```\n\n## Examples\n\n### Minimal example\n\n```jsx live\n<ActionList>\n  <ActionList.Item>New file</ActionList.Item>\n  <ActionList.Item>Copy link</ActionList.Item>\n  <ActionList.Item>Edit file</ActionList.Item>\n  <ActionList.Divider />\n  <ActionList.Item variant=\"danger\">Delete file</ActionList.Item>\n</ActionList>\n```\n\n### With leading visual\n\nLeading 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.\n\n<!-- prettier-ignore -->\n```jsx live\n<ActionList>\n  <ActionList.Item>\n    <ActionList.LeadingVisual><LinkIcon /></ActionList.LeadingVisual>\n    github.com/primer\n  </ActionList.Item>\n  <ActionList.Item variant=\"danger\">\n    <ActionList.LeadingVisual><AlertIcon /></ActionList.LeadingVisual>\n    4 vulnerabilities\n  </ActionList.Item>\n  <ActionList.Item>\n    <ActionList.LeadingVisual><Avatar src=\"https://github.com/mona.png\" /></ActionList.LeadingVisual>\n    mona\n  </ActionList.Item>\n</ActionList>\n\n```\n\n### With trailing visual\n\nTrailing 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.\n\n```jsx live\n<ActionList>\n  <ActionList.Item>\n    New file\n    <ActionList.TrailingVisual>⌘ + N</ActionList.TrailingVisual>\n  </ActionList.Item>\n  <ActionList.Item>\n    Copy link\n    <ActionList.TrailingVisual>⌘ + C</ActionList.TrailingVisual>\n  </ActionList.Item>\n  <ActionList.Item>\n    Edit file\n    <ActionList.TrailingVisual>⌘ + E</ActionList.TrailingVisual>\n  </ActionList.Item>\n  <ActionList.Item variant=\"danger\">\n    Delete file\n    <ActionList.TrailingVisual>⌫</ActionList.TrailingVisual>\n  </ActionList.Item>\n</ActionList>\n```\n\n### With description and dividers\n\nItem 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.\n\n```jsx live\n<ActionList showDividers>\n  <ActionList.Item>\n    <ActionList.LeadingVisual>\n      <Avatar src=\"https://github.com/mona.png\" />\n    </ActionList.LeadingVisual>\n    mona\n    <ActionList.Description>Monalisa Octocat</ActionList.Description>\n  </ActionList.Item>\n  <ActionList.Item>\n    <ActionList.LeadingVisual>\n      <Avatar src=\"https://github.com/hubot.png\" />\n    </ActionList.LeadingVisual>\n    hubot\n    <ActionList.Description>Hubot</ActionList.Description>\n  </ActionList.Item>\n  <ActionList.Item>\n    <ActionList.LeadingVisual>\n      <Avatar src=\"https://github.com/primer-css.png\" />\n    </ActionList.LeadingVisual>\n    primer-css\n    <ActionList.Description>GitHub Design Systems Bot</ActionList.Description>\n  </ActionList.Item>\n</ActionList>\n```\n\n### With links\n\nWhen you want to add links to the List instead of actions, use `ActionList.LinkItem`\n\n<!-- prettier-ignore -->\n```jsx live\n<ActionList>\n  <ActionList.LinkItem href=\"https://github.com/primer\">\n    <ActionList.LeadingVisual>\n      <LinkIcon />\n    </ActionList.LeadingVisual>\n    github/primer\n  </ActionList.LinkItem>\n  <ActionList.LinkItem as={ReactRouterLink} to=\"/\">\n    <ActionList.LeadingVisual>\n      <LawIcon />\n    </ActionList.LeadingVisual>\n    MIT License\n  </ActionList.LinkItem>\n  <ActionList.LinkItem \n    href=\"https://github.com/primer/react/stargazers\"\n    target=\"_blank\"\n    rel=\"noopener noreferrer\"\n  >\n    <ActionList.LeadingVisual>\n      <StarIcon />\n    </ActionList.LeadingVisual>\n    1.4k stars\n  </ActionList.LinkItem>\n</ActionList>\n```\n\n### With groups\n\n```javascript live noinline\nconst SelectFields = () => {\n  const [options, setOptions] = React.useState([\n    {text: 'Status', selected: true},\n    {text: 'Stage', selected: true},\n    {text: 'Assignee', selected: true},\n    {text: 'Team', selected: true},\n    {text: 'Estimate', selected: false},\n    {text: 'Due Date', selected: false}\n  ])\n\n  const visibleOptions = options.filter(option => option.selected)\n  const hiddenOptions = options.filter(option => !option.selected)\n\n  const toggle = text => {\n    setOptions(\n      options.map(option => {\n        if (option.text === text) option.selected = !option.selected\n        return option\n      })\n    )\n  }\n\n  return (\n    <ActionList selectionVariant=\"multiple\">\n      <ActionList.Group title=\"Visible fields\">\n        {visibleOptions.map(option => (\n          <ActionList.Item key={option.text} selected={true} onSelect={() => toggle(option.text)}>\n            {option.text}\n          </ActionList.Item>\n        ))}\n      </ActionList.Group>\n      <ActionList.Group\n        title=\"Hidden fields\"\n        selectionVariant={\n          /** selectionVariant override on Group: disable selection if there are no options */\n          hiddenOptions.length ? 'multiple' : false\n        }\n      >\n        {hiddenOptions.map((option, index) => (\n          <ActionList.Item key={option.text} selected={false} onSelect={() => toggle(option.text)}>\n            {option.text}\n          </ActionList.Item>\n        ))}\n        {hiddenOptions.length === 0 && <ActionList.Item disabled>No hidden fields</ActionList.Item>}\n      </ActionList.Group>\n    </ActionList>\n  )\n}\n\nrender(<SelectFields />)\n```\n\n## Props\n\n### ActionList\n\n<PropsTable>\n  <PropsTableRow name=\"children\" required type=\"ActionList.Item[] | ActionList.LinkItem[] | ActionList.Group[]\" />\n  <PropsTableRow\n    name=\"variant\"\n    type=\"'inset' | 'full'\"\n    defaultValue=\"'inset'\"\n    description={\n      <>\n        <InlineCode>inset</InlineCode> children are offset (vertically and horizontally) from list edges.{' '}\n        <InlineCode>full</InlineCode> children are flush (vertically and horizontally) with list edges\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"selectionVariant\"\n    type=\"'single' | 'multiple'\"\n    description=\"Whether multiple items or a single item can be selected.\"\n  />\n  <PropsTableRow\n    name=\"showDivider\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Display a divider above each item in this list when it does not follow a header or divider.\"\n  />\n  <PropsTableRow\n    name=\"role\"\n    type={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques#roles\">AriaRole</Link>\n    }\n    description={\n      <>\n        ARIA role describing the function of the list. <InlineCode>listbox</InlineCode> and{' '}\n        <InlineCode>menu</InlineCode> are a common values.\n      </>\n    }\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### ActionList.Item\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    required\n    type=\"React.ReactNode | ActionList.LeadingVisual | ActionList.Description | ActionList.TrailingVisual\"\n  />\n  <PropsTableRow\n    name=\"variant\"\n    type=\"'default' | 'danger'\"\n    defaultValue=\"'default'\"\n    description={\n      <>\n        <InlineCode>danger</InlineCode> indicates that the item is destructive.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"onSelect\"\n    type=\"(event: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLLIElement>) => void\"\n    description=\"Callback that is called when the item is selected using either the mouse or keyboard.\"\n  />\n  <PropsTableRow\n    name=\"selected\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Indicate whether the item is selected. Only applies to items that can be selected.\"\n  />\n  <PropsTableRow\n    name=\"active\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Indicate whether the item is active. There should never be more than one active item.\"\n  />\n  <PropsTableRow\n    name=\"disabled\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Items that are disabled can not be clicked, selected, or navigated to.\"\n  />\n  <PropsTableRow\n    name=\"role\"\n    type={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques#roles\">AriaRole</Link>\n    }\n    description={\n      <>\n        ARIA role describing the function of the item. <InlineCode>option</InlineCode> is a common value.\n      </>\n    }\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### ActionList.LinkItem\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    required\n    type=\"React.ReactNode | ActionList.LeadingVisual | ActionList.Description | ActionList.TrailingVisual\"\n  />\n  <PropsTableRow\n    name=\"active\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Indicate whether the item is active. There should never be more than one active item.\"\n  />\n  <PropsTableBasePropRows\n    elementType=\"a\"\n    isPolymorphic\n    refType=\"HTMLAnchorElement\"\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes\">MDN</Link>\n    }\n  />\n</PropsTable>\n\n### ActionList.LeadingVisual\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    required\n    type=\"React.ReactNode\"\n    description=\"Icon (or similar) positioned before item text.\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### ActionList.TrailingVisual\n\n<PropsTable>\n  <PropsTableRow name=\"children\" required type=\"React.ReactNode\" description=\"Visual positioned after item text.\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n### ActionList.Description\n\n<PropsTable>\n  <PropsTableRow name=\"children\" required type=\"React.ReactNode\" />\n  <PropsTableRow\n    name=\"variant\"\n    type=\"'inline' | 'block'\"\n    defaultValue=\"'inline'\"\n    description={\n      <>\n        <InlineCode>inline</InlineCode> descriptions are positioned beside primary text. <InlineCode>block</InlineCode>{' '}\n        descriptions are positioned below primary text.\n      </>\n    }\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### ActionList.Group\n\n<PropsTable>\n  <PropsTableRow name=\"children\" required type=\"ActionList.Item[] | ActionList.LinkItem[]\" />\n  <PropsTableRow name=\"title\" type=\"string\" description=\"Title of the group.\" />\n  <PropsTableRow\n    name=\"auxiliaryText\"\n    type=\"string\"\n    description=\"Secondary text that provides additional information about the group.\"\n  />\n  <PropsTableRow\n    name=\"variant\"\n    type=\"'filled' | 'subtle'\"\n    defaultValue=\"'subtle'\"\n    description={\n      <>\n        <InlineCode>inline</InlineCode> descriptions are positioned beside primary text. <InlineCode>block</InlineCode>{' '}\n        descriptions are positioned below primary text.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"selectionVariant\"\n    type=\"'single' | 'multiple' | false\"\n    description={\n      <>\n        Set <InlineCode>selectionVariant</InlineCode> at the group level.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"role\"\n    type={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques#roles\">AriaRole</Link>\n    }\n    description={\n      <>\n        ARIA role describing the function of the list inside the group. <InlineCode>listbox</InlineCode> and{' '}\n        <InlineCode>menu</InlineCode> are a common values.\n      </>\n    }\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: true,\n    a11yReviewed: true,\n    stableApi: false, // TODO: revisit on April 10, 2022\n    addressedApiFeedback: false,\n    hasDesignGuidelines: true,\n    hasFigmaComponent: true\n  }}\n/>\n\n## Further reading\n\n- [Interface guidelines: Action List](https://primer.style/design/components/action-list)\n\n## Related components\n\n- [ActionMenu](/ActionMenu)\n- [SelectPanel](/SelectPanel)\n","parent":{"relativeDirectory":"","name":"ActionList"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/ActionMenu.mdx","frontmatter":{"title":"ActionMenu"},"rawBody":"---\ncomponentId: action_menu\ntitle: ActionMenu\nstatus: Beta\nsource: https://github.com/primer/react/tree/main/src/ActionMenu.tsx\nstorybook: '/react/storybook?path=/story/composite-components-actionmenu'\ndescription: An ActionMenu is an ActionList-based component for creating a menu of actions that expands through a trigger button.\n---\n\nimport {Box, Avatar, ActionList, ActionMenu} from '@primer/react'\n\n<br />\n\n<Box sx={{border: '1px solid', borderColor: 'border.default', borderRadius: 2, padding: 6}}>\n  <ActionMenu>\n    <ActionMenu.Button>Menu</ActionMenu.Button>\n    <ActionMenu.Overlay>\n      <ActionList>\n        <ActionList.Item>\n          Copy link\n          <ActionList.TrailingVisual>⌘C</ActionList.TrailingVisual>\n        </ActionList.Item>\n        <ActionList.Item>\n          Quote reply\n          <ActionList.TrailingVisual>⌘Q</ActionList.TrailingVisual>\n        </ActionList.Item>\n        <ActionList.Item>\n          Edit comment\n          <ActionList.TrailingVisual>⌘E</ActionList.TrailingVisual>\n        </ActionList.Item>\n        <ActionList.Divider />\n        <ActionList.Item variant=\"danger\">\n          Delete file\n          <ActionList.TrailingVisual>⌘D</ActionList.TrailingVisual>\n        </ActionList.Item>\n      </ActionList>\n    </ActionMenu.Overlay>\n  </ActionMenu>\n</Box>\n\n<br />\n\n```js\nimport {ActionMenu} from '@primer/react'\n```\n\n<br />\n\n## Examples\n\n### Minimal example\n\n`ActionMenu` ships with `ActionMenu.Button` which is an accessible trigger for the overlay. It's recommended to compose `ActionList` with `ActionMenu.Overlay`\n\n&nbsp;\n\n```jsx live\n<ActionMenu>\n  <ActionMenu.Button>Menu</ActionMenu.Button>\n\n  <ActionMenu.Overlay>\n    <ActionList>\n      <ActionList.Item onSelect={event => console.log('New file')}>New file</ActionList.Item>\n      <ActionList.Item>Copy link</ActionList.Item>\n      <ActionList.Item>Edit file</ActionList.Item>\n      <ActionList.Divider />\n      <ActionList.Item variant=\"danger\">Delete file</ActionList.Item>\n    </ActionList>\n  </ActionMenu.Overlay>\n</ActionMenu>\n```\n\n### With a custom anchor\n\nYou can choose to have a different _anchor_ for the Menu dependending on the application's context.\n\n&nbsp;\n\n```jsx live\n<ActionMenu>\n  <ActionMenu.Anchor>\n    <IconButton icon={KebabHorizontalIcon} variant=\"invisible\" aria-label=\"Column options\" />\n  </ActionMenu.Anchor>\n\n  <ActionMenu.Overlay>\n    <ActionList>\n      <ActionList.Item>\n        <ActionList.LeadingVisual>\n          <PencilIcon />\n        </ActionList.LeadingVisual>\n        Rename\n      </ActionList.Item>\n      <ActionList.Item>\n        <ActionList.LeadingVisual>\n          <ArchiveIcon />\n        </ActionList.LeadingVisual>\n        Archive all cards\n      </ActionList.Item>\n      <ActionList.Item variant=\"danger\">\n        <ActionList.LeadingVisual>\n          <TrashIcon />\n        </ActionList.LeadingVisual>\n        Delete\n      </ActionList.Item>\n    </ActionList>\n  </ActionMenu.Overlay>\n</ActionMenu>\n```\n\n### With Groups\n\n```jsx live\n<ActionMenu>\n  <ActionMenu.Button>Open column menu</ActionMenu.Button>\n\n  <ActionMenu.Overlay>\n    <ActionList showDividers>\n      <ActionList.Group title=\"Live query\">\n        <ActionList.Item>\n          <ActionList.LeadingVisual>\n            <SearchIcon />\n          </ActionList.LeadingVisual>\n          repo:github/memex,github/github\n        </ActionList.Item>\n      </ActionList.Group>\n      <ActionList.Divider />\n      <ActionList.Group title=\"Layout\" variant=\"subtle\">\n        <ActionList.Item>\n          <ActionList.LeadingVisual>\n            <NoteIcon />\n          </ActionList.LeadingVisual>\n          Table\n          <ActionList.Description variant=\"block\">\n            Information-dense table optimized for operations across teams\n          </ActionList.Description>\n        </ActionList.Item>\n        <ActionList.Item role=\"listitem\">\n          <ActionList.LeadingVisual>\n            <ProjectIcon />\n          </ActionList.LeadingVisual>\n          Board\n          <ActionList.Description variant=\"block\">Kanban-style board focused on visual states</ActionList.Description>\n        </ActionList.Item>\n      </ActionList.Group>\n      <ActionList.Divider />\n      <ActionList.Group>\n        <ActionList.Item>\n          <ActionList.LeadingVisual>\n            <FilterIcon />\n          </ActionList.LeadingVisual>\n          Save sort and filters to current view\n        </ActionList.Item>\n        <ActionList.Item>\n          <ActionList.LeadingVisual>\n            <FilterIcon />\n          </ActionList.LeadingVisual>\n          Save sort and filters to new view\n        </ActionList.Item>\n      </ActionList.Group>\n      <ActionList.Divider />\n      <ActionList.Group>\n        <ActionList.Item>\n          <ActionList.LeadingVisual>\n            <GearIcon />\n          </ActionList.LeadingVisual>\n          View settings\n        </ActionList.Item>\n      </ActionList.Group>\n    </ActionList>\n  </ActionMenu.Overlay>\n</ActionMenu>\n```\n\n### With selection\n\nUse `selectionVariant` on `ActionList` to create a menu with single or multiple selection.\n\n```javascript live noinline\nconst fieldTypes = [\n  {icon: TypographyIcon, name: 'Text'},\n  {icon: NumberIcon, name: 'Number'},\n  {icon: CalendarIcon, name: 'Date'},\n  {icon: SingleSelectIcon, name: 'Single select'},\n  {icon: IterationsIcon, name: 'Iteration'}\n]\n\nconst Example = () => {\n  const [selectedIndex, setSelectedIndex] = React.useState(1)\n  const selectedType = fieldTypes[selectedIndex]\n\n  return (\n    <>\n      <Heading as=\"h2\" sx={{fontSize: 1, mb: 2}}>\n        Field type:\n      </Heading>\n      <ActionMenu>\n        <ActionMenu.Button aria-label={`Field type: ${selectedType.name}`} leadingIcon={selectedType.icon}>\n          {selectedType.name}\n        </ActionMenu.Button>\n        <ActionMenu.Overlay width=\"medium\">\n          <ActionList selectionVariant=\"single\" aria-label=\"Field type\">\n            {fieldTypes.map((type, index) => (\n              <ActionList.Item key={index} selected={index === selectedIndex} onSelect={() => setSelectedIndex(index)}>\n                <ActionList.LeadingVisual>\n                  <type.icon />\n                </ActionList.LeadingVisual>\n                {type.name}\n              </ActionList.Item>\n            ))}\n          </ActionList>\n        </ActionMenu.Overlay>\n      </ActionMenu>\n    </>\n  )\n}\n\nrender(<Example />)\n```\n\n### With External Anchor\n\nTo create an anchor outside of the menu, you need to switch to controlled mode for the menu and pass it as `anchorRef` to `ActionMenu`. Make sure you add `aria-expanded` and `aria-haspopup` to the external anchor.\n\nMake sure to add `aria-label` to `ActionList` with the purpose of the menu, example: \"File options\".\n\n```javascript live noinline\nconst Example = () => {\n  const [open, setOpen] = React.useState(false)\n  const anchorRef = React.createRef()\n\n  return (\n    <>\n      <Button ref={anchorRef} aria-haspopup=\"true\" aria-expanded={open} onClick={() => setOpen(!open)}>\n        {open ? 'Close Menu' : 'Open Menu'}\n      </Button>\n\n      <ActionMenu aria-label=\"File options\" open={open} onOpenChange={setOpen} anchorRef={anchorRef}>\n        <ActionMenu.Overlay>\n          <ActionList>\n            <ActionList.Item>Copy link</ActionList.Item>\n            <ActionList.Item>Quote reply</ActionList.Item>\n            <ActionList.Item>Edit comment</ActionList.Item>\n            <ActionList.Divider />\n            <ActionList.Item variant=\"danger\">Delete file</ActionList.Item>\n          </ActionList>\n        </ActionMenu.Overlay>\n      </ActionMenu>\n    </>\n  )\n}\n\nrender(<Example />)\n```\n\n### With Overlay Props\n\nTo create an anchor outside of the menu, you need to switch to controlled mode for the menu and pass it as `anchorRef` to `ActionMenu`:\n\n```javascript live noinline\nconst handleEscape = () => alert('you hit escape!')\n\nrender(\n  <ActionMenu>\n    <ActionMenu.Button>Actions Menu</ActionMenu.Button>\n    <ActionMenu.Overlay width=\"medium\" onEscape={handleEscape}>\n      <ActionList>\n        <ActionList.Item>\n          Open current Codespace\n          <ActionList.Description variant=\"block\">\n            Your existing Codespace will be opened to its previous state, and you&apos;ll be asked to manually switch to\n            new-branch.\n          </ActionList.Description>\n          <ActionList.TrailingVisual>⌘O</ActionList.TrailingVisual>\n        </ActionList.Item>\n        <ActionList.Item>\n          Create new Codespace\n          <ActionList.Description variant=\"block\">\n            Create a brand new Codespace with a fresh image and checkout this branch.\n          </ActionList.Description>\n          <ActionList.TrailingVisual>⌘C</ActionList.TrailingVisual>\n        </ActionList.Item>\n      </ActionList>\n    </ActionMenu.Overlay>\n  </ActionMenu>\n)\n```\n\n## Accessibility\n\n### Single Selection\n\nFor menus with selection, it's common to show the selected value in the button. To give context to the user, it's important to show the purpose of the menu as well.\n\nVisually, this can be an external label above the button or an inline label inside the button. In both cases, the label for screen readers should have both purpose and value, example: \"Field type: Number\".\n\nIf you have an external label, you can achieve that by adding an `aria-label` to `ActionMenu.Button` which contains both the purpose and current selected value, example: _\"Field type: Number\"_. In addition to that, you must also add `aria-labelledby` to the `ActionList` with the id of the external label to indicate the purpose of the menu.\n\nAlternatively, you can add an inline label by passing `label` to `ActionMenu.Button` instead of `aria-label`, example: _\"Field type\"_, which will add the correct `aria-label` (_Field type: Number_) on the button and `aria-labelledby` (_Field type_) on the menu for you.\n\n```javascript live noinline\nconst fieldTypes = [\n  {icon: TypographyIcon, name: 'Text'},\n  {icon: NumberIcon, name: 'Number'},\n  {icon: CalendarIcon, name: 'Date'},\n  {icon: SingleSelectIcon, name: 'Single select'},\n  {icon: IterationsIcon, name: 'Iteration'}\n]\n\nconst ExternalLabel = () => {\n  const [selectedIndex, setSelectedIndex] = React.useState(1)\n  const selectedType = fieldTypes[selectedIndex]\n\n  return (\n    <>\n      <Heading as=\"h2\" id=\"purpose\" sx={{fontSize: 1, mb: 2}}>\n        Field type\n      </Heading>\n      <ActionMenu>\n        <ActionMenu.Button aria-label={`Field type: ${selectedType.name}`} leadingIcon={selectedType.icon}>\n          {selectedType.name}\n        </ActionMenu.Button>\n        <ActionMenu.Overlay width=\"medium\">\n          <ActionList selectionVariant=\"single\" aria-labelledby=\"purpose\">\n            {fieldTypes.map((type, index) => (\n              <ActionList.Item key={index} selected={index === selectedIndex} onSelect={() => setSelectedIndex(index)}>\n                <ActionList.LeadingVisual>\n                  <type.icon />\n                </ActionList.LeadingVisual>\n                {type.name}\n              </ActionList.Item>\n            ))}\n          </ActionList>\n        </ActionMenu.Overlay>\n      </ActionMenu>\n    </>\n  )\n}\n\nconst InlineLabel = () => {\n  const [selectedIndex, setSelectedIndex] = React.useState(1)\n  const selectedType = fieldTypes[selectedIndex]\n\n  return (\n    <ActionMenu>\n      <ActionMenu.Button label=\"Field type\" leadingIcon={selectedType.icon}>\n        {selectedType.name}\n      </ActionMenu.Button>\n      <ActionMenu.Overlay width=\"medium\">\n        <ActionList selectionVariant=\"single\">\n          {fieldTypes.map((type, index) => (\n            <ActionList.Item key={index} selected={index === selectedIndex} onSelect={() => setSelectedIndex(index)}>\n              <ActionList.LeadingVisual>\n                <type.icon />\n              </ActionList.LeadingVisual>\n              {type.name}\n            </ActionList.Item>\n          ))}\n        </ActionList>\n      </ActionMenu.Overlay>\n    </ActionMenu>\n  )\n}\n\nrender(\n  <div style={{display: 'flex', alignItems: 'end'}}>\n    <div style={{width: '50%'}}>\n      <ExternalLabel />\n    </div>\n    <div style={{width: '50%'}}>\n      <InlineLabel />\n    </div>\n  </div>\n)\n```\n\n## Props / API reference\n\n### ActionMenu\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    required\n    type=\"React.ReactElement[]\"\n    description={\n      <>\n        Recommended: <InlineCode>ActionMenu.Button</InlineCode> or <InlineCode>ActionMenu.Anchor</InlineCode> with{' '}\n        <InlineCode>ActionMenu.Overlay</InlineCode>\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"open\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description={\n      <>\n        If defined, will control the open/closed state of the overlay. Must be used in conjuction with{' '}\n        <InlineCode>onOpenChange</InlineCode>.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"onOpenChange\"\n    type=\"(open: boolean) => void\"\n    description={\n      <>\n        If defined, will control the open/closed state of the overlay. Must be used in conjuction with{' '}\n        <InlineCode>open</InlineCode>.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"anchorRef\"\n    type=\"React.RefObject<HTMLElement>\"\n    description=\"Useful for defining an external anchor\"\n  />\n</PropsTable>\n\n### ActionMenu.Button\n\n<PropsTable>\n  <PropsTableRow name=\"children\" required type=\"React.ReactElement\" />\n  <PropsTableRow name=\"aria-label\" type=\"string\" description=\"Label for button, also used to label the menu\" />\n  <PropsTableRow name=\"label\" type=\"string\" description=\"Add an inline label, as a replacement for aria-label\" />\n  <PropsTablePassthroughPropsRow\n    elementName=\"Button\"\n    isPolymorphic\n    passthroughPropsLink={<Link href=\"/react/Button\">Button docs</Link>}\n  />\n</PropsTable>\n\n### ActionMenu.Anchor\n\n<PropsTable>\n  <PropsTableRow name=\"children\" required type=\"React.ReactElement\" description=\"Accepts a single child element\" />\n</PropsTable>\n\n### ActionMenu.Overlay\n\n<PropsTable>\n  <PropsTableRow name=\"children\" required type=\"React.ReactElement | React.ReactElement[]\" />\n  <PropsTableRow name=\"align\" type=\"start | center | end\" defaultValue=\"start\" />\n  <PropsTablePassthroughPropsRow\n    elementName=\"Overlay\"\n    passthroughPropsLink={<Link href=\"/react/Overlay\">Overlay docs</Link>}\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: true,\n    a11yReviewed: true,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: true,\n    hasFigmaComponent: true\n  }}\n/>\n\n## Further reading\n\n[Interface guidelines: Action List + Menu](https://primer.style/design/components/action-list)\n\n## Related components\n\n- [ActionList](/ActionList)\n- [SelectPanel](/SelectPanel)\n- [Button](/Button)\n","parent":{"relativeDirectory":"","name":"ActionMenu"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/AnchoredOverlay.mdx","frontmatter":{"title":"AnchoredOverlay"},"rawBody":"---\ncomponentId: anchored_overlay\ntitle: AnchoredOverlay\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/AnchoredOverlay/AnchoredOverlay.tsx\nstorybook: https://primer.style/react/storybook?path=/story/generic-behaviors-anchoredoverlay--default-portal\n---\n\nAn `AnchoredOverlay` provides an anchor that will open a floating overlay positioned relative to the anchor.\nThe overlay can be opened and navigated using keyboard or mouse.\n\nSee also [Overlay positioning](/Overlay#positioning).\n\n## Examples\n\n```jsx live\n<State default={false}>\n  {([isOpen, setIsOpen]) => {\n    const openOverlay = React.useCallback(() => setIsOpen(true), [setIsOpen])\n    const closeOverlay = React.useCallback(() => setIsOpen(false), [setIsOpen])\n    return (\n      <AnchoredOverlay\n        renderAnchor={anchorProps => (\n          <Button {...anchorProps} trailingIcon={TriangleDownIcon}>\n            Click me to open\n          </Button>\n        )}\n        open={isOpen}\n        onOpen={openOverlay}\n        onClose={closeOverlay}\n      >\n        <Box display=\"flex\" flexDirection=\"column\" maxWidth=\"300px\" padding={2}>\n          <p>\n            This menu automatically receives a focus trap and focus zone. Use up/down keys to navigate between buttons\n          </p>\n          <Button mb={1}>Button 1</Button>\n          <Button mb={1}>Button 2</Button>\n          <Button>Button 3</Button>\n        </Box>\n      </AnchoredOverlay>\n    )\n  }}\n</State>\n```\n\n## Props\n\n<PropsTable>\n  <PropsTableRow\n    name=\"open\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Determines whether the overlay portion of the component should be shown or not.\"\n  />\n  <PropsTableRow\n    name=\"onOpen\"\n    type=\"(gesture: 'anchor-click' | 'anchor-key-press') => unknown\"\n    description='A callback that is called whenever the overlay is currently closed and an \"open gesture\" is detected.'\n  />\n  <PropsTableRow\n    name=\"onClose\"\n    type=\"(gesture: 'anchor-click' | 'click-outside' | 'escape') => unknown\"\n    description='A callback that is called whenever the overlay is currently open and a \"close gesture\" is detected.'\n  />\n  <PropsTableRow\n    name=\"renderAnchor\"\n    type=\"<T extends React.HTMLAttributes<HTMLElement>>(props: T) => JSX.Element\"\n    description={\n      <>\n        A custom function component used to render the anchor element. When renderAnchor is null, an anchorRef is\n        required.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"anchorRef\"\n    type=\"React.RefObject<HTMLElement>\"\n    description={\n      <>\n        An override to the internal <InlineCode>renderAnchor</InlineCode> ref that will be used to position the overlay.\n        When <InlineCode>renderAnchor</InlineCode> is\n        <InlineCode>null</InlineCode>, this can be used to make an anchor that is detached from <InlineCode>\n          AnchoredOverlay\n        </InlineCode>.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"anchorId\"\n    type=\"string\"\n    description=\"An override to the internal id that will be passed to the anchor.\"\n  />\n  <PropsTableRow\n    name=\"side\"\n    type={`| 'inside-top' \n| 'inside-bottom' \n| 'inside-left' \n| 'inside-right' \n| 'inside-center' \n| 'outside-top' \n| 'outside-bottom' \n| 'outside-left' \n| 'outside-right'`}\n    defaultValue=\"'outside-bottom'\"\n  />\n  <PropsTableRow name=\"align\" type=\"'start' | 'center' | 'end'\" defaultValue=\"'start'\" />\n  <PropsTableRow\n    name=\"overlayProps\"\n    type={\n      <>\n        Partial&lt;<Link href=\"/react/Overlay#props\">OverlayProps</Link>&gt;\n      </>\n    }\n    description={\n      <>\n        Props to be spread on the internal <InlineCode>Overlay</InlineCode> component.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"focusTrapSettings\"\n    type={\n      <>\n        Partial&lt;<Link href=\"/react/focusTrap#focustraphooksettings-interface\">FocusTrapHookSettings</Link>&gt;\n      </>\n    }\n    description={\n      <>\n        Settings to apply to the focus trap on the internal <InlineCode>Overlay</InlineCode> component.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"focusZoneSettings\"\n    type={\n      <>\n        Partial&lt;<Link href=\"/react/focusZone#focuszonehooksettings-interface\">FocusZoneHookSettings</Link>&gt;\n      </>\n    }\n    description={\n      <>\n        Settings to apply to the focus zone on the internal <InlineCode>Overlay</InlineCode> component.\n      </>\n    }\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: false,\n    usedInProduction: true,\n    usageExamplesDocumented: false,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"AnchoredOverlay"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Autocomplete.mdx","frontmatter":{"title":"Autocomplete"},"rawBody":"---\ncomponentId: autocomplete\ntitle: Autocomplete\nstatus: Alpha\ndescription: Used to render a text input that allows a user to quickly filter through a list of options to pick one or more values.\nsource: https://github.com/primer/react/tree/main/src/Autocomplete\nstorybook: '/react/storybook?path=/story/forms-autocomplete--single-select'\n---\n\nimport {Autocomplete} from '@primer/react'\n\nThe `Autocomplete` component is comprised of an `Autocomplete.Input` component that a user types into, and a `Autocomplete.Menu` component that displays the list of selectable values.\n\n## Anatomy\n\n### Autocomplete.Input\n\nThe text input is used to filter the options in the dropdown menu. It is also used to show the selected value (or values).\n\nThe default input rendered is the `TextInput` component. A different text input component may be rendered by passing a different component to the `as` prop.\n\nThe `Autocomplete.Input` should not be rendered without a `<label>` who's `htmlFor` prop matches the `Autocomplete.Input`'s `id` prop\n\n### Autocomplete.Overlay\n\nThe `Autocomplete.Overlay` wraps the `Autocomplete.Menu` to display it in an [Overlay](./Overlay) component.\nThis component takes the same props as the `Overlay` component.\nMost `Autocomplete` implementations will use the `Autocomplete.Overlay` component, but there could be special cases where the `Autocomplete.Menu` should be rendered directly after the `Autocomplete.Input` (for example: an `Autocomplete` that is already being rendered in an `Overlay`).\n\n### Autocomplete.Menu\n\nThe `Autocomplete.Menu` component renders a list of selectable options in a non-modal dialog. The list is filtered and sorted to make it as easy as possible to find the option/s that a user is looking for.\n\nThe `Autocomplete.Menu` component should be passed an `aria-labelledby` prop that matches the `id` prop of the `<label>` associated with the `Autocomplete.Input`\n\n#### Customizing how menu items are rendered\n\nBy default, menu items are just rendered as a single line of text. The list in the menu is rendered using the [Action List](/ActionList) component, so menu items can be rendered with all of the same options as Action List items.\nHowever, the `renderGroup`, `groupMetadata`, and `renderItem` props have not been implemented yet.\n\n#### Sorting menu items\n\nItems can be displayed in any order that makes sense, but the `Autocomplete.Menu` component comes with a default sort behavior to make it easy to find selected items. The default behavior is to sort selected items to the top of the list after the menu has been closed.\n\nA function may be passed to the `sortOnCloseFn` prop if this default sorting logic is not helpful for your use case. The sort function will be only be called after the menu is closed so that items don't shift while users are trying to make a selection.\n\n#### Filtering menu items\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\nA function may be passed to the `filterFn` prop if this default filtering behavior does not make sense for your use case.\n\n## Examples\n\n### Basic example\n\n```jsx live\n<FormControl>\n  <FormControl.Label>Pick a branch</FormControl.Label>\n  <Autocomplete>\n    <Autocomplete.Input />\n    <Autocomplete.Overlay>\n      <Autocomplete.Menu\n        items={[\n          {text: 'main', id: 0},\n          {text: 'autocomplete-tests', id: 1},\n          {text: 'a11y-improvements', id: 2},\n          {text: 'button-bug-fixes', id: 3},\n          {text: 'radio-input-component', id: 4},\n          {text: 'release-1.0.0', id: 5},\n          {text: 'text-input-implementation', id: 6},\n          {text: 'visual-design-tweaks', id: 7}\n        ]}\n        selectedItemIds={[]}\n      />\n    </Autocomplete.Overlay>\n  </Autocomplete>\n</FormControl>\n```\n\n### Autocomplete.Input with a custom text input\n\nIn this example, we're passing a [TextInputWithTokens](/TextInputWithTokens) component\n\n```javascript live noinline\nconst CustomTextInputExample = () => {\n  const [tokens, setTokens] = React.useState([{text: 'zero', id: 0}])\n  const selectedTokenIds = tokens.map(token => token.id)\n  const [selectedItemIds, setSelectedItemIds] = React.useState(selectedTokenIds)\n  const onTokenRemove = tokenId => {\n    setTokens(tokens.filter(token => token.id !== tokenId))\n    setSelectedItemIds(selectedItemIds.filter(id => id !== tokenId))\n  }\n  const onSelectedChange = newlySelectedItems => {\n    if (!Array.isArray(newlySelectedItems)) {\n      return\n    }\n\n    setSelectedItemIds(newlySelectedItems.map(item => item.id))\n\n    if (newlySelectedItems.length < selectedItemIds.length) {\n      const newlySelectedItemIds = newlySelectedItems.map(({id}) => id)\n      const removedItemIds = selectedTokenIds.filter(id => !newlySelectedItemIds.includes(id))\n\n      for (const removedItemId of removedItemIds) {\n        onTokenRemove(removedItemId)\n      }\n\n      return\n    }\n\n    setTokens(newlySelectedItems.map(({id, text}) => ({id, text})))\n  }\n\n  return (\n    <FormControl>\n      <FormControl.Label>Pick options</FormControl.Label>\n      <Autocomplete>\n        <Autocomplete.Input as={TextInputWithTokens} tokens={tokens} onTokenRemove={onTokenRemove} />\n        <Autocomplete.Overlay>\n          <Autocomplete.Menu\n            items={[\n              {text: 'zero', id: 0},\n              {text: 'one', id: 1},\n              {text: 'two', id: 2},\n              {text: 'three', id: 3},\n              {text: 'four', id: 4},\n              {text: 'five', id: 5},\n              {text: 'six', id: 6},\n              {text: 'seven', id: 7}\n            ]}\n            selectedItemIds={selectedItemIds}\n            onSelectedChange={onSelectedChange}\n            selectionVariant=\"multiple\"\n          />\n        </Autocomplete.Overlay>\n      </Autocomplete>\n    </FormControl>\n  )\n}\n\nrender(<CustomTextInputExample />)\n```\n\n### Without `Autocomplete.Overlay`\n\n```jsx live\n<FormControl>\n  <FormControl.Label>Pick a branch</FormControl.Label>\n  <Autocomplete>\n    <Autocomplete.Input />\n    <Autocomplete.Menu\n      items={[\n        {text: 'main', id: 0},\n        {text: 'autocomplete-tests', id: 1},\n        {text: 'a11y-improvements', id: 2},\n        {text: 'button-bug-fixes', id: 3},\n        {text: 'radio-input-component', id: 4},\n        {text: 'release-1.0.0', id: 5},\n        {text: 'text-input-implementation', id: 6},\n        {text: 'visual-design-tweaks', id: 7}\n      ]}\n      selectedItemIds={[]}\n    />\n  </Autocomplete>\n</FormControl>\n```\n\n#### Render items using `ActionList.Item` props\n\n```javascript live noinline\nfunction getColorCircle(color) {\n  return function () {\n    return (\n      <Box\n        bg={color}\n        borderColor={color}\n        width={14}\n        height={14}\n        borderRadius={10}\n        margin=\"auto\"\n        borderWidth=\"1px\"\n        borderStyle=\"solid\"\n      />\n    )\n  }\n}\n\nconst CustomRenderedItemExample = () => {\n  const [tokens, setTokens] = React.useState([\n    {text: 'enhancement', id: 1, fillColor: '#a2eeef'},\n    {text: 'bug', id: 2, fillColor: '#d73a4a'},\n    {text: 'good first issue', id: 3, fillColor: '#0cf478'}\n  ])\n  const selectedTokenIds = tokens.map(token => token.id)\n  const [selectedItemIds, setSelectedItemIds] = React.useState(selectedTokenIds)\n  const onTokenRemove = tokenId => {\n    setTokens(tokens.filter(token => token.id !== tokenId))\n    setSelectedItemIds(selectedItemIds.filter(id => id !== tokenId))\n  }\n  const onSelectedChange = newlySelectedItems => {\n    if (!Array.isArray(newlySelectedItems)) {\n      return\n    }\n\n    setSelectedItemIds(newlySelectedItems.map(item => item.id))\n\n    if (newlySelectedItems.length < selectedItemIds.length) {\n      const newlySelectedItemIds = newlySelectedItems.map(({id}) => id)\n      const removedItemIds = selectedTokenIds.filter(id => !newlySelectedItemIds.includes(id))\n\n      for (const removedItemId of removedItemIds) {\n        onTokenRemove(removedItemId)\n      }\n\n      return\n    }\n\n    setTokens(newlySelectedItems.map(({id, text, metadata}) => ({id, text, fillColor: metadata.fillColor})))\n  }\n\n  return (\n    <FormControl>\n      <FormControl.Label>Pick labels</FormControl.Label>\n      <Autocomplete>\n        <Autocomplete.Input\n          as={TextInputWithTokens}\n          tokens={tokens}\n          tokenComponent={IssueLabelToken}\n          onTokenRemove={onTokenRemove}\n        />\n        <Autocomplete.Overlay>\n          <Autocomplete.Menu\n            items={[\n              {leadingVisual: getColorCircle('#a2eeef'), text: 'enhancement', id: 1, metadata: {fillColor: '#a2eeef'}},\n              {leadingVisual: getColorCircle('#d73a4a'), text: 'bug', id: 2, metadata: {fillColor: '#d73a4a'}},\n              {\n                leadingVisual: getColorCircle('#0cf478'),\n                text: 'good first issue',\n                id: 3,\n                metadata: {fillColor: '#0cf478'}\n              },\n              {leadingVisual: getColorCircle('#ffd78e'), text: 'design', id: 4, metadata: {fillColor: '#ffd78e'}},\n              {leadingVisual: getColorCircle('#ff0000'), text: 'blocker', id: 5, metadata: {fillColor: '#ff0000'}},\n              {leadingVisual: getColorCircle('#a4f287'), text: 'backend', id: 6, metadata: {fillColor: '#a4f287'}},\n              {leadingVisual: getColorCircle('#8dc6fc'), text: 'frontend', id: 7, metadata: {fillColor: '#8dc6fc'}}\n            ]}\n            selectedItemIds={selectedItemIds}\n            onSelectedChange={onSelectedChange}\n            selectionVariant=\"multiple\"\n            aria-labelledby=\"autocompleteLabel-issueLabels\"\n          />\n        </Autocomplete.Overlay>\n      </Autocomplete>\n    </FormControl>\n  )\n}\n\nrender(<CustomRenderedItemExample />)\n```\n\n#### Customize sort when the menu is re-opened\n\nIn this example, selected items get sorted to the end. By default, they are sorted to the beginning.\n\n```javascript live noinline\nconst CustomSortAfterMenuClose = () => {\n  const [selectedItemIds, setSelectedItemIds] = React.useState([])\n  const isItemSelected = itemId => selectedItemIds.includes(itemId)\n  const onSelectedChange = newlySelectedItems => {\n    if (!Array.isArray(newlySelectedItems)) {\n      return\n    }\n\n    setSelectedItemIds(newlySelectedItems.map(item => item.id))\n  }\n  const customSortFn = (itemIdA, itemIdB) =>\n    isItemSelected(itemIdA) === isItemSelected(itemIdB) ? 0 : isItemSelected(itemIdA) ? 1 : -1\n\n  return (\n    <FormControl>\n      <FormControl.Label>Pick branches</FormControl.Label>\n      <Autocomplete>\n        <Autocomplete.Input id=\"autocompleteInput-sortAfterClose\" />\n        <Autocomplete.Overlay>\n          <Autocomplete.Menu\n            items={[\n              {text: 'main', id: 0},\n              {text: 'autocomplete-tests', id: 1},\n              {text: 'a11y-improvements', id: 2},\n              {text: 'button-bug-fixes', id: 3},\n              {text: 'radio-input-component', id: 4},\n              {text: 'release-1.0.0', id: 5},\n              {text: 'text-input-implementation', id: 6},\n              {text: 'visual-design-tweaks', id: 7}\n            ]}\n            selectedItemIds={selectedItemIds}\n            aria-labelledby=\"autocompleteLabel-sortAfterClose\"\n            onSelectedChange={onSelectedChange}\n            sortOnCloseFn={customSortFn}\n            selectionVariant=\"multiple\"\n          />\n        </Autocomplete.Overlay>\n      </Autocomplete>\n    </FormControl>\n  )\n}\n\nrender(<CustomSortAfterMenuClose />)\n```\n\n#### Custom filtering\n\nIn this example, we show any items who's `text` **contains** the input value. By default, we only show items that start with the input value.\n\n```javascript live noinline\nconst CustomSearchFilter = () => {\n  const [filterVal, setFilterVal] = React.useState('')\n  const handleChange = event => {\n    setFilterVal(event.currentTarget.value)\n  }\n  const customFilterFn = item => item.text.includes(filterVal)\n\n  return (\n    <FormControl>\n      <FormControl.Label>Pick a branch</FormControl.Label>\n      <Autocomplete>\n        <Autocomplete.Input id=\"autocompleteInput-customFilter\" onChange={handleChange} />\n        <Autocomplete.Overlay>\n          <Autocomplete.Menu\n            items={[\n              {text: 'main', id: 0},\n              {text: 'autocomplete-tests', id: 1},\n              {text: 'a11y-improvements', id: 2},\n              {text: 'button-bug-fixes', id: 3},\n              {text: 'radio-input-component', id: 4},\n              {text: 'release-1.0.0', id: 5},\n              {text: 'text-input-implementation', id: 6},\n              {text: 'visual-design-tweaks', id: 7}\n            ]}\n            selectedItemIds={[]}\n            aria-labelledby=\"autocompleteLabel-customFilter\"\n            filterFn={customFilterFn}\n          />\n        </Autocomplete.Overlay>\n      </Autocomplete>\n    </FormControl>\n  )\n}\n\nrender(<CustomSearchFilter />)\n```\n\n#### Rendered without `Autocomplete.Overlay` with a `customScrollContainerRef`\n\nIf a `Autocomplete.Menu` is rendered without an `Autocomplete.Overlay` inside of a scrollable container, the ref of the scrollable container must be passed to the `customScrollContainerRef` to ensure that highlighted items are always scrolled into view.\n\n```javascript live noinline\nconst InOverlayWithCustomScrollContainerRef = () => {\n  const scrollContainerRef = React.useRef(null)\n  const inputRef = React.useRef(null)\n\n  const [isOpen, setIsOpen] = React.useState(false)\n  const handleOpen = () => {\n    setIsOpen(true)\n    inputRef.current && inputRef.current.focus()\n  }\n\n  return (\n    <AnchoredOverlay\n      open={isOpen}\n      onOpen={handleOpen}\n      onClose={() => setIsOpen(false)}\n      width=\"large\"\n      height=\"xsmall\"\n      focusTrapSettings={{initialFocusRef: inputRef}}\n      side=\"inside-top\"\n      renderAnchor={props => (\n        <Button variant=\"invisible\" {...props}>\n          Pick branches\n        </Button>\n      )}\n    >\n      <FormControl>\n        <FormControl.Label visuallyHidden>Pick branches</FormControl.Label>\n        <Autocomplete>\n          <Box display=\"flex\" flexDirection=\"column\" height=\"100%\">\n            <Box\n              paddingX=\"3\"\n              paddingY=\"1\"\n              borderWidth={0}\n              borderBottomWidth={1}\n              borderColor=\"border.default\"\n              borderStyle=\"solid\"\n            >\n              <Autocomplete.Input\n                block\n                as={TextInput}\n                ref={inputRef}\n                id=\"autocompleteInput\"\n                sx={{\n                  display: 'flex',\n                  border: '0',\n                  padding: '0',\n                  boxShadow: 'none',\n                  ':focus-within': {\n                    border: '0',\n                    boxShadow: 'none'\n                  }\n                }}\n              />\n            </Box>\n            <Box overflow=\"auto\" flexGrow={1} ref={scrollContainerRef}>\n              <Autocomplete.Menu\n                items={[\n                  {text: 'main', id: 0},\n                  {text: 'autocomplete-tests', id: 1},\n                  {text: 'a11y-improvements', id: 2},\n                  {text: 'button-bug-fixes', id: 3},\n                  {text: 'radio-input-component', id: 4},\n                  {text: 'release-1.0.0', id: 5},\n                  {text: 'text-input-implementation', id: 6},\n                  {text: 'visual-design-tweaks', id: 7}\n                ]}\n                selectedItemIds={[]}\n                customScrollContainerRef={scrollContainerRef}\n                aria-labelledby=\"autocompleteLabel\"\n              />\n            </Box>\n          </Box>\n        </Autocomplete>\n      </FormControl>\n    </AnchoredOverlay>\n  )\n}\n\nrender(<InOverlayWithCustomScrollContainerRef />)\n```\n\n#### Select multiple values\n\n```javascript live noinline\nconst MultiSelect = () => {\n  const items = [\n    {text: 'main', id: 0},\n    {text: 'autocomplete-tests', id: 1},\n    {text: 'a11y-improvements', id: 22},\n    {text: 'button-bug-fixes', id: 3},\n    {text: 'radio-input-component', id: 4},\n    {text: 'release-1.0.0', id: 5},\n    {text: 'text-input-implementation', id: 6},\n    {text: 'visual-design-tweaks', id: 7}\n  ]\n  const [selectedItemIds, setSelectedItemIds] = React.useState([])\n  const onSelectedChange = newlySelectedItems => {\n    if (!Array.isArray(newlySelectedItems)) {\n      return\n    }\n\n    setSelectedItemIds(newlySelectedItems.map(item => item.id))\n  }\n\n  const getItemById = id => items.find(item => item.id === id)\n\n  return (\n    <Box display=\"flex\" flexDirection=\"column\" sx={{gap: '1em'}}>\n      <FormControl>\n        <FormControl.Label>Pick branches</FormControl.Label>\n        <Autocomplete>\n          <Autocomplete.Input id=\"autocompleteInput\" />\n          <Autocomplete.Overlay>\n            <Autocomplete.Menu\n              items={items}\n              selectedItemIds={selectedItemIds}\n              aria-labelledby=\"autocompleteLabel\"\n              onSelectedChange={onSelectedChange}\n              selectionVariant=\"multiple\"\n            />\n          </Autocomplete.Overlay>\n        </Autocomplete>\n      </FormControl>\n      <div>\n        <div>Selected items:</div>\n        <Box as=\"ul\" my={0}>\n          {selectedItemIds.map(selectedItemId => (\n            <li key={selectedItemId}>{getItemById(selectedItemId).text}</li>\n          ))}\n        </Box>\n      </div>\n    </Box>\n  )\n}\n\nrender(<MultiSelect />)\n```\n\n#### Select multiple values - new values can be added\n\n```javascript live noinline\nconst MultiSelectAddNewItem = () => {\n  const [selectedItemIds, setSelectedItemIds] = React.useState([])\n  const onSelectedChange = newlySelectedItems => {\n    if (!Array.isArray(newlySelectedItems)) {\n      return\n    }\n\n    setSelectedItemIds(newlySelectedItems.map(item => item.id))\n  }\n\n  const [localItemsState, setLocalItemsState] = React.useState([\n    {text: 'main', id: 0},\n    {text: 'autocomplete-tests', id: 1},\n    {text: 'a11y-improvements', id: 22},\n    {text: 'button-bug-fixes', id: 3},\n    {text: 'radio-input-component', id: 4},\n    {text: 'release-1.0.0', id: 5},\n    {text: 'text-input-implementation', id: 6},\n    {text: 'visual-design-tweaks', id: 7}\n  ])\n  const getItemById = id => localItemsState.find(item => item.id === id)\n  const [filterVal, setFilterVal] = React.useState('')\n\n  const onItemSelect = item => {\n    onSelectedChange([...selectedItemIds.map(id => localItemsState.find(selectedItem => selectedItem.id === id)), item])\n\n    if (!localItemsState.some(localItem => localItem.id === item.id)) {\n      setLocalItemsState([...localItemsState, item])\n    }\n  }\n\n  const handleChange = event => {\n    setFilterVal(event.currentTarget.value)\n  }\n\n  return (\n    <Box display=\"flex\" flexDirection=\"column\" sx={{gap: '1em'}}>\n      <FormControl>\n        <FormControl.Label>Pick or add branches</FormControl.Label>\n        <Autocomplete>\n          <Autocomplete.Input onChange={handleChange} id=\"autocompleteInput\" />\n          <Autocomplete.Overlay>\n            <Autocomplete.Menu\n              addNewItem={\n                filterVal && !localItemsState.map(localItem => localItem.text).includes(filterVal)\n                  ? {\n                      text: `Add '${filterVal}'`,\n                      handleAddItem: item => {\n                        onItemSelect({\n                          ...item,\n                          text: filterVal,\n                          selected: true\n                        })\n                        setFilterVal('')\n                      }\n                    }\n                  : undefined\n              }\n              items={localItemsState}\n              selectedItemIds={selectedItemIds}\n              onSelectedChange={onSelectedChange}\n              selectionVariant=\"multiple\"\n              aria-labelledby=\"autocompleteLabel\"\n            />\n          </Autocomplete.Overlay>\n        </Autocomplete>\n      </FormControl>\n      <div>\n        <div>Selected items:</div>\n        <Box as=\"ul\" my={0}>\n          {selectedItemIds.map(selectedItemId => (\n            <li key={selectedItemId}>{getItemById(selectedItemId).text}</li>\n          ))}\n        </Box>\n      </div>\n    </Box>\n  )\n}\n\nrender(<MultiSelectAddNewItem />)\n```\n\n## Props\n\n### Autocomplete.Input\n\n<PropsTable>\n  <PropsTableAsRow defaultElementType=\"TextInput\" />\n  <PropsTablePassthroughPropsRow\n    elementName=\"TextInput\"\n    isPolymorphic\n    passthroughPropsLink={\n      <>\n        the <Link href=\"/react/TextInput\">TextInput docs</Link>\n      </>\n    }\n  />\n</PropsTable>\n\n<Props of={Autocomplete.Overlay} />\n\n<Props of={Autocomplete.Menu} />\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: false,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: true,\n    hasFigmaComponent: true\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Autocomplete"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Avatar.mdx","frontmatter":{"title":"Avatar"},"rawBody":"---\ntitle: Avatar\nstatus: Alpha\ncomponentId: avatar\nsource: https://github.com/primer/react/blob/main/src/Avatar.tsx\n---\n\nimport {Avatar, Box} from '@primer/react'\n\n```js\nimport {Avatar} from '@primer/react'\n```\n\n## Examples\n\n### Default\n\n```jsx live\n<Avatar src=\"https://avatars.githubusercontent.com/primer\" />\n```\n\n### Square\n\n```jsx live\n<Avatar square src=\"https://avatars.githubusercontent.com/primer\" />\n```\n\n## Props\n\n### Avatar\n\n<PropsTable>\n  <PropsTableRow name=\"src\" type=\"string\" required description=\"URL of the avatar image.\" />{' '}\n  <PropsTableRow\n    name=\"alt\"\n    type=\"string\"\n    defaultValue=\"''\"\n    description=\"Provide alt text when the avatar is used without a name next to it.\"\n  />\n  <PropsTableRow name=\"size\" type=\"number\" defaultValue=\"20\" description=\"The size of the avatar in pixels.\" />\n  <PropsTableRow\n    name=\"square\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"If true, the avatar will be square instead of circular.\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: false,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Avatar"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/AvatarPair.mdx","frontmatter":{"title":"AvatarPair"},"rawBody":"---\ncomponentId: avatar_pair\ntitle: AvatarPair\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/AvatarPair.tsx\n---\n\n```js\nimport {AvatarPair} from '@primer/react'\n```\n\n## Examples\n\n```jsx live\n<AvatarPair>\n  <Avatar src=\"https://avatars.githubusercontent.com/github\" />\n  <Avatar src=\"https://avatars.githubusercontent.com/primer\" />\n</AvatarPair>\n```\n\n## Props\n\n### AvatarPair\n\n<PropsTable>\n  <PropsTableRow name=\"children\" type=\"Avatar[]\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: false,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"AvatarPair"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/AvatarStack.mdx","frontmatter":{"title":"AvatarStack"},"rawBody":"---\ncomponentId: avatar_stack\ntitle: AvatarStack\nstatus: Alpha\ndescription: Use an avatar stack to display two or more avatars in an inline stack.\nsource: https://github.com/primer/react/blob/main/src/AvatarStack.tsx\n---\n\nimport {AvatarStack} from '@primer/react'\n\n```js\nimport {AvatarStack} from '@primer/react'\n```\n\n## Examples\n\n### Default\n\n```jsx live\n<AvatarStack>\n  <Avatar alt=\"Primer\" src=\"https://avatars.githubusercontent.com/primer\" />\n  <Avatar alt=\"GitHub\" src=\"https://avatars.githubusercontent.com/github\" />\n  <Avatar alt=\"Atom\" src=\"https://avatars.githubusercontent.com/atom\" />\n  <Avatar alt=\"Desktop\" src=\"https://avatars.githubusercontent.com/desktop\" />\n</AvatarStack>\n```\n\n### Right aligned\n\n```jsx live\n<AvatarStack alignRight>\n  <Avatar alt=\"Primer\" src=\"https://avatars.githubusercontent.com/primer\" />\n  <Avatar alt=\"GitHub\" src=\"https://avatars.githubusercontent.com/github\" />\n  <Avatar alt=\"Atom\" src=\"https://avatars.githubusercontent.com/atom\" />\n  <Avatar alt=\"Desktop\" src=\"https://avatars.githubusercontent.com/desktop\" />\n</AvatarStack>\n```\n\n## Props\n\n### AvatarStack\n\n<PropsTable>\n  <PropsTableRow name=\"alignRight\" type=\"boolean\" defaultValue=\"false\" description=\"Align the avatars to the right\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: false,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"AvatarStack"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Box.mdx","frontmatter":{"title":"Box"},"rawBody":"---\ncomponentId: box\ntitle: Box\nstatus: Beta\ndescription: A low-level utility component that accepts styled system props to enable custom theme-aware styling\nsource: https://github.com/primer/react/blob/main/src/Box.tsx\n---\n\n```js\nimport {Box} from '@primer/react'\n```\n\n## Examples\n\n### Border on all sides\n\n```jsx live\n<Box borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\" p={3}>\n  Hello\n</Box>\n```\n\n### Border on one side\n\n```jsx live\n<Box borderColor=\"border.default\" borderBottomWidth={1} borderBottomStyle=\"solid\" pb={3}>\n  Hello\n</Box>\n```\n\n### Flexbox\n\nUse Box to create [flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox) layouts.\n\n```jsx live\n<Box display=\"flex\">\n  <Box p={3} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\">\n    1\n  </Box>\n  <Box flexGrow={1} p={3} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\">\n    2\n  </Box>\n  <Box p={3} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\">\n    3\n  </Box>\n</Box>\n```\n\n### Grid\n\nUse Box to create [grid](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Grids) layouts.\n\n```jsx live\n<Box display=\"grid\" gridTemplateColumns=\"1fr 1fr\" gridGap={3}>\n  <Box p={3} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\">\n    1\n  </Box>\n  <Box p={3} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\">\n    2\n  </Box>\n  <Box p={3} borderColor=\"border.default\" borderWidth={1} borderStyle=\"solid\">\n    3\n  </Box>\n</Box>\n```\n\n## Props\n\n### Box\n\n<PropsTable>\n  <PropsTableBasePropRows elementType=\"div\" isPolymorphic refType=\"HTMLDivElement\" />\n</PropsTable>\n\nBox also accepts all [styled system props](https://styled-system.com/table/).\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    designReviewed: null,\n    a11yReviewed: null,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: null,\n    hasFigmaComponent: null\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Box"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/BranchName.mdx","frontmatter":{"title":"BranchName"},"rawBody":"---\ncomponentId: branch_name\ntitle: BranchName\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/BranchName.tsx\n---\n\n```js\nimport {BranchName} from '@primer/react'\n```\n\nBranchName is a label-type component rendered as an `<a>` tag by default with monospace font.\n\n## Examples\n\n```jsx live\n<BranchName href=\"#\">a_new_feature_branch</BranchName>\n```\n\n## Props\n\n### BranchName\n\n<PropsTable>\n  <PropsTableBasePropRows\n    elementType=\"a\"\n    refType=\"HTMLAnchorElement\"\n    isPolymorphic\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes\">MDN</Link>\n    }\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: false,\n    fullTestCoverage: false,\n    usedInProduction: false,\n    usageExamplesDocumented: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"BranchName"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Breadcrumbs.mdx","frontmatter":{"title":"Breadcrumbs"},"rawBody":"---\ncomponentId: breadcrumbs\ntitle: Breadcrumbs\nstatus: Alpha\ndescription: Use breadcrumbs to show navigational context on pages that are many levels deep in a site’s hierarchy. Breadcrumbs show and link to parent, grandparent, and sometimes great-grandparent pages.\nsource: https://github.com/primer/react/blob/main/src/Breadcrumbs.tsx\n---\n\n```js\nimport {Breadcrumbs} from '@primer/react'\n```\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 parent, grandparent, and sometimes great-grandparent pages. Breadcrumbs 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\nTo use Breadcrumbs with [react-router](https://github.com/ReactTraining/react-router) or\n[react-router-dom](https://www.npmjs.com/package/react-router-dom), pass\n`as={NavLink}` and omit the `selected` prop.\nThis ensures that the NavLink gets `activeClassName='selected'`\n\n## Examples\n\n```jsx live\n<Breadcrumbs>\n  <Breadcrumbs.Item href=\"/\">Home</Breadcrumbs.Item>\n  <Breadcrumbs.Item href=\"/about\">About</Breadcrumbs.Item>\n  <Breadcrumbs.Item href=\"/about/team\" selected>\n    Team\n  </Breadcrumbs.Item>\n</Breadcrumbs>\n```\n\n## Props\n\n### Breadcrumbs\n\n<PropsTable>\n  <PropsTableRow name=\"children\" type=\"Breadcrumbs.Item[]\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n### Breadcrumbs.Item\n\n<PropsTable>\n  <PropsTableRow name=\"selected\" type=\"boolean\" defaultValue=\"false\" />\n  <PropsTableBasePropRows\n    elementType=\"a\"\n    refType=\"HTMLAnchorElement\"\n    isPolymorphic\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes\">MDN</Link>\n    }\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: false,\n    fullTestCoverage: false,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Breadcrumbs"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Button.mdx","frontmatter":{"title":"Button"},"rawBody":"---\ncomponentId: button\ntitle: Button\nstatus: Alpha\nsource: https://github.com/primer/react/tree/main/src/Button\nstorybook: '/react/storybook?path=/story/composite-components-button'\ndescription: Use button for the main actions on a page or form.\n---\n\n```js\nimport {Button} from '@primer/react'\n```\n\n## Examples\n\n### Default button\n\nThis is the default variant for the `Button` component.\n\n```jsx live\n<Button>Default</Button>\n```\n\n### Danger button\n\nThe `danger` variant of `Button` is used to warn users about potentially destructive actions\n\n```jsx live\n<Button variant=\"danger\">Danger</Button>\n```\n\n### Outline button\n\nThe `outline` variant of `Button` is typically used as a secondary button\n\n```jsx live\n<Button variant=\"outline\">Outline</Button>\n```\n\n### Invisible button\n\nThe `invisible` variant of `Button` indicates that the action is a low priority one.\n\n```jsx live\n<Button variant=\"invisible\">Invisible</Button>\n```\n\n### Different sized buttons\n\n`Button` component supports three different sizes. `small`, `medium`, `large`.\n\n```jsx live\n<>\n  <Button size=\"small\">Search</Button>\n  <Button sx={{mt: 2}}>Search</Button>\n  <Button sx={{mt: 2}} size=\"large\">\n    Search\n  </Button>\n</>\n```\n\n### Appending an icon\n\nWe can place an icon inside the `Button` in either the leading or the trailing position to enhance the visual context.\nIt is recommended to use an octicon here.\n\n```jsx live\n<>\n  <Button leadingIcon={SearchIcon}>Search</Button>\n  <Button trailingIcon={SearchIcon} sx={{mt: 2}}>\n    Search\n  </Button>\n  <Button leadingIcon={SearchIcon} trailingIcon={CheckIcon} sx={{mt: 2}}>\n    Search\n  </Button>\n</>\n```\n\n### Icon only button\n\nA separate component called `IconButton` is used if the action shows only an icon with no text. This button will remain square in shape.\n\n```jsx live\n<IconButton aria-label=\"Search\" icon={SearchIcon} />\n```\n\n### Different sized icon buttons\n\n`IconButton` also supports the three different sizes. `small`, `medium`, `large`.\n\n```jsx live\n<>\n  <IconButton aria-label=\"Search\" size=\"small\" icon={SearchIcon} />\n  <IconButton aria-label=\"Search\" icon={SearchIcon} sx={{ml: 2}} />\n  <IconButton aria-label=\"Search\" size=\"large\" icon={SearchIcon} sx={{ml: 2}} />\n</>\n```\n\n### Counter component\n\nA common use case for primer is a button with a counter component which shows the child count value.\nWe provide `Button.Counter` as a composite component which requires you to provide a number as child.\nThe counter will match the `variant` styles of the parent button.\n\n```jsx live\n<Button>\n  Watch\n  <Button.Counter>1</Button.Counter>\n</Button>\n```\n\n### Styling a button\n\nA button can be styled in an appropriate manner using the `sx` prop. This may be to change width, or to add margins etc.\nHere's an example of a block button which takes 100% of available width. Checkout [styled-system](https://styled-system.com/) to see what you can send in an `sx` prop.\n\n```jsx live\n<Button sx={{width: '100%'}}>Block</Button>\n```\n\n## Props\n\nNative `<button>` HTML attributes are forwarded to the underlying React `button` component and are not listed below.\n\n### Button\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    required\n    type=\"React.ReactNode\"\n    description=\"Button description along with other components like Counter could be used here.\"\n  />\n  <PropsTableRow\n    name=\"variant\"\n    type=\"'default' | 'primary' | 'danger' | 'outline' | 'invisible'\"\n    description=\"Changes the look and feel of the button which is different for each variant\"\n  />\n  <PropsTableRow\n    name=\"size\"\n    type=\"'small' | 'medium' | 'large'\"\n    description=\"Changes the size of the button component\"\n  />\n  <PropsTableRow\n    name=\"leadingIcon\"\n    type=\"Component\"\n    description=\"provide an octicon. It will be placed before the button text\"\n  />\n  <PropsTableRow\n    name=\"trailingIcon\"\n    type=\"Component\"\n    description=\"provide an octicon. It will be placed after the button text\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### Button.Counter\n\n<PropsTable>\n  <PropsTableRow name=\"children\" required type=\"number\" description=\"The counter value as a number\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n\n## Related components\n\n- [ButtonGroup](/ButtonGroup)\n","parent":{"relativeDirectory":"","name":"Button"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/ButtonGroup.mdx","frontmatter":{"title":"ButtonGroup"},"rawBody":"---\ntitle: ButtonGroup\ncomponentId: button_group\nstatus: Alpha\nsource: https://github.com/primer/react/tree/main/src/ButtonGroup\n---\n\n```js\nimport {ButtonGroup} from '@primer/react'\n```\n\n## Examples\n\n### Default\n\n```jsx live\n<ButtonGroup>\n  <Button>Button 1</Button>\n  <Button>Button 2</Button>\n  <Button>Button 3</Button>\n</ButtonGroup>\n```\n\n### With icon buttons\n\n```jsx live\n<ButtonGroup>\n  <IconButton aria-label=\"Zoom out\" icon={DashIcon} />\n  <IconButton aria-label=\"Zoom in\" icon={PlusIcon} />\n</ButtonGroup>\n```\n\n## Props\n\n### ButtonGroup\n\n<PropsTable>\n  <PropsTableSxRow />\n  <PropsTableRefRow refType=\"HTMLDivElement\" />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n\n## Related components\n\n- [Button](/Button)\n","parent":{"relativeDirectory":"","name":"ButtonGroup"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Checkbox.mdx","frontmatter":{"title":"Checkbox"},"rawBody":"---\ntitle: Checkbox\ndescription: Use checkboxes to toggle between checked and unchecked states in a list or as a standalone form field\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/Checkbox.tsx\nstorybook: '/react/storybook?path=/story/forms-checkbox--default'\ncomponentId: checkbox\n---\n\n## Examples\n\n<Note variant=\"warning\">\n\n**Use [FormControl](/FormControl) to display an accessible checkbox form field**. This `Checkbox` component is intended only as an ingredient for other custom components, or as a drop-in replacement for native HTML checkboxes outside of form use-cases.\n\nIf you do use this component to build a custom checkbox, it should always be accompanied by a corresponding `<label>` to improve support for assistive technologies.\n\n</Note>\n\nThe `Checkbox` component can be used in controlled and uncontrolled modes.\n\n```jsx live\n<form>\n  <FormControl>\n    <Checkbox id=\"default-checkbox\" />\n    <FormControl.Label>Default checkbox</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox id=\"always-checked-checkbox\" checked />\n    <FormControl.Label>Always checked</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox id=\"always-unchecked-checkbox\" />\n    <FormControl.Label>Always unchecked</FormControl.Label>\n  </FormControl>\n  <FormControl disabled>\n    <Checkbox id=\"inactive-checkbox\" checked />\n    <FormControl.Label>Inactive</FormControl.Label>\n  </FormControl>\n</form>\n```\n\n<Note variant=\"warning\">\n  Checkbox components should always be accompanied by a corresponding label to improve support for assistive\n  technologies.\n</Note>\n\n## Indeterminate\n\nAn `indeterminate` checkbox state should be used if the input value is neither true nor false. This can be useful in situations where you are required to display an incomplete state, or one that is dependent on other input selections to determine a value.\n\n```jsx live\n<form>\n  <FormControl>\n    <Checkbox onChange={() => {}} indeterminate={true} />\n    <FormControl.Label>Default checkbox</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox checked={true} onChange={() => {}} />\n    <FormControl.Label>Checkbox 1</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox checked={false} onChange={() => {}} />\n    <FormControl.Label>Checkbox 2</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox checked={false} onChange={() => {}} />\n    <FormControl.Label>Checkbox 3</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox checked={false} onChange={() => {}} />\n    <FormControl.Label>Checkbox 4</FormControl.Label>\n  </FormControl>\n</form>\n```\n\n## Props\n\n<PropsTable>\n  <PropsTableRow\n    name=\"checked\"\n    type=\"boolean\"\n    description=\"Modifies true/false value of the native checkbox\"\n  />\n  <PropsTableRow\n    name=\"defaultChecked\"\n    type=\"boolean\"\n    description=\"Checks the input by default in uncontrolled mode\"\n  />\n  <PropsTableRow\n    name=\"onChange\"\n    type=\"(event: React.ChangeEvent) => void\"\n    description=\"A callback function that is triggered when the checked state has been changed\"    \n  />\n  <PropsTableRow\n    name=\"disabled\"\n    type=\"boolean\"\n    description=\"Modifies the native disabled state of the native checkbox\"    \n  />\n  <PropsTableRow\n    name=\"indeterminate\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description={\n      <>\n        Applies an{' '}\n        <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#attr-indeterminate\">\n          indeterminate state\n        </Link>{' '}\n        to the checkbox\n      </>\n    }\n  />\n  <PropsTableBasePropRows\n    elementType=\"input\"\n    refType=\"HTMLInputElement\"\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#additional_attributes\">\n        MDN\n      </Link>\n    }\n  />\n\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n\n## Related components\n\n- [CheckboxInputField](/CheckboxInputField)\n","parent":{"relativeDirectory":"","name":"Checkbox"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/CheckboxGroup.mdx","frontmatter":{"title":"CheckboxGroup"},"rawBody":"---\ntitle: CheckboxGroup\ncomponentId: checkbox_group\ndescription: Renders a set of checkboxes to let users make one or more selections from a short list of options\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/CheckboxGroup/CheckboxGroup.tsx\nstorybook: '/react/storybook/?path=/story/forms-checkboxgroup-examples--basic'\n---\n\nimport {CheckboxGroup, Checkbox, Box} from '@primer/components'\nimport {CheckIcon, XIcon, AlertIcon} from '@primer/octicons-react'\n\n## Examples\n\n### Basic\n\n```jsx live\n<Box display=\"grid\" sx={{gap: 3}}>\n  <CheckboxGroup>\n    <CheckboxGroup.Label>Choices</CheckboxGroup.Label>\n    <FormControl>\n      <Checkbox value=\"one\" />\n      <FormControl.Label>Choice one</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Checkbox value=\"two\" />\n      <FormControl.Label>Choice two</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Checkbox value=\"three\" />\n      <FormControl.Label>Choice three</FormControl.Label>\n    </FormControl>\n  </CheckboxGroup>\n</Box>\n```\n\n### Using onChange handlers\n\n```javascript live noinline\nconst WithOnChangeHandlers = () => {\n  const [selectedCheckboxValues, setSelectedCheckboxValues] = React.useState(['one', 'two'])\n  const [lastSelectedCheckboxValue, setLastSelectedCheckboxValue] = React.useState()\n\n  const handleCheckboxGroupChange = (selectedValues, e) => {\n    setSelectedCheckboxValues(selectedValues)\n    setLastSelectedCheckboxValue(e.currentTarget.value)\n  }\n\n  const handleChoiceOneChange = e => {\n    alert('Choice one has its own handler')\n  }\n\n  return (\n    <Box display=\"grid\" sx={{gap: 1}}>\n      <CheckboxGroup onChange={handleCheckboxGroupChange}>\n        <CheckboxGroup.Label>Choices</CheckboxGroup.Label>\n        <FormControl>\n          <Checkbox value=\"one\" defaultChecked onChange={handleChoiceOneChange} />\n          <FormControl.Label>Choice one</FormControl.Label>\n        </FormControl>\n        <FormControl>\n          <Checkbox value=\"two\" defaultChecked />\n          <FormControl.Label>Choice two</FormControl.Label>\n        </FormControl>\n        <FormControl>\n          <Checkbox value=\"three\" />\n          <FormControl.Label>Choice three</FormControl.Label>\n        </FormControl>\n      </CheckboxGroup>\n\n      {Boolean(selectedCheckboxValues.length) && (\n        <div>The selected checkbox values are {selectedCheckboxValues.join(', ')}</div>\n      )}\n      {Boolean(lastSelectedCheckboxValue) && <div>The last affected checkbox value is {lastSelectedCheckboxValue}</div>}\n    </Box>\n  )\n}\n\nrender(<WithOnChangeHandlers />)\n```\n\n### Disabled\n\n```jsx live\n<CheckboxGroup disabled>\n  <CheckboxGroup.Label>Choices</CheckboxGroup.Label>\n  <FormControl>\n    <Checkbox value=\"one\" />\n    <FormControl.Label>Choice one</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox value=\"two\" />\n    <FormControl.Label>Choice two</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox value=\"three\" />\n    <FormControl.Label>Choice three</FormControl.Label>\n  </FormControl>\n</CheckboxGroup>\n```\n\n### Required\n\n```jsx live\n<CheckboxGroup required>\n  <CheckboxGroup.Label>Choices</CheckboxGroup.Label>\n  <FormControl>\n    <Checkbox value=\"one\" />\n    <FormControl.Label>Choice one</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox value=\"two\" />\n    <FormControl.Label>Choice two</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox value=\"three\" />\n    <FormControl.Label>Choice three</FormControl.Label>\n  </FormControl>\n</CheckboxGroup>\n```\n\n### With validation\n\n```jsx live\n<CheckboxGroup>\n  <CheckboxGroup.Label>Choices</CheckboxGroup.Label>\n  <FormControl>\n    <Checkbox value=\"one\" />\n    <FormControl.Label>Choice one</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox value=\"two\" />\n    <FormControl.Label>Choice two</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox value=\"three\" />\n    <FormControl.Label>Choice three</FormControl.Label>\n  </FormControl>\n  <CheckboxGroup.Validation variant=\"error\">Your choices are wrong</CheckboxGroup.Validation>\n</CheckboxGroup>\n```\n\n### With caption\n\n```jsx live\n<CheckboxGroup>\n  <CheckboxGroup.Label>Choices</CheckboxGroup.Label>\n  <CheckboxGroup.Caption>You can pick any or all of these choices</CheckboxGroup.Caption>\n  <FormControl>\n    <Checkbox value=\"one\" />\n    <FormControl.Label>Choice one</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox value=\"two\" />\n    <FormControl.Label>Choice two</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox value=\"three\" />\n    <FormControl.Label>Choice three</FormControl.Label>\n  </FormControl>\n</CheckboxGroup>\n```\n\n### A visually hidden label\n\n```jsx live\n<CheckboxGroup>\n  <CheckboxGroup.Label visuallyHidden>Choices</CheckboxGroup.Label>\n  <FormControl>\n    <Checkbox value=\"one\" />\n    <FormControl.Label>Choice one</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox value=\"two\" />\n    <FormControl.Label>Choice two</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Checkbox value=\"three\" />\n    <FormControl.Label>Choice three</FormControl.Label>\n  </FormControl>\n</CheckboxGroup>\n```\n\n### With an external label\n\n```jsx live\n<>\n  <Box\n    id=\"choiceHeading\"\n    borderBottomWidth=\"1px\"\n    borderBottomStyle=\"solid\"\n    borderBottomColor=\"border.default\"\n    pb={2}\n    mb={3}\n    fontSize={3}\n  >\n    Choices\n  </Box>\n  <CheckboxGroup aria-labelledby=\"choiceHeading\">\n    <FormControl>\n      <Checkbox value=\"one\" />\n      <FormControl.Label>Choice one</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Checkbox value=\"two\" />\n      <FormControl.Label>Choice two</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Checkbox value=\"three\" />\n      <FormControl.Label>Choice three</FormControl.Label>\n    </FormControl>\n  </CheckboxGroup>\n</>\n```\n\n## Props\n\n### CheckboxGroup\n\n<PropsTable>\n  <PropsTableRow\n    name=\"aria-labelledby\"\n    type=\"string\"\n    description=\"Used when associating the input group with a label other than CheckboxGroup.Label\"\n  />\n  <PropsTableRow\n    name=\"children\"\n    type=\"CheckboxGroup.Label | CheckboxGroup.Caption | CheckboxGroup.Validation | FormControl\"\n    required\n  />\n  <PropsTableRow\n    name=\"disabled\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Whether the input group allows user input\"\n  />\n  <PropsTableRow\n    name=\"id\"\n    type=\"string\"\n    defaultValue=\"a generated string\"\n    description={\n      <span>\n        The unique identifier for this input group. Used to associate the label, validation text, and caption text.{' '}\n        <br /> You may want a custom ID to make it easier to select elements in integration tests.\n      </span>\n    }\n  />\n  <PropsTableRow\n    name=\"onChange\"\n    type=\"(selected: string[], e?: ChangeEvent<HTMLInputElement>) => void\"\n    description=\"An onChange handler that gets called when the selection changes\"\n  />\n  <PropsTableRow\n    name=\"required\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"If true, the user must make a selection before the owning form can be submitted\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### CheckboxGroup.Label\n\nA title for the set of choices. If a `CheckboxGroup.Label` is not passed as a child, you must pass the external title's ID to the `aria-describedby` prop on `CheckboxGroup`\n\n<PropsTable>\n  <PropsTableRow\n    name=\"visuallyHidden\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"If true, the fieldset legend will be visually hidden\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### CheckboxGroup.Description\n\n<PropsTable>\n  <PropsTableRow name=\"children\" type=\"React.ReactNode\" description=\"The caption content\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n### CheckboxGroup.Validation\n\nIf the user's selection has been flagged during validation, `CheckboxGroup.Validation` may be used to render contextual validation information to help the user complete their task\n\n<PropsTable>\n  <PropsTableRow name=\"children\" type=\"React.ReactNode\" description=\"The validation message\" />\n  <PropsTableRow\n    required\n    name=\"variant\"\n    type=\"'error' | 'success' | 'warning'\"\n    description=\"Changes the visual style to match the validation status\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"CheckboxGroup"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/CircleBadge.mdx","frontmatter":{"title":"CircleBadge"},"rawBody":"---\ncomponentId: circle_badge\ntitle: CircleBadge\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/CircleBadge.tsx\n---\n\n```js\nimport {CircleBadge} from '@primer/react'\n```\n\nUse CircleBadge to visually connect logos of third party services like in marketplace. Use CircleBadge.Icon to add an Octicon to the CircleBadge.\n\n## Examples\n\n```jsx live\n<CircleBadge>\n  <CircleBadge.Icon icon={ZapIcon} />\n</CircleBadge>\n```\n\n## Props\n\n### CircleBadge\n\n<PropsTable>\n  <PropsTableRow\n    name=\"variant\"\n    type=\"'small' | 'medium' | 'large'\"\n    defaultValue=\"'medium'\"\n    description={\n      <>\n        Creates a smaller or larger badge. Has no effect if the <InlineCode>size</InlineCode> prop is set\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"size\"\n    type=\"number\"\n    description={\n      <>\n        Sets the size of the badge in pixels. Overrides the <InlineCode>variant</InlineCode> prop when set\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"inline\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description={\n      <>\n        Styles the badge to <InlineCode>display: inline</InlineCode>\n      </>\n    }\n  />\n  <PropsTableBasePropRows elementType=\"div\" isPolymorphic refType=\"HTMLDivElement\" />\n</PropsTable>\n\n### CircleBadge.Icon\n\n<PropsTable>\n  <PropsTableAsRow defaultElementType=\"StyledOcticon\" />\n  <PropsTablePassthroughPropsRow\n    elementName=\"StyledOcticon\"\n    isPolymorphic\n    passthroughPropsLink={\n      <>\n        the <Link href=\"/StyledOcticon\">StyledOcticon docs</Link>\n      </>\n    }\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: false,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: false,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"CircleBadge"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/CircleOcticon.md","frontmatter":{"title":"CircleOcticon"},"rawBody":"---\ncomponentId: circle_octicon\ntitle: CircleOcticon\nstatus: Alpha\n---\n\nCircleOcticon renders any Octicon with a circle background. CircleOcticons are most commonly used to represent the status of a pull request in the comment timeline.\n\n## Default example\n\n```jsx live\n<CircleOcticon icon={CheckIcon} size={32} sx={{bg: 'success.fg', color: 'fg.onEmphasis'}} />\n```\n\n## Component props\n\n| Name | Type    | Default | Description                                       |\n| :--- | :------ | :-----: | :------------------------------------------------ |\n| icon | Octicon |         | Octicon component used in the component           |\n| size | Number  |   32    | used to set the width and height of the component |\n","parent":{"relativeDirectory":"","name":"CircleOcticon"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/CounterLabel.mdx","frontmatter":{"title":"CounterLabel"},"rawBody":"---\ncomponentId: counter_label\ntitle: CounterLabel\ndescription: Use the CounterLabel component to add a count to navigational elements and buttons.\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/CounterLabel.tsx\n---\n\n## Example\n\n```jsx live\n<>\n  <CounterLabel>12</CounterLabel>\n  <CounterLabel scheme=\"primary\">13</CounterLabel>\n  <CounterLabel scheme=\"secondary\">13</CounterLabel>\n</>\n```\n\n## Props\n\n<PropsTable>\n  <PropsTableRow\n    name=\"scheme\"\n    type=\"''primary' | 'secondary'\"\n    description=\"Pass in 'primary' for a darker background and inverse text, or 'secondary' for a lighter background and primary text. Omitting the scheme prop renders the default counter scheme\"\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: false,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: true\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"CounterLabel"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Details.md","frontmatter":{"title":"Details"},"rawBody":"---\ncomponentId: details\ntitle: Details\nstatus: Alpha\n---\n\n`Details` is a styled `details` element for use with the `useDetails` hook. The `useDetails` hook returns the `open` state, a `setOpen` function to manually change the open state, and **`getDetailsProps` which must be spread onto your `Details` element in order for `Details` to get receive the proper behaviors provided by the hook**. See Kent Dodd's article on this pattern [here](https://kentcdodds.com/blog/how-to-give-rendering-control-to-users-with-prop-getters).\n\nThe `useDetails` hook also takes a few configuration options as parameters which are noted in the table below.\n\nYou must use a `summary` element as your `Details` trigger button. To style your summary element like a [Button](./Button), you can use the `as` prop (see example below).\n\nIt's also possible to use the `useDetails` hook with components other than the Primer `Details`, such as a custom `Details` or `Modal` wrapper in your consuming application. All that matters is that the outer element is a `details` and it contains a `summary` for the button that opens and closes the component, and that `getDetailsProps` is properly spread onto the component rendering your `details` element.\n\n```jsx live\n<State>\n  {([]) => {\n    const {getDetailsProps} = useDetails({closeOnOutsideClick: true})\n    return (\n      <Details {...getDetailsProps()}>\n        <Button as=\"summary\">Hello</Button>\n        This is some content\n      </Details>\n    )\n  }}\n</State>\n```\n\nYou can use the `open` state returned from the hook to conditionally render content:\n\n```jsx live\n<State>\n  {([]) => {\n    const {getDetailsProps, open} = useDetails({closeOnOutsideClick: true})\n    return (\n      <Details {...getDetailsProps()}>\n        <Button as=\"summary\">{open ? 'open' : 'close'}</Button>\n        This is some content\n      </Details>\n    )\n  }}\n</State>\n```\n\nYou can also manually show/hide the content using the `setOpen` function returned from the hook. This can be useful if you have action items in the content of the component such as confirmation buttons:\n\n```jsx live\n<State>\n  {([]) => {\n    const {getDetailsProps, setOpen} = useDetails({closeOnOutsideClick: true})\n    return (\n      <Details {...getDetailsProps()}>\n        <Button as=\"summary\">Delete item</Button>\n        Are you sure?\n        <ButtonDanger onClick={() => setOpen(false)}>Yes I'm sure</ButtonDanger>\n      </Details>\n    )\n  }}\n</State>\n```\n\nIn previous versions of Primer React Components, we allowed users to pass in a custom `onToggle` function. You can do this now by overriding the `onToggle` function returned in `getDetailsProps`. Please note that in most cases, you'll want the hook's handling of `onToggle` to be run as well, so that the internal state is properly updated. To do this, manually call the `onToggle` handler returned from `useDetails` before executing your custom `onToggle` code.\n\n```jsx live\n<State>\n  {([]) => {\n    const {getDetailsProps, open, setOpen} = useDetails({closeOnOutsideClick: true})\n    const {onToggle, ...detailsProps} = getDetailsProps()\n    const customToggle = e => {\n      onToggle(e)\n      window.alert('hi')\n    }\n    return (\n      <Details {...detailsProps} onToggle={customToggle}>\n        <Button as=\"summary\">{open ? 'Open' : 'Closed'}</Button>\n        Hello World\n      </Details>\n    )\n  }}\n</State>\n```\n\n## Details props\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n\n## `useDetails` hook configuration options\n\n| Name                | Type      | Default | Description                                                               |\n| :------------------ | :-------- | :-----: | :------------------------------------------------------------------------ |\n| defaultOpen         | Boolean   |         | Sets the initial open/closed state                                        |\n| closeOnOutsideClick | Boolean   |  false  | Sets whether or not element will close when the user clicks outside of it |\n| ref                 | React ref |         | optional ref to pass down to Details component                            |\n\n### Values returned by the `useDetails` hook\n\n| Name            | Type     | Description                                                                                                                                                                                                                              |\n| :-------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| open            | string   | Whether or not Details is currently open                                                                                                                                                                                                 |\n| setOpen         | function | Used to manually change the open state of the Details component                                                                                                                                                                          |\n| getDetailsProps | Object   | Contains an `onToggle` function, the `ref` to pass down to `Details` and the `open` attribute. In most cases, you won't need to interact with any of these values directly, but if you'd like to override any of these yourself you may. |\n","parent":{"relativeDirectory":"","name":"Details"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Dialog.md","frontmatter":{"title":"Dialog"},"rawBody":"---\ntitle: Dialog\nstatus: Alpha\n---\n\nThe dialog component is used for all modals. It renders on top of the rest of the app with an overlay.\n\nYou'll need to manage the `isOpen` state in a wrapper component of your own and pass in a function to be used to close the Dialog. For documentation purposes only we've created a mock `State` to handle this, but you should handle the state in the component you consume `Dialog` in or in a wrapper component.\n\n### Accessibility\n\nA few considerations must be made to ensure your use of the `Dialog` component is accessible:\n\n- Always be sure to provide either `aria-labelledby` or `aria-label` to your `Dialog` component. In most cases you should use `aria-labelledby` and pass it the `id` of your `Dialog.Header`. If there is no text in your header, or you chose not to use a header, you can use `aria-label` to describe the purpose of the `Dialog`.\n\n- Be sure to pass a ref to return the focus back to once the `Dialog` closes via the `returnFocusRef` prop. In most cases this should be the element that opened the Dialog. If you decide to manage focus within your application and want to bypass Primer React Components from doing so when the `Dialog` closes, you can omit the `returnFocusProp`.\n\n### Z-index\n\nIf you're running into z-index issues or are rendering the component inside of an absolutely positioned element, you can wrap your `Dialog` in a [React Portal](https://reactjs.org/docs/portals.html).\n\n### Examples\n\n```jsx live\n<State default={false}>\n  {([isOpen, setIsOpen]) => {\n    const returnFocusRef = React.useRef(null)\n    return (\n      <>\n        <Button ref={returnFocusRef} onClick={() => setIsOpen(true)}>\n          Open\n        </Button>\n        <Dialog\n          returnFocusRef={returnFocusRef}\n          isOpen={isOpen}\n          onDismiss={() => setIsOpen(false)}\n          aria-labelledby=\"header-id\"\n        >\n          <Dialog.Header id=\"header-id\">Title</Dialog.Header>\n          <Box p={3}>\n            <Text fontFamily=\"sans-serif\">Some content</Text>\n          </Box>\n        </Dialog>\n      </>\n    )\n  }}\n</State>\n```\n\nYou can also pass any non-text content into the header:\n\n```jsx live\n<State default={false}>\n  {([isOpen, setIsOpen]) => {\n    const returnFocusRef = React.useRef(null)\n    return (\n      <>\n        <Button ref={returnFocusRef} onClick={() => setIsOpen(true)}>\n          Open\n        </Button>\n        <Dialog\n          isOpen={isOpen}\n          returnFocusRef={returnFocusRef}\n          onDismiss={() => setIsOpen(false)}\n          aria-labelledby=\"label\"\n        >\n          <Dialog.Header>\n            <ZapIcon />\n          </Dialog.Header>\n          <Box p={3}>\n            <Text id=\"label\" fontFamily=\"sans-serif\">\n              Are you sure you'd like to delete this issue?\n            </Text>\n            <Box display=\"flex\" mt={3} justifyContent=\"flex-end\">\n              <Button sx={{mr: 1}}>Cancel</Button>\n              <Button variant=\"danger\">Delete</Button>\n            </Box>\n          </Box>\n        </Dialog>\n      </>\n    )\n  }}\n</State>\n```\n\n## Component props\n\n### Dialog\n\n| Prop name       | Type              | Default | Description                                                                                                                                               |\n| :-------------- | :---------------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| isOpen          | Boolean           |         | Set whether or not the dialog is shown                                                                                                                    |\n| onDismiss       | Function          |         | A user-provided function that should close the dialog                                                                                                     |\n| returnFocusRef  | React ref         |         | The element to restore focus back to after the `Dialog` is closed                                                                                         |\n| initialFocusRef | React ref         |         | Element inside of the `Dialog` you'd like to be focused when the Dialog is opened. If nothing is passed to `initialFocusRef` the close button is focused. |\n| aria-labelledby | string            |         | Pass an id to use for the aria-label. Use either a `aria-label` or an `aria-labelledby` but not both.                                                     |\n| aria-label      | string            |         | Pass a label to be used to describe the Dialog. Use either a `aria-label` or an `aria-labelledby` but not both.                                           |\n| sx              | SystemStyleObject | {}      | Style to be applied to the component                                                                                                                      |\n\n### Dialog.Header\n\n| Prop name | Type              | Default | Description                          |\n| :-------- | :---------------- | :------ | :----------------------------------- |\n| sx        | SystemStyleObject | {}      | Style to be applied to the component |\n","parent":{"relativeDirectory":"","name":"Dialog"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/FilterList.md","frontmatter":{"title":"FilterList"},"rawBody":"---\ncomponentId: filter_list\ntitle: FilterList\nstatus: Alpha\n---\n\nThe FilterList component is a menu with filter options that filter the main content of the page.\n\n## Default example\n\n```jsx live\n<FilterList>\n  <FilterList.Item selected count={32} href=\"#foo\">\n    First Filter\n  </FilterList.Item>\n  <FilterList.Item count={2} href=\"#bar\">\n    Second Filter\n  </FilterList.Item>\n  <FilterList.Item href=\"#baz\">Third Filter</FilterList.Item>\n</FilterList>\n```\n\n## Component props\n\n#### FilterList\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n\n#### FilterList.Item\n\n| Name     | Type              | Default | Description                                                      |\n| :------- | :---------------- | :-----: | :--------------------------------------------------------------- |\n| count    | Number            |         | Number to be displayed in the list item                          |\n| as       | String            |   `a`   | sets the HTML tag for the component                              |\n| selected | Boolean           |         | Used to set selected style                                       |\n| small    | Boolean           |  false  | Used to create a smaller version of the standard FilterList.Item |\n| sx       | SystemStyleObject |   {}    | Style to be applied to the component                             |\n","parent":{"relativeDirectory":"","name":"FilterList"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/FilteredSearch.md","frontmatter":{"title":"FilteredSearch"},"rawBody":"---\ncomponentId: filtered_search\ntitle: FilteredSearch\nstatus: Alpha\n---\n\nThe FilteredSearch component helps style a Dropdown and a TextInput side-by-side.\n\n**Note:** You _must_ use a `TextInput` and `Dropdown` (or native `<details>` and `<summary>`) in order for this component to work properly.\n\n## Default example\n\n```jsx live\n<FilteredSearch>\n  <ActionMenu>\n    <ActionMenu.Button as=\"summary\">Filter</ActionMenu.Button>\n    <ActionMenu.Overlay>\n      <ActionList direction=\"sw\">\n        <ActionList.Item>Item 1</ActionList.Item>\n        <ActionList.Item>Item 2</ActionList.Item>\n        <ActionList.Item>Item 3</ActionList.Item>\n      </ActionList>\n    </ActionMenu.Overlay>\n  </ActionMenu>\n  <TextInput icon={SearchIcon} />\n</FilteredSearch>\n```\n\n## Component props\n\n#### FilteredSearch.Children\n\n| Name     | Type              | Default | Description                                                                                              |\n| :------- | :---------------- | :-----: | :------------------------------------------------------------------------------------------------------- |\n| children |                   |         | FilteredSearch is expected to contain a [`Dropdown`](/Dropdown) followed by a [`TextInput`](/TextInput). |\n| sx       | SystemStyleObject |   {}    | Style to be applied to the component                                                                     |\n","parent":{"relativeDirectory":"","name":"FilteredSearch"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Flash.mdx","frontmatter":{"title":"Flash"},"rawBody":"---\ncomponentId: flash\ntitle: Flash\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/Flash.tsx\n---\n\n```js\nimport {Flash} from '@primer/react'\n```\n\nThe Flash component informs users of successful or pending actions.\n\n## Examples\n\n### Default\n\n```jsx live\n<>\n  <Flash>Default Flash</Flash>\n  <Flash variant=\"success\">Success Flash</Flash>\n  <Flash variant=\"warning\">Warning Flash</Flash>\n  <Flash variant=\"danger\">Danger Flash</Flash>\n</>\n```\n\n### With an icon\n\nFlash components with icons inside of them will automatically set the correct color for the icon depending on the type of Flash, as well as applying the correct right margin.\n\n```jsx live\n<Flash variant=\"success\">\n  <StyledOcticon icon={CheckIcon} />\n  Success!\n</Flash>\n```\n\n## Props\n\n### Flash\n\n<PropsTable>\n  <PropsTableRow name=\"full\" type=\"boolean\" defaultValue=\"false\" description=\"Creates a full width Flash component\" />\n  <PropsTableRow\n    name=\"variant\"\n    type=\"'default' | 'success' | 'warning' | 'danger'\"\n    defaultValue=\"'default'\"\n    description=\"Sets the background color and border\"\n  />\n  <PropsTableBasePropRows\n    elementType=\"div\"\n    isPolymorphic\n    refType=\"HTMLDivElement\"\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#Attributes\">MDN</Link>\n    }\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: false,\n    fullTestCoverage: false,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Flash"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/FormControl.mdx","frontmatter":{"title":"FormControl"},"rawBody":"---\ncomponentId: form_control\ntitle: FormControl\nstatus: Alpha\ndescription: Renders a labelled input and, optionally, associated validation text and/or hint text.\nsource: https://github.com/primer/react/blob/main/src/FormControl/FormControl.tsx\nstorybook: '/react/storybook?path=/story/forms-inputfield--text-input-field'\n---\n\nimport {\n  FormControl,\n  TextInputWithTokens,\n  Autocomplete,\n  Select,\n  Textarea,\n  Checkbox,\n  CheckboxGroup,\n  Radio,\n  RadioGroup,\n  Text\n} from '@primer/react'\nimport {MarkGithubIcon} from '@primer/octicons-react'\n\n## Examples\n\n### Basic\n\n```jsx live\n<FormControl>\n  <FormControl.Label>Name</FormControl.Label>\n  <TextInput />\n</FormControl>\n```\n\n### With complex inputs\n\n```javascript live noinline\nconst DifferentInputs = () => {\n  const [tokens, setTokens] = React.useState([\n    {text: 'zero', id: 0},\n    {text: 'one', id: 1},\n    {text: 'two', id: 2}\n  ])\n  const onTokenRemove = tokenId => {\n    setTokens(tokens.filter(token => token.id !== tokenId))\n  }\n\n  return (\n    <Box display=\"grid\" gridGap={3}>\n      <FormControl>\n        <FormControl.Label>TextInputWithTokens</FormControl.Label>\n        <TextInputWithTokens onTokenRemove={onTokenRemove} tokens={tokens} />\n      </FormControl>\n      <FormControl>\n        <FormControl.Label>Autocomplete</FormControl.Label>\n        <Autocomplete>\n          <Autocomplete.Input block />\n          <Autocomplete.Overlay>\n            <Autocomplete.Menu\n              items={[\n                {text: 'css', id: 0},\n                {text: 'css-in-js', id: 1},\n                {text: 'styled-system', id: 2},\n                {text: 'javascript', id: 3},\n                {text: 'typescript', id: 4},\n                {text: 'react', id: 5},\n                {text: 'design-systems', id: 6}\n              ]}\n              selectedItemIds={[]}\n            />\n          </Autocomplete.Overlay>\n        </Autocomplete>\n      </FormControl>\n      <FormControl>\n        <FormControl.Label>Select</FormControl.Label>\n        <Select>\n          <Select.Option value=\"figma\">Figma</Select.Option>\n          <Select.Option value=\"css\">Primer CSS</Select.Option>\n          <Select.Option value=\"prc\">Primer React components</Select.Option>\n          <Select.Option value=\"pvc\">Primer ViewComponents</Select.Option>\n        </Select>\n      </FormControl>\n      <FormControl>\n        <FormControl.Label>Textarea</FormControl.Label>\n        <Textarea />\n      </FormControl>\n    </Box>\n  )\n}\n\nrender(DifferentInputs)\n```\n\n### With a custom input\n\n<Note variant=\"warning\">\n\nWhen rendering an input other than a form component from Primer, you must manually pass the attributes that make the form control accessible:\n\n- The input should have an ID\n- `FormControl.Label` should be associated with the text input by using `htmlFor`\n- If there is a caption, the input should be associated with the caption by passing the message's ID to `aria-describedby`\n- If there is a validation message, the input should be associated with the message by passing the message's ID to `aria-describedby`\n- If there is both a caption and a validation message, the input should be associated with the message by passing the both the validation message's ID and the caption's ID to `aria-describedby`. Example: `aria-describedby=\"caption-id validation-id\"`\n- If the input's value is invalid, `aria-invalid={true}` should be passed to the input.\n- If the input is disabled, `disabled` should be passed.\n- If the input is required, `required` should be passed.\n\nWhen rendering a custom checkbox or radio component, you must also pass `layout=\"horizontal\"` to the `FormControl` component.\n\n</Note>\n\n```javascript live noinline\nconst CustomTextInput = props => <input type=\"text\" {...props} />\nconst CustomCheckboxInput = props => <input type=\"checkbox\" {...props} />\nconst FormControlWithCustomInput = () => {\n  const [value, setValue] = React.useState('mona lisa')\n  const [validationResult, setValidationResult] = React.useState()\n  const doesValueContainSpaces = inputValue => /\\s/g.test(inputValue)\n  const handleInputChange = e => {\n    setValue(e.currentTarget.value)\n  }\n\n  React.useEffect(() => {\n    if (doesValueContainSpaces(value)) {\n      setValidationResult('noSpaces')\n    } else if (value) {\n      setValidationResult('validName')\n    }\n  }, [value])\n\n  return (\n    <Box display=\"grid\" gridGap={3}>\n      <FormControl>\n        <FormControl.Label htmlFor=\"custom-input\">GitHub handle</FormControl.Label>\n        <CustomTextInput\n          id=\"custom-input\"\n          aria-describedby=\"custom-input-caption custom-input-validation\"\n          aria-invalid={validationResult === 'noSpaces'}\n          onChange={handleInputChange}\n        />\n        {validationResult === 'noSpaces' && (\n          <FormControl.Validation id=\"custom-input-validation\" variant=\"error\">\n            GitHub handles cannot contain spaces\n          </FormControl.Validation>\n        )}\n        {validationResult === 'validName' && (\n          <FormControl.Validation id=\"custom-input-validation\" variant=\"success\">\n            Valid name\n          </FormControl.Validation>\n        )}\n        <FormControl.Caption id=\"custom-input-caption\">\n          With or without \"@\". For example \"monalisa\" or \"@monalisa\"\n        </FormControl.Caption>\n      </FormControl>\n\n      <CheckboxGroup>\n        <CheckboxGroup.Label>Checkboxes</CheckboxGroup.Label>\n        <FormControl layout=\"horizontal\">\n          <CustomCheckboxInput id=\"custom-checkbox-one\" value=\"checkOne\" />\n          <FormControl.Label htmlFor=\"custom-checkbox-one\">Checkbox one</FormControl.Label>\n          <FormControl.Caption id=\"custom-checkbox-one-caption\">Hint text for checkbox one</FormControl.Caption>\n        </FormControl>\n        <FormControl layout=\"horizontal\">\n          <CustomCheckboxInput id=\"custom-checkbox-two\" value=\"checkTwo\" />\n          <FormControl.Label htmlFor=\"custom-checkbox-two\">Checkbox two</FormControl.Label>\n          <FormControl.Caption id=\"custom-checkbox-two-caption\">Hint text for checkbox two</FormControl.Caption>\n        </FormControl>\n      </CheckboxGroup>\n    </Box>\n  )\n}\n\nrender(FormControlWithCustomInput)\n```\n\n### With checkbox and radio inputs\n\n```jsx live\n<Box display=\"grid\" sx={{gap: 3}}>\n  <CheckboxGroup>\n    <CheckboxGroup.Label>Checkboxes</CheckboxGroup.Label>\n    <FormControl>\n      <Checkbox value=\"checkOne\" />\n      <FormControl.Label>Checkbox one</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Checkbox value=\"checkTwo\" />\n      <FormControl.Label>Checkbox two</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Checkbox value=\"checkThree\" />\n      <FormControl.Label>Checkbox three</FormControl.Label>\n    </FormControl>\n  </CheckboxGroup>\n\n  <RadioGroup>\n    <RadioGroup.Label>Radios</RadioGroup.Label>\n    <FormControl>\n      <Radio name=\"radioChoices\" value=\"radioOne\" />\n      <FormControl.Label>Radio one</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Radio name=\"radioChoices\" value=\"radioTwo\" />\n      <FormControl.Label>Radio two</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Radio name=\"radioChoices\" value=\"radioThree\" />\n      <FormControl.Label>Radio three</FormControl.Label>\n    </FormControl>\n  </RadioGroup>\n</Box>\n```\n\n### Required\n\n```jsx live\n<FormControl required>\n  <FormControl.Label>Name</FormControl.Label>\n  <TextInput />\n</FormControl>\n```\n\n<Note>\n  Checkbox and radio form controls cannot be required individually. Instead, you can require a selection from the entire\n  group of checkboxes or radios.\n</Note>\n\n### Disabled\n\n```jsx live\n<Box display=\"grid\" gridGap={3}>\n  <FormControl disabled>\n    <FormControl.Label>Name</FormControl.Label>\n    <TextInput />\n  </FormControl>\n\n  <FormControl disabled>\n    <FormControl.Label>Checkbox option</FormControl.Label>\n    <Checkbox />\n  </FormControl>\n</Box>\n```\n\n### With a visually hidden label\n\n```jsx live\n<Box display=\"grid\" gridGap={3}>\n  <FormControl>\n    <FormControl.Label visuallyHidden>Name</FormControl.Label>\n    <TextInput />\n  </FormControl>\n  <FormControl>\n    <FormControl.Label visuallyHidden>Checkbox option</FormControl.Label>\n    <Checkbox />\n  </FormControl>\n</Box>\n```\n\n<Note>\n\nWe encourage using `FormControl` alongside all standalone form components like [`TextInput`](/TextInput), as every input must have a corresponding label to be accessible to assistive technology.\n\n`FormControl` also provides an interface for showing a hint text caption and a validation message, and associating those with the input for assistive technology.\n\n</Note>\n\n### With a caption\n\n```jsx live\n<Box display=\"grid\" gridGap={3}>\n  <FormControl>\n    <FormControl.Label>Name</FormControl.Label>\n    <TextInput />\n    <FormControl.Caption>Hint: your first name</FormControl.Caption>\n  </FormControl>\n  <FormControl>\n    <FormControl.Label>Option one</FormControl.Label>\n    <Checkbox />\n    <FormControl.Caption>Hint: the first and only option</FormControl.Caption>\n  </FormControl>\n</Box>\n```\n\n### With validation\n\n<Note>Validation messages are not used for an individual checkbox or radio form control.</Note>\n\n```javascript live noinline\nconst ValidationExample = () => {\n  const [value, setValue] = React.useState('mona lisa')\n  const [validationResult, setValidationResult] = React.useState()\n  const doesValueContainSpaces = inputValue => /\\s/g.test(inputValue)\n  const handleInputChange = e => {\n    setValue(e.currentTarget.value)\n  }\n\n  React.useEffect(() => {\n    if (doesValueContainSpaces(value)) {\n      setValidationResult('noSpaces')\n    } else if (value) {\n      setValidationResult('validName')\n    }\n  }, [value])\n\n  return (\n    <FormControl>\n      <FormControl.Label>GitHub handle</FormControl.Label>\n      <TextInput block value={value} onChange={handleInputChange} />\n      {validationResult === 'noSpaces' && (\n        <FormControl.Validation variant=\"error\">GitHub handles cannot contain spaces</FormControl.Validation>\n      )}\n      {validationResult === 'validName' && (\n        <FormControl.Validation variant=\"success\">Valid name</FormControl.Validation>\n      )}\n      <FormControl.Caption>With or without \"@\". For example \"monalisa\" or \"@monalisa\"</FormControl.Caption>\n    </FormControl>\n  )\n}\n\nrender(ValidationExample)\n```\n\n### With a leading visual\n\n<Note>Only a checkbox or radio form control may have a leading visual.</Note>\n\n```jsx live\n<>\n  <FormControl>\n    <FormControl.Label>Option one</FormControl.Label>\n    <FormControl.LeadingVisual>\n      <MarkGithubIcon />\n    </FormControl.LeadingVisual>\n    <Checkbox />\n  </FormControl>\n\n  <FormControl>\n    <FormControl.Label>Option two</FormControl.Label>\n    <FormControl.LeadingVisual>\n      <MarkGithubIcon />\n    </FormControl.LeadingVisual>\n    <Checkbox />\n    <FormControl.Caption>This one has a caption</FormControl.Caption>\n  </FormControl>\n</>\n```\n\n## Props\n\n### FormControl\n\nThe container that handles the layout and passes the relevant IDs and ARIA attributes it's children.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    type=\"FormControl.Label | FormControl.Caption | FormControl.Validation | Autocomplete | TextInput | TextInputWithTokens | Select\"\n    required\n  />\n  <PropsTableRow\n    name=\"disabled\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Whether the control allows user input\"\n  />\n  <PropsTableRow\n    name=\"id\"\n    type=\"string\"\n    defaultValue=\"a generated string\"\n    description=\"The unique identifier for this control. Used to associate the label, validation text, and caption text\"\n  />\n  <PropsTableRow\n    name=\"required\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"If true, the user must specify a value for the input before the owning form can be submitted\"\n  />\n  <PropsTableRefRow refType=\"HTMLDivElement\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n### FormControl.Label\n\nA `FormControl.Label` must be passed for the field to be accessible to assistive technology, but it may be visually hidden.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"visuallyHidden\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Whether the label should be visually hidden\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### FormControl.Caption\n\n`FormControl.Caption` may be used to render hint text for fields that require additional context.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    type=\"React.ReactNode\"\n    description=\"The content (usually just text) that is rendered to give contextual info about the field\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### FormControl.Validation\n\nUse `FormControl.Validation` to render contextual validation information if necessary.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    type=\"React.ReactNode\"\n    description=\"The content (usually just text) that is rendered to give contextual info about the validation result for the field\"\n  />\n  <PropsTableRow\n    required\n    name=\"variant\"\n    type=\"'error' | 'success' | 'warning'\"\n    description=\"Changes the visual style to match the validation status\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n<Note>\n\nValidation messages should not be shown for an individual checkbox or radio form control, so `FormControl.Validation`\nwill not be rendered when a `Checkbox` or `Radio` is not a child of `FormControl`. Validation messages for checkbox\nand radio selections should only apply to the entire group of inputs.\n\n</Note>\n\n### FormControl.LeadingVisual\n\nUse `FormControl.LeadingVisual` if the selectable option is easier to understand with a visual.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    type=\"React.ReactNode\"\n    description=\"The visual to render before the choice input's label\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n<Note>\n\nOnly a checkbox or radio form control may have a leading visual. If you want to render a leading visual\n**inside** an input, check if that input component supports a leading visual.\n\n</Note>\n\n## Component status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: true,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"FormControl"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Header.mdx","frontmatter":{"title":"Header"},"rawBody":"---\ntitle: Header\ndescription: Use the Header component to create a header that has all of its items aligned vertically with consistent horizontal spacing\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/Header.tsx\ncomponentId: header\n---\n\n## Examples\n\nAll items directly under the Header component should be a `Header.Item` component. Inside these components can be anything (text, forms, images...), and the `Header.Item` component will make sure these elements vertically align with each other.\n\n`Header.Item` elements have a built-in margin that will need to be overridden with the `mr={0}` props for the last element in the container. We relied on the prop here instead of `:last-child` because the last child isn't always the item visible. On responsive pages, there's a mobile menu that gets presented to the user at smaller breakpoints.\n\n```jsx live\n<Header>\n  <Header.Item>\n    <Header.Link href=\"#\" fontSize={2}>\n      <StyledOcticon icon={MarkGithubIcon} size={32} sx={{mr: 2}} />\n      <span>GitHub</span>\n    </Header.Link>\n  </Header.Item>\n  <Header.Item full>Menu</Header.Item>\n  <Header.Item mr={0}>\n    <Avatar src=\"https://github.com/octocat.png\" size={20} square alt=\"@octocat\" />\n  </Header.Item>\n</Header>\n```\n\n### With full-size item\n\n```jsx live\n<Header>\n  <Header.Item>Item 1</Header.Item>\n  <Header.Item full border={1} borderStyle=\"solid\">\n    Item 2\n  </Header.Item>\n  <Header.Item mr={0}>Item 3</Header.Item>\n</Header>\n```\n\n### With links\n\n```jsx live\n<Header>\n  <Header.Item>\n    <Header.Link href=\"#\">About</Header.Link>\n  </Header.Item>\n  <Header.Item>\n    <Header.Link href=\"#\">Releases</Header.Link>\n  </Header.Item>\n  <Header.Item>\n    <Header.Link href=\"#\">Team</Header.Link>\n  </Header.Item>\n</Header>\n```\n\n## Props\n\n### Header\n\n<PropsTable>\n  <PropsTableSxRow />\n</PropsTable>\n\n### Header.Item\n\n<PropsTable>\n  <PropsTableRow name=\"full\" type=\"string\" description=\"Stretches item to fill the available space\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n### Header.Link\n\n<PropsTable>\n  <PropsTableRow name=\"href\" type=\"string\" description=\"URL to be used for the Link\" />\n  <PropsTableBasePropRows\n    elementType=\"a\"\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes\">MDN</Link>\n    }\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: false,\n    fullTestCoverage: false,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Header"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Heading.mdx","frontmatter":{"title":"Heading"},"rawBody":"---\ntitle: Heading\ndescription: Use Heading to structure your content and provide an accessible experience for users of assistive technologies.\nsource: https://github.com/primer/react/blob/main/src/Heading.tsx\nstatus: Alpha\ncomponentId: heading\n---\n\nThe Heading component will render an html `h2` tag without any default styling. Other heading level elements `h1-h6` are available through use of the `as` prop (see [System Props](/system-props) for additional explanation). Please reference the [w3 recommendations for headings](https://www.w3.org/WAI/tutorials/page-structure/headings/) to ensure your headings provide an accessible experience for screen reader users.\n\n**Attention:** Make sure to include a valid heading element to render a Heading component other than `h2` (`<Heading as=\"h1\">H1 Element</Heading>`).\n\n## Example\n\n```jsx live\n<Heading sx={{fontSize: 1, mb: 2}}>H2 heading with fontSize={1}</Heading>\n```\n\n## Props\n\n<PropsTable>\n  <PropsTableAsRow defaultElementType=\"h2\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: false,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Heading"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/IconButton.mdx","frontmatter":{"title":"IconButton"},"rawBody":"---\ntitle: IconButton\ncomponentId: icon_button\nstatus: Alpha\nsource: https://github.com/primer/react/tree/main/src/Button\nstorybook: '/react/storybook?path=/story/composite-components-button'\ndescription: An accessible button component with no text and only icon.\n---\n\n## Usage\n\n### Installation\n\n```js\nimport {IconButton} from '@primer/react'\n```\n\n### Icon only button\n\nA separate component called `IconButton` is used if the action shows only an icon with no text. This button will remain square in shape.\n\n```jsx live\n<IconButton aria-label=\"Search\" icon={SearchIcon} />\n```\n\n### Different sized icon buttons\n\n`IconButton` also supports the three different sizes. `small`, `medium`, `large`.\n\n```jsx live\n<>\n  <IconButton aria-label=\"Search\" icon={SearchIcon} size=\"small\" />\n  <IconButton aria-label=\"Search\" sx={{ml: 2}} icon={SearchIcon} />\n  <IconButton aria-label=\"Search\" sx={{ml: 2}} icon={SearchIcon} size=\"large\" />\n</>\n```\n\n## API reference\n\nNative `<button>` HTML attributes are forwarded to the underlying React `button` component and are not listed below.\n\n### Button\n\n<PropsTable>\n  <PropsTableRow name=\"children\" required type=\"React.ReactNode\" description=\"This will be the Button description.\" />\n  <PropsTableRow\n    name=\"variant\"\n    type=\"'default' | 'primary' | 'danger' | 'outline' | 'invisible'\"\n    description=\"Changes the look and feel of the button which is different for each variant\"\n  />\n  <PropsTableRow\n    name=\"size\"\n    type=\"'small' | 'medium' | 'large'\"\n    description=\"Changes the size of the icon button component\"\n  />\n  <PropsTableRow\n    name=\"icon\"\n    type=\"Component\"\n    description=\"provide an octicon. It will be placed in the center of the button\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Component status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"IconButton"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Label.mdx","frontmatter":{"title":"Label"},"rawBody":"---\ntitle: Label\ncomponentId: label\nstatus: Alpha\nsource: https://github.com/primer/react/tree/main/src/Label\nstorybook: '/react/storybook?path=story/labels-label--label'\ndescription: Use Label components to add contextual metadata to a design.\n---\n\n## Examples\n\n### Basic\n\n```javascript live noinline\nrender(<Label>Default</Label>)\n```\n\n### Variants\n\n```javascript live noinline\nrender(\n  <>\n    <Label>Default</Label>\n    <Label variant=\"primary\">Primary</Label>\n    <Label variant=\"secondary\">Secondary</Label>\n    <Label variant=\"accent\">Accent</Label>\n    <Label variant=\"success\">Success</Label>\n    <Label variant=\"attention\">Attention</Label>\n    <Label variant=\"severe\">Severe</Label>\n    <Label variant=\"danger\">Danger</Label>\n    <Label variant=\"done\">Done</Label>\n    <Label variant=\"sponsors\">Sponsors</Label>\n  </>\n)\n```\n\n### Sizes\n\n```javascript live noinline\nrender(\n  <>\n    <Label>Small (default)</Label>\n    <Label size=\"large\">Large</Label>\n  </>\n)\n```\n\n## Props\n\n### Label\n\n<PropsTable>\n  <PropsTableRow\n    name=\"variant\"\n    type={`| 'default'\n| 'primary'\n| 'secondary'\n| 'accent'\n| 'success'\n| 'attention'\n| 'severe'\n| 'danger'\n| 'done'\n| 'sponsors'`}\n    defaultValue=\"'default'\"\n    description=\"The color of the label\"\n  />\n  <PropsTableRow\n    name=\"size\"\n    type=\"'small' | 'large'\"\n    defaultValue=\"'small'\"\n    description=\"How large the label is rendered\"\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Label"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/LabelGroup.mdx","frontmatter":{"title":"LabelGroup"},"rawBody":"---\ntitle: LabelGroup\ndescription: Use LabelGroup components to add commonly used margins and other layout constraints to groups of Labels\nsource: https://github.com/primer/react/blob/main/src/LabelGroup.tsx\nstatus: Alpha\ncomponentId: label_group\n---\n\n## Example\n\n```jsx live\n<LabelGroup>\n  <Label>Default label</Label>\n  <Label sx={{color: 'fg.onEmphasis', bg: 'danger.emphasis'}}>Label with background indicating a closed PR state</Label>\n  <Label outline>Default outline label</Label>\n</LabelGroup>\n```\n\n## Props\n\n<PropsTable>\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: null,\n    adaptsToScreenSizes: null,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"LabelGroup"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Link.mdx","frontmatter":{"title":"Link"},"rawBody":"---\ncomponentId: link\ntitle: Link\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/Link.tsx\n---\n\nThe Link component styles anchor tags with default hyperlink color cues and hover text decoration. `Link` is used for destinations, or moving from one page to another.\n\nIn special cases where you'd like a `<button>` styled like a `Link`, use `<Link as='button'>`. Make sure to provide a click handler with `onClick`.\n\n**Important:** When using the `as` prop, be sure to always render an accessible element type, like `a`, `button`, `input`, or `summary`.\n\n## Examples\n\n```jsx live\n<Link href=\"https://github.com\">Link</Link>\n```\n\n## Props\n\n### Link\n\n<PropsTable>\n  <PropsTableRow\n    name=\"href\"\n    type=\"string\"\n    description={\n      <>\n        URL to be used for the Link. (The <InlineCode>href</InlineCode> is passed to the underlying{' '}\n        <InlineCode>&lt;a&gt;</InlineCode> element. If <InlineCode>as</InlineCode> is specified, the link behavior may\n        need different props).\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"muted\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Uses a less prominent shade for Link color, and the default link shade on hover\"\n  />\n  <PropsTableRow name=\"underline\" type=\"boolean\" defaultValue=\"false\" description=\"Adds underline to the Link\" />\n  <PropsTableRow name=\"hoverColor\" type=\"string\" description=\"Color used when hovering over link\" />\n  <PropsTableBasePropRows\n    elementType=\"a\"\n    refType=\"HTMLAnchorElement\"\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes\">MDN</Link>\n    }\n    isPolymorphic\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: false,\n    usedInProduction: true,\n    usageExamplesDocumented: false,\n    hasStorybookStories: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Link"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/NavList.mdx","frontmatter":{"title":"NavList"},"rawBody":"---\ntitle: NavList\nstatus: Draft\ndescription: Use nav list to render a vertical list of navigation links.\nsource: https://github.com/primer/react/tree/main/src/NavList\n---\n\n```js\nimport {NavList} from '@primer/react/drafts'\n```\n\n## Examples\n\n### Simple\n\n```jsx live drafts\n<NavList>\n  <NavList.Item href=\"/\" aria-current=\"page\">\n    Home\n  </NavList.Item>\n  <NavList.Item href=\"/about\">About</NavList.Item>\n  <NavList.Item href=\"/contact\">Contact</NavList.Item>\n</NavList>\n```\n\n### With leading icons\n\n```jsx live drafts\n<NavList>\n  <NavList.Item href=\"/\" aria-current=\"page\">\n    <NavList.LeadingVisual>\n      <HomeIcon />\n    </NavList.LeadingVisual>\n    Dashboard\n  </NavList.Item>\n  <NavList.Item href=\"/pulls\">\n    <NavList.LeadingVisual>\n      <GitPullRequestIcon />\n    </NavList.LeadingVisual>\n    Pull requests\n  </NavList.Item>\n  <NavList.Item href=\"/issues\">\n    <NavList.LeadingVisual>\n      <IssueOpenedIcon />\n    </NavList.LeadingVisual>\n    Issues\n  </NavList.Item>\n</NavList>\n```\n\n### With other leading visuals\n\n```jsx live drafts\n<NavList>\n  <NavList.Item href=\"/general\" aria-current=\"page\">\n    <NavList.LeadingVisual>\n      <span aria-hidden>#️⃣</span>\n    </NavList.LeadingVisual>\n    General\n  </NavList.Item>\n  <NavList.Item href=\"/q-a\">\n    <NavList.LeadingVisual>\n      <span aria-hidden>🙏</span>\n    </NavList.LeadingVisual>\n    Q&A\n  </NavList.Item>\n  <NavList.Item href=\"/show-and-tell\">\n    <NavList.LeadingVisual>\n      <span aria-hidden>🙌</span>\n    </NavList.LeadingVisual>\n    Show and tell\n  </NavList.Item>\n</NavList>\n```\n\n### With trailing visuals\n\n```jsx live drafts\n<NavList>\n  <NavList.Item href=\"/inbox\" aria-current=\"page\">\n    Inbox\n    <NavList.TrailingVisual>1,234</NavList.TrailingVisual>\n  </NavList.Item>\n  <NavList.Item href=\"/saved\">Saved</NavList.Item>\n  <NavList.Item href=\"/done\">Done</NavList.Item>\n</NavList>\n```\n\n### With a heading\n\n```jsx live drafts\n<>\n  <Heading as=\"h3\" id=\"workflows-heading\" sx={{fontSize: 2}}>\n    Workflows\n  </Heading>\n  <NavList aria-labelledby=\"workflows-heading\">\n    <NavList.Item href=\"/\" aria-current=\"page\">\n      All workflows\n    </NavList.Item>\n    <NavList.Item href=\"/ci\">CI</NavList.Item>\n    <NavList.Item href=\"/deploy\">Deploy</NavList.Item>\n    <NavList.Item href=\"/release\">Release</NavList.Item>\n  </NavList>\n</>\n```\n\n### With aria-label\n\n```jsx live drafts\n<NavList aria-label=\"Security\">\n  <NavList.Item href=\"/\" aria-current=\"page\">\n    Overview\n  </NavList.Item>\n  <NavList.Item href=\"/policy\">Security policy</NavList.Item>\n  <NavList.Item href=\"/advisories\">Security advisories</NavList.Item>\n</NavList>\n```\n\n### With groups\n\n```jsx live drafts\n<NavList>\n  <NavList.Group title=\"Overview\">\n    <NavList.Item href=\"/getting-started\" aria-current=\"page\">\n      Getting started\n    </NavList.Item>\n  </NavList.Group>\n  <NavList.Group title=\"Components\">\n    <NavList.Item href=\"/Avatar\">Avatar</NavList.Item>\n    <NavList.Item href=\"/Button\">Button</NavList.Item>\n    <NavList.Item href=\"/Label\">Label</NavList.Item>\n  </NavList.Group>\n</NavList>\n```\n\n### With sub-items\n\n```jsx live drafts\n<NavList>\n  <NavList.Item href=\"/branches\">Branches</NavList.Item>\n  <NavList.Item href=\"/tags\">Tags</NavList.Item>\n  <NavList.Item>\n    Actions\n    <NavList.SubNav>\n      <NavList.Item href=\"/actions\" aria-current=\"page\">\n        General\n      </NavList.Item>\n      <NavList.Item href=\"/actions/runners\">Runners</NavList.Item>\n    </NavList.SubNav>\n  </NavList.Item>\n</NavList>\n```\n\n<Note variant=\"warning\">\n\nIf a `NavList.Item` contains a `NavList.SubNav`, the `NavList.Item` will render as a `<button>` and the `as` prop and `href` prop will be ignored.\n\n</Note>\n\n### With a divider\n\n```jsx live drafts\n<NavList>\n  <NavList.Item href=\"/\" aria-current=\"page\">\n    Dashboard\n  </NavList.Item>\n  <NavList.Item href=\"/pulls\">Pull requests</NavList.Item>\n  <NavList.Item href=\"/issues\">Issues</NavList.Item>\n  <NavList.Divider />\n  <NavList.Item href=\"/marketplace\">Marketplace</NavList.Item>\n  <NavList.Item href=\"/explore\">Explore</NavList.Item>\n</NavList>\n```\n\n### With React Router\n\n```jsx\nimport {Link, useMatch, useResolvedPath} from 'react-router-dom'\nimport {NavList} from '@primer/react'\n\nfunction NavItem({to, children}) {\n  const resolved = useResolvedPath(to)\n  const isCurrent = useMatch({path: resolved.pathname, end: true})\n  return (\n    <NavList.Item as={Link} to={to} aria-current={isCurrent ? 'page' : false}>\n      {children}\n    </NavList.Item>\n  )\n}\n\nfunction App() {\n  return (\n    <NavList>\n      <NavItem to=\"/\">Dashboard</NavItem>\n      <NavItem to=\"/pulls\">Pull requests</NavItem>\n      <NavItem to=\"/issues\">Issues</NavItem>\n    </NavList>\n  )\n}\n```\n\n### With Next.js\n\n```jsx\nimport {useRouter} from 'next/router'\nimport Link from 'next/link'\nimport {NavList} from '@primer/react'\n\nfunction NavItem({href, children}) {\n  const router = useRouter()\n  const isCurrent = router.asPath === href\n  return (\n    <Link href={href} passHref>\n      <NavList.Item aria-current={isCurrent ? 'page' : false}>{children}</NavList.Item>\n    </Link>\n  )\n}\n\nfunction App() {\n  return (\n    <NavList>\n      <NavItem href=\"/\">Dashboard</NavItem>\n      <NavItem href=\"/pulls\">Pull requests</NavItem>\n      <NavItem href=\"/issues\">Issues</NavItem>\n    </NavList>\n  )\n}\n```\n\n## Props\n\n### NavList\n\n<PropsTable>\n  <PropsTableRow name=\"aria-label\" type=\"string\" />\n  <PropsTableRow name=\"aria-labelledby\" type=\"string\" />\n  <PropsTableBasePropRows\n    elementType=\"nav\"\n    refType=\"HTMLElement\"\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav#Attributes\">MDN</Link>\n    }\n  />\n</PropsTable>\n\n### NavList.Item\n\n<PropsTable>\n  <PropsTableRow\n    name=\"href\"\n    type=\"string\"\n    description={\n      <>\n        The URL that the item navigates to. <InlineCode>href</InlineCode> is passed to the underlying{' '}\n        <InlineCode>&lt;a&gt;</InlineCode> element. If <InlineCode>as</InlineCode> is specified, the component may need\n        different props. If the item contains a sub-nav, the item is rendered as a{' '}\n        <InlineCode>&lt;button&gt;</InlineCode> and <InlineCode>href</InlineCode> is ignored.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"aria-current\"\n    type={`| 'page'\n| 'step'\n| 'location'\n| 'date'\n| 'time'\n| true\n| false`}\n    defaultValue=\"false\"\n    description={\n      <>\n        Set <InlineCode>aria-current</InlineCode> to <InlineCode>\"page\"</InlineCode> to indicate that the item\n        represents the current page. Set <InlineCode>aria-current</InlineCode> to <InlineCode>\"location\"</InlineCode> to\n        indicate that the item represents the current location on a page. For more information about{' '}\n        <InlineCode>aria-current</InlineCode>, see{' '}\n        <Link href=\"https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current\">MDN</Link>.\n      </>\n    }\n  />\n  <PropsTableBasePropRows\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes\">MDN</Link>\n    }\n    elementType=\"a\"\n    isPolymorphic\n    refType=\"HTMLAnchorElement\"\n  />\n</PropsTable>\n\n### NavList.LeadingVisual\n\n<PropsTable>\n  <PropsTableSxRow />\n  <PropsTableRefRow refType=\"HTMLElement\" />\n</PropsTable>\n\n### NavList.TrailingVisual\n\n<PropsTable>\n  <PropsTableSxRow />\n  <PropsTableRefRow refType=\"HTMLElement\" />\n</PropsTable>\n\n### NavList.SubNav\n\n<PropsTable>\n  <PropsTableSxRow />\n  <PropsTableRefRow refType=\"HTMLElement\" />\n</PropsTable>\n\n### NavList.Group\n\n<PropsTable>\n  <PropsTableRow name=\"title\" type=\"string\" description=\"Title of the group.\" /> {/* Should `title` be required? */}\n  <PropsTableSxRow />\n  <PropsTableRefRow refType=\"HTMLElement\" />\n</PropsTable>\n\n### NavList.Divider\n\n<PropsTable>\n  <PropsTableSxRow />\n  <PropsTableRefRow refType=\"HTMLElement\" />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"NavList"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Overlay.mdx","frontmatter":{"title":"Overlay"},"rawBody":"---\ntitle: Overlay\ndescription: Use Overlay to provide a flexible floating surface for displaying transient content such as menus, selection options, dialogs, and more.\ncomponentId: overlay\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/Overlay.tsx\nstorybook: '/react/storybook?path=/story/internal-components-overlay--dropdown-overlay'\n---\n\n```js\nimport {Overlay} from '@primer/react'\n```\n\nThe `Overlay` component handles all behaviors needed by overlay UIs as well as the common styles that all overlays should have. `Overlay` is the base component for many of our overlay-type components. Overlays use shadows to express elevation.\n\n**Behaviors include:**\n\n- Rendering the overlay in a React Portal so that it always renders on top of other content on the page\n- Trapping focus\n- Calling a user provided function when the user presses `Escape`\n- Calling a user provided function when the user clicks outside of the container\n- Focusing either user provided element, or the first focusable element in the container when it is opened\n- Returning focus to an element when container is closed\n\n## Example\n\n```javascript live noinline\nconst Example = () => {\n  // you must manage your own open state\n  const [isOpen, setIsOpen] = React.useState(false)\n  const noButtonRef = React.useRef(null)\n  const anchorRef = React.useRef(null)\n  return (\n    <>\n      <Button ref={anchorRef} onClick={() => setIsOpen(!isOpen)}>\n        open overlay\n      </Button>\n      {/* be sure to conditionally render the Overlay. This helps with performance and is required. */}\n      {isOpen && (\n        <Overlay\n          initialFocusRef={noButtonRef}\n          returnFocusRef={anchorRef}\n          ignoreClickRefs={[anchorRef]}\n          onEscape={() => setIsOpen(!isOpen)}\n          onClickOutside={() => setIsOpen(false)}\n          aria-labelledby=\"title\"\n        >\n          <Box display=\"flex\" flexDirection=\"column\" p={2}>\n            <Text id=\"title\">Are you sure you would like to delete this item?</Text>\n            <Button>yes</Button>\n            <Button ref={noButtonRef}>no</Button>\n          </Box>\n        </Overlay>\n      )}\n    </>\n  )\n}\n\nrender(<Example />)\n```\n\n## Accessibility considerations\n\n- The `Overlay` must either have:\n  - A value set for the `aria-labelledby` attribute that refers to a visible title.\n  - An `aria-label` attribute\n- If the `Overlay` should also have a longer description, use `aria-describedby`\n- The `Overlay` component has a `role=\"dialog\"` set on it, if you are using `Overlay` for alerts, you can pass in `role=\"alertdialog\"` instead. Please read the [W3C guidelines](https://www.w3.org/TR/wai-aria-1.1/#alertdialog) to determine which role is best for your use case\n- The `Overlay` component has `aria-modal` set to `true` by default and should not be overridden as all `Overlay`s behave as modals.\n\nSee the W3C accessibility recommendations for modals [here](https://www.w3.org/TR/wai-aria-practices-1.1/#dialog_roles_states_props).\n\n## Positioning\n\n`Overlay` renders its `children` within a div positioned absolutely within a portal within the default portal root. The overlay will not update its positioning if the portal root's positioning changes (e.g., if the portal root is statically positioned after some DOM element that dynamically resizes). You may consider [customizing the portal or specifying a different portal root](/Portal#customizing-the-portal-root) to achieve different positioning behavior.\n\n## Props\n\n### Overlay\n\n<PropsTable>\n  <PropsTableRow\n    required\n    name=\"anchorRef\"\n    type=\"React.RefObject<HTMLElement>\"\n    description={\n      <>\n        Element the <InlineCode>Overlay</InlineCode> should be anchored to.\n      </>\n    }\n  />\n  <PropsTableRow\n    required\n    name=\"returnFocusRef\"\n    type=\"React.RefObject<HTMLElement>\"\n    description={\n      <>\n        Ref for the element to focus when the <InlineCode>Overlay</InlineCode> is closed.\n      </>\n    }\n  />\n  <PropsTableRow\n    required\n    name=\"onClickOutside\"\n    type=\"function\"\n    description={\n      <>\n        Function to call when clicking outside of the <InlineCode>Overlay</InlineCode>. Typically this function sets the{' '}\n        <InlineCode>Overlay</InlineCode> visibility state to <InlineCode>false</InlineCode>.\n      </>\n    }\n  />\n  <PropsTableRow\n    required\n    name=\"onEscape\"\n    type=\"function\"\n    description={\n      <>\n        Function to call when user presses <InlineCode>Escape</InlineCode>. Typically this function sets the{' '}\n        <InlineCode>Overlay</InlineCode> visibility state to <InlineCode>false</InlineCode>.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"ignoreClickRefs\"\n    type=\"React.RefObject<HTMLElement> []\"\n    description={\n      <>\n        An array of ref objects to ignore clicks on in the onOutsideClick behavior. This is often used to ignore\n        clicking on the element that toggles the open/closed state for the Overlay to prevent the Overlay from being\n        toggled twice.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"initialFocusRef\"\n    type=\"React.RefObject<HTMLElement>\"\n    description={\n      <>\n        Ref for the element to focus when the <InlineCode>Overlay</InlineCode> is opened. If nothing is provided, the\n        first focusable element in the <InlineCode>Overlay</InlineCode> body is focused.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"width\"\n    type={`| 'small' \n| 'medium' \n| 'large' \n| 'xlarge' \n| 'xxlarge' \n| 'auto'`}\n    defaultValue=\"'auto'\"\n    description={\n      <>\n        Sets the width of the <InlineCode>Overlay</InlineCode>, pick from our set list of widths, or pass{' '}\n        <InlineCode>auto</InlineCode> to automatically set the width based on the content of the{' '}\n        <InlineCode>Overlay</InlineCode>. <InlineCode>small</InlineCode> corresponds to <InlineCode>256px</InlineCode>,{' '}\n        <InlineCode>medium</InlineCode> corresponds to <InlineCode>320px</InlineCode>, <InlineCode>large</InlineCode>{' '}\n        corresponds to <InlineCode>480px</InlineCode>, <InlineCode>xlarge</InlineCode> corresponds to{' '}\n        <InlineCode>640px</InlineCode>, <InlineCode>xxlarge</InlineCode> corresponds to <InlineCode>960px</InlineCode>.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"height\"\n    type={`| 'xsmall' \n| 'small' \n| 'medium' \n| 'large' \n| 'xlarge' \n| 'auto'`}\n    defaultValue=\"'auto'\"\n    description={\n      <>\n        Sets the height of the <InlineCode>Overlay</InlineCode>, pick from our set list of heights, or pass{' '}\n        <InlineCode>auto</InlineCode> to automatically set the height based on the content of the{' '}\n        <InlineCode>Overlay</InlineCode>. <InlineCode>xsmall</InlineCode> corresponds to <InlineCode>192px</InlineCode>,{' '}\n        <InlineCode>small</InlineCode> corresponds to <InlineCode>256px</InlineCode>, <InlineCode>medium</InlineCode>{' '}\n        corresponds to <InlineCode>320px</InlineCode>, <InlineCode>large</InlineCode> corresponds to{' '}\n        <InlineCode>432px</InlineCode>, <InlineCode>xlarge</InlineCode> corresponds to <InlineCode>600px</InlineCode>.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"visibility\"\n    type={`| 'visible' \n| 'hidden'`}\n    defaultValue=\"'visible'\"\n    description={\n      <>\n        Sets the visibility of the <InlineCode>Overlay</InlineCode>.\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"anchorSide\"\n    type={`| 'inside-top' \n| 'inside-bottom' \n| 'inside-left' \n| 'inside-right' \n| 'inside-center' \n| 'outside-top' \n| 'outside-bottom' \n| 'outside-left' \n| 'outside-right'`}\n    description={\n      <>If provided, the Overlay will slide into position from the side of the anchor with a brief animation</>\n    }\n  />\n  <PropsTableRow\n    name=\"top\"\n    type=\"number\"\n    defaultValue={0}\n    description={\n      <>\n        Vertical position of the overlay, relative to its closest positioned ancestor (often its\n        <InlineCode>Portal</InlineCode>).\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"left\"\n    type=\"number\"\n    defaultValue={0}\n    description={\n      <>\n        Horizontal position of the overlay, relative to its closest positioned ancestor (often its{' '}\n        <InlineCode>Portal</InlineCode>).\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"portalContainerName\"\n    type=\"string\"\n    description={\n      <>\n        If defined, Overlays will be rendered in the named portal. See also <InlineCode>Portal</InlineCode>.\n      </>\n    }\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: false,\n    usedInProduction: false,\n    usageExamplesDocumented: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Overlay"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/PageLayout.mdx","frontmatter":{"title":"PageLayout"},"rawBody":"---\ntitle: PageLayout\ncomponentId: page_layout\nstatus: Alpha\n# description: TODO\nsource: https://github.com/primer/react/tree/main/src/PageLayout\nstorybook: https://primer.style/react/storybook?path=/story/layout-pagelayout--playground\n---\n\n```js\nimport {PageLayout} from '@primer/react'\n```\n\n## Examples\n\n<Note>\n\nSee [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayout--playground) for fullscreen examples.\n\n</Note>\n\n### Default\n\n```jsx live\n<PageLayout>\n  <PageLayout.Header>\n    <Placeholder label=\"Header\" height={64} />\n  </PageLayout.Header>\n  <PageLayout.Content>\n    <Placeholder label=\"Content\" height={240} />\n  </PageLayout.Content>\n  <PageLayout.Pane>\n    <Placeholder label=\"Pane\" height={120} />\n  </PageLayout.Pane>\n  <PageLayout.Footer>\n    <Placeholder label=\"Footer\" height={64} />\n  </PageLayout.Footer>\n</PageLayout>\n```\n\n### With dividers\n\n```jsx live\n<PageLayout>\n  <PageLayout.Header divider=\"line\">\n    <Placeholder label=\"Header\" height={64} />\n  </PageLayout.Header>\n  <PageLayout.Content>\n    <Placeholder label=\"Content\" height={240} />\n  </PageLayout.Content>\n  <PageLayout.Pane divider=\"line\">\n    <Placeholder label=\"Pane\" height={120} />\n  </PageLayout.Pane>\n  <PageLayout.Footer divider=\"line\">\n    <Placeholder label=\"Footer\" height={64} />\n  </PageLayout.Footer>\n</PageLayout>\n```\n\n### With pane on left\n\n```jsx live\n<PageLayout>\n  <PageLayout.Header>\n    <Placeholder label=\"Header\" height={64} />\n  </PageLayout.Header>\n  <PageLayout.Content>\n    <Placeholder label=\"Content\" height={240} />\n  </PageLayout.Content>\n  <PageLayout.Pane position=\"start\">\n    <Placeholder label=\"Pane\" height={120} />\n  </PageLayout.Pane>\n  <PageLayout.Footer>\n    <Placeholder label=\"Footer\" height={64} />\n  </PageLayout.Footer>\n</PageLayout>\n```\n\n### With condensed spacing\n\n```jsx live\n<PageLayout padding=\"condensed\" rowGap=\"condensed\" columnGap=\"condensed\">\n  <PageLayout.Header>\n    <Placeholder label=\"Header\" height={64} />\n  </PageLayout.Header>\n  <PageLayout.Content>\n    <Placeholder label=\"Content\" height={240} />\n  </PageLayout.Content>\n  <PageLayout.Pane>\n    <Placeholder label=\"Pane\" height={120} />\n  </PageLayout.Pane>\n  <PageLayout.Footer>\n    <Placeholder label=\"Footer\" height={64} />\n  </PageLayout.Footer>\n</PageLayout>\n```\n\n### Without header or footer\n\n```jsx live\n<PageLayout>\n  <PageLayout.Content>\n    <Placeholder label=\"Content\" height={240} />\n  </PageLayout.Content>\n  <PageLayout.Pane>\n    <Placeholder label=\"Pane\" height={120} />\n  </PageLayout.Pane>\n</PageLayout>\n```\n\n## Props\n\n### PageLayout\n\n<!-- TODO: Responsive variants -->\n\n<PropsTable>\n  <PropsTableRow\n    name=\"containerWidth\"\n    type={`| 'full'\n| 'medium'\n| 'large'\n| 'xlarge'`}\n    defaultValue=\"'full'\"\n    description=\"The maximum width of the page container.\"\n  />\n  <PropsTableRow\n    name=\"padding\"\n    type={`| 'none'\n| 'normal'\n| 'condensed'`}\n    defaultValue=\"'normal'\"\n    description=\"The spacing between the outer edges of the page container and the viewport\"\n  />\n  <PropsTableRow\n    name=\"columnGap\"\n    type={`| 'none'\n| 'normal'\n| 'condensed'`}\n    defaultValue=\"'normal'\"\n  />\n  <PropsTableRow\n    name=\"rowGap\"\n    type={`| 'none'\n| 'normal'\n| 'condensed'`}\n    defaultValue=\"'normal'\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### PageLayout.Header\n\n<PropsTable>\n  <PropsTableRow\n    name=\"divider\"\n    type={`| 'none'\n| 'line'`}\n    defaultValue=\"'none'\"\n  />\n  <PropsTableRow\n    name=\"dividerWhenNarrow\"\n    type={`| 'inherit'\n| 'none'\n| 'line'\n| 'filled'`}\n    defaultValue=\"'inherit'\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### PageLayout.Content\n\n<PropsTable>\n  <PropsTableRow\n    name=\"width\"\n    type={`| 'full'\n| 'medium'\n| 'large'\n| 'xlarge'`}\n    defaultValue=\"'full'\"\n    description=\"The maximum width of the content region.\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### PageLayout.Pane\n\n<PropsTable>\n  <PropsTableRow\n    name=\"position\"\n    type={`| 'start'\n| 'end'`}\n    defaultValue=\"'start'\"\n  />\n  <PropsTableRow\n    name=\"positionWhenNarrow\"\n    type={`| 'inherit'\n| 'start'\n| 'end'`}\n    defaultValue=\"'inherit'\"\n  />\n  <PropsTableRow\n    name=\"width\"\n    type={`| 'small'\n| 'medium'\n| 'large'`}\n    defaultValue=\"'medium'\"\n    description=\"The width of the pane.\"\n  />\n  <PropsTableRow\n    name=\"divider\"\n    type={`| 'none'\n| 'line'`}\n    defaultValue=\"'none'\"\n  />\n  <PropsTableRow\n    name=\"dividerWhenNarrow\"\n    type={`| 'inherit'\n| 'none'\n| 'line'\n| 'filled'`}\n    defaultValue=\"'inherit'\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### PageLayout.Footer\n\n<PropsTable>\n  <PropsTableRow\n    name=\"divider\"\n    type={`| 'none'\n| 'line'`}\n    defaultValue=\"'none'\"\n  />\n  <PropsTableRow\n    name=\"dividerWhenNarrow\"\n    type={`| 'inherit'\n| 'none'\n| 'line'\n| 'filled'`}\n    defaultValue=\"'inherit'\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: true,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"PageLayout"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Pagehead.md","frontmatter":{"title":"Pagehead"},"rawBody":"---\ncomponentId: pagehead\ntitle: Pagehead\ndescription: Use Pagehead to provide a clear, separated page title.\nsource: https://github.com/primer/react/blob/main/src/Pagehead.tsx\nstatus: Alpha\n---\n\n```js\nimport {Pagehead} from '@primer/react'\n```\n\n## Example\n\n```jsx live\n<Pagehead>Pagehead</Pagehead>\n```\n\n## Props\n\n### Pagehead\n\n<PropsTable>\n  <PropsTableRow\n    name=\"as\"\n    defaultValue=\"div\"\n    type=\"string\"\n    description=\"Sets the underlying HTML tag for the component\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\nitems={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: false,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: false,\n    hasStorybookStories: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Pagehead"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Pagination.md","frontmatter":{"title":"Pagination"},"rawBody":"---\ntitle: Pagination\ncomponentId: pagination\ndescription: Use Pagination to display a sequence of links that allow navigation to discrete, related pages.\nsource: https://github.com/primer/react/blob/main/src/Pagination/Pagination.tsx\nstatus: Alpha\n---\n\nimport State from '../components/State'\n\n```js\nimport {Pagination} from '@primer/react'\n```\n\n## Examples\n\nThe pagination component only requires two properties to render: `pageCount`, which is the total number of pages, and `currentPage`, which is the currently selected page number (which should be managed by the consuming application).\n\n```jsx live\n<Pagination pageCount={15} currentPage={2} onPageChange={e => e.preventDefault()} />\n```\n\nHowever, to handle state changes when the user clicks a page, you also need to pass `onPageChange`, which is a function that takes a click event and page number as an argument:\n\n```javascript\ntype PageChangeCallback = (evt: React.MouseEvent, page: number) => void\n```\n\nBy default, clicking a link in the pagination component will cause the browser to navigate to the URL specified by the page. To cancel navigation and handle state management on your own, you should call `preventDefault` on the event, as in this example:\n\n```jsx live\n<State default={1}>\n  {([page, setPage]) => {\n    const totalPages = 15\n    const onPageChange = (evt, page) => {\n      evt.preventDefault()\n      setPage(page)\n    }\n\n    return (\n      <Box borderWidth=\"1px\" borderStyle=\"solid\" borderColor=\"border.default\" borderRadius={2} p={2}>\n        <Box>\n          Current page: {page} / {totalPages}\n        </Box>\n        <Pagination pageCount={totalPages} currentPage={page} onPageChange={onPageChange} />\n      </Box>\n    )\n  }}\n</State>\n```\n\n### Customizing link URLs\n\nTo customize the URL generated for each link, you can pass a function to the `hrefBuilder` property. The function should take a page number as an argument and return a URL to use for the link.\n\n```javascript\ntype HrefBuilder = (page: number) => string\n```\n\n```jsx live\n<State default={'(nothing clicked yet)'}>\n  {([lastUrl, setLastUrl]) => {\n    const onPageChange = (evt, page) => {\n      evt.preventDefault()\n      setLastUrl(evt.target.href)\n    }\n    const hrefBuilder = page => {\n      return `https://example.com/pages/${page}`\n    }\n\n    return (\n      <Box borderWidth=\"1px\" borderStyle=\"solid\" borderColor=\"border.default\" borderRadius={2} p={2}>\n        <Box>The last URL clicked was: {lastUrl}</Box>\n        <Pagination pageCount={15} currentPage={2} onPageChange={onPageChange} hrefBuilder={hrefBuilder} />\n      </Box>\n    )\n  }}\n</State>\n```\n\n### Customizing which pages are shown\n\nTwo props control how many links are displayed in the pagination container at any given time. `marginPageCount` controls how many pages are guaranteed to be displayed on the left and right of the component; `surroundingPageCount` controls how many pages will be displayed to the left and right of the current page.\n\n```jsx live\n<Pagination\n  pageCount={20}\n  currentPage={10}\n  marginPageCount={1}\n  surroundingPageCount={2}\n  onPageChange={e => e.preventDefault()}\n/>\n```\n\nThe algorithm tries to minimize the amount the component shrinks and grows as the user changes pages; for this reason, if any of the pages in the margin (controlled via `marginPageCount`) intersect with pages in the center (controlled by `surroundingPageCount`), the center section will be shifted away from the margin. Consider the following examples, where pages one through six are shown when any of the first four pages are selected. Only when the fifth page is selected and there is a gap between the margin pages and the center pages does a break element appear.\n\n```jsx live\n<Box>\n  {[1, 2, 3, 4, 5].map(page => (\n    <Pagination\n      pageCount={20}\n      currentPage={page}\n      marginPageCount={1}\n      surroundingPageCount={2}\n      onPageChange={e => e.preventDefault()}\n    />\n  ))}\n</Box>\n```\n\n### Previous/next pagination\n\nTo hide all the page numbers and create a simple pagination container with just the Previous and Next buttons, set `showPages` to `false`.\n\n```jsx live\n<State default={1}>\n  {([page, setPage]) => {\n    const totalPages = 10\n    const onPageChange = (evt, page) => {\n      evt.preventDefault()\n      setPage(page)\n    }\n\n    return (\n      <Box borderWidth=\"1px\" borderStyle=\"solid\" borderColor=\"border.default\" borderRadius={2} p={2}>\n        <Box>\n          Current page: {page} / {totalPages}\n        </Box>\n        <Pagination pageCount={totalPages} currentPage={page} onPageChange={onPageChange} showPages={false} />\n      </Box>\n    )\n  }}\n</State>\n```\n\n## Theming\n\nThe following snippet shows the properties in the theme that control the styling of the pagination component:\n\n```javascript\nexport default {\n  // ... rest of theme ...\n  pagination: {\n    borderRadius,\n    spaceBetween,\n    colors: {\n      normal: {\n        fg\n      },\n      disabled: {\n        fg,\n        border\n      },\n      hover: {\n        border\n      },\n      selected: {\n        fg,\n        bg,\n        border\n      },\n      active: {\n        border\n      },\n      nextPrevious: {\n        fg\n      }\n    }\n  }\n}\n```\n\n## Props\n\n### Pagination\n\n<PropsTable>\n  <PropsTableRow\n    name=\"currentPage\"\n    type=\"number\"\n    description=\"The currently selected page.\"\n    required\n  />\n  <PropsTableRow\n    name=\"pageCount\"\n    type=\"number\"\n    description=\"The total number of pages.\"\n    required\n  />\n  <PropsTableRow\n    name=\"hrefBuilder\"\n    type=\"function\"\n    description=\"A function to generate links based on page number.\"\n  />\n  <PropsTableRow\n    name=\"marginPageCount\"\n    type=\"number\"\n    defaultValue={1}\n    description=\"How many pages to always show at the left and right of the component.\"\n  />\n  <PropsTableRow\n    name=\"onPageChange\"\n    type=\"function\"\n    defaultValue=\"no-op\"\n    description=\"Called with event and page number when a page is clicked.\"\n  />\n  <PropsTableRow\n    name=\"showPages\"\n    type=\"boolean\"\n    defaultValue=\"true\"\n    description=\"Whether or not to show the individual page links.\"\n  />\n  <PropsTableRow\n    name=\"surroundingPageCount\"\n    type=\"number\"\n    defaultValue=\"2\"\n    description=\"How many pages to display on each side of the currently selected page.\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\nitems={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: false,\n    fullTestCoverage: false,\n    usedInProduction: false,\n    usageExamplesDocumented: false,\n    hasStorybookStories: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Pagination"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/PointerBox.md","frontmatter":{"title":"PointerBox"},"rawBody":"---\ntitle: PointerBox\ndescription: A customisable, bordered Box with a caret pointer\ncomponentId: pointer_box\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/PointerBox.tsx\n---\n\n## Examples\n\n```jsx live\n<PointerBox minHeight={100} sx={{m: 4, p: 2, bg: 'success.subtle', borderColor: 'success.emphasis'}}>\n  PointerBox\n</PointerBox>\n```\n\n### Caret position\n\n```javascript live noinline\nfunction PointerBoxDemo(props) {\n  const [pos, setPos] = React.useState('top')\n\n  return (\n    <Box>\n      <Heading as=\"h3\" sx={{fontSize: 3}}>\n        Caret Position\n      </Heading>\n      <CaretSelector current={pos} onChange={setPos} />\n      <Box position=\"relative\">\n        <PointerBox\n          minHeight={100}\n          caret={pos}\n          sx={{m: 4, p: 2, bg: 'success.subtle', borderColor: 'success.emphasis'}}\n        >\n          Content\n        </PointerBox>\n      </Box>\n    </Box>\n  )\n}\n\nfunction CaretSelector(props) {\n  const choices = [\n    'top',\n    'bottom',\n    'left',\n    'right',\n    'left-bottom',\n    'left-top',\n    'right-bottom',\n    'right-top',\n    'top-left',\n    'bottom-left',\n    'top-right',\n    'bottom-right'\n  ].map(dir => (\n    <label key={dir}>\n      <input\n        type=\"radio\"\n        name=\"caret\"\n        value={dir}\n        checked={dir === props.current}\n        onChange={() => props.onChange(dir)}\n      />{' '}\n      {dir}\n    </label>\n  ))\n\n  return (\n    <Box display=\"grid\" gridTemplateColumns=\"repeat(4, auto)\" gridGap={3} my={2}>\n      {choices}\n    </Box>\n  )\n}\n\nrender(<PointerBoxDemo />)\n```\n\n## Props\n\n<PropsTable>\n  <PropsTableRow\n    name=\"caret\"\n    type={`| 'top'\n| 'top-left'\n| 'top-right'\n| 'right'\n| 'right-top'\n| 'right-bottom'\n| 'bottom'\n| 'bottom-left'\n| 'bottom-right'\n| 'left'\n| 'left-top'\n| 'left-bottom'`}\n    defaultValue=\"'bottom'\"\n    description=\"Sets the location of the caret. The format is [edge]-[position on edge]. For example, right-top will position the caret on the top of the right edge of the box. Use top\"\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\nitems={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n\n## Related components\n\n- [Popover](/Popover)\n","parent":{"relativeDirectory":"","name":"PointerBox"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Popover.md","frontmatter":{"title":"Popover"},"rawBody":"---\ntitle: Popover\ndescription: Use Popovers to bring attention to specific user interface elements and suggest an action or to guide users through a new experience\ncomponentId: popover\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/Popover.tsx\n---\n\n```js\nimport {Popover} from '@primer/react'\n```\n\n## Examples\n\n```jxs live\n<Box position=\"relative\">\n  <Box justifyContent=\"center\" display=\"flex\">\n    <Button variant=\"primary\">Hello!</Button>\n  </Box>\n\n  <Popover relative open={true} caret=\"top\">\n    <Popover.Content sx={{mt: 2}}>\n      <Heading sx={{fontSize: 2}}>Popover heading</Heading>\n      <Text as=\"p\">Message about this particular piece of UI.</Text>\n      <Button>Got it!</Button>\n    </Popover.Content>\n  </Popover>\n</Box>\n```\n\nTwo components make up a popover; the `Popover` component controls the absolute positioning of the popover, and `Popover.Content` renders the inner content of the popover as well as the caret.\n\nBy default, the popover renders with absolute positioning, meaning it should usually be wrapped in an element with a relative position in order to be positioned properly. To render the popover with relative positioning, use the `relative` property.\n\nIt can be useful to give the `Popover.Content` element a margin to help align the popover.\n\n### Caret position\n\n`Popover` supports various caret positions, which you can specify via the `caret` property. This demo shows all the valid values for the prop. 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```javascript live noinline\nfunction PopoverDemo(props) {\n  const [pos, setPos] = React.useState('top')\n  const [open, setOpen] = React.useState(true)\n\n  return (\n    <Box>\n      <Heading as=\"h3\" sx={{fontSize: 3}}>\n        Caret Position\n      </Heading>\n      <CaretSelector current={pos} onChange={setPos} />\n      <Heading as=\"h3\" sx={{fontSize: 3}}>\n        Popover Visibility\n      </Heading>\n      <Box my={2}>\n        <label>\n          <input type=\"checkbox\" value={open} checked={open} onChange={() => setOpen(open => !open)} /> Open\n        </label>\n      </Box>\n\n      <Box position=\"relative\" pt={4}>\n        <Popover relative open={open} caret={pos}>\n          <Popover.Content>\n            <Heading sx={{fontSize: 2}}>\n              <code>{pos}</code> caret\n            </Heading>\n            <Text as=\"p\">Message about this particular piece of UI.</Text>\n            <Button onClick={() => setOpen(false)}>Got it!</Button>\n          </Popover.Content>\n        </Popover>\n      </Box>\n    </Box>\n  )\n}\n\nfunction CaretSelector(props) {\n  const choices = [\n    'top',\n    'bottom',\n    'left',\n    'right',\n    'left-bottom',\n    'left-top',\n    'right-bottom',\n    'right-top',\n    'top-left',\n    'bottom-left',\n    'top-right',\n    'bottom-right'\n  ].map(dir => (\n    <label>\n      <input\n        key={dir}\n        type=\"radio\"\n        name=\"caret\"\n        value={dir}\n        checked={dir === props.current}\n        onChange={() => props.onChange(dir)}\n      />{' '}\n      {dir}\n    </label>\n  ))\n\n  return (\n    <Box display=\"grid\" gridTemplateColumns=\"repeat(4, auto)\" gridGap={3} my={2}>\n      {choices}\n    </Box>\n  )\n}\n\nrender(<PopoverDemo />)\n```\n\n## Props\n\n### Popover\n\n<PropsTable>\n  <PropsTableRow\n    name=\"as\"\n    defaultValue=\"div\"\n    type=\"string\"\n    description=\"Sets the underlying HTML tag for the component\"\n  />\n  <PropsTableRow\n    name=\"caret\"\n    defaultValue=\"'top'\"\n\t    type={`| 'top'\n| 'bottom'\n| 'left'\n| 'right'\n| 'bottom-left'\n| 'bottom-right'\n| 'top-left'\n| 'top-right'\n| 'left-bottom'\n| 'left-top'\n| 'right-bottom'\n| 'right-top'\n  `}\n    description=\"Controls the position of the caret\"\n  />\n  <PropsTableRow\n    name=\"open\"\n    defaultValue=\"false\"\n    type=\"boolean\"\n    description=\"Controls the visibility of the popover.\"\n  />\n  <PropsTableRow\n    name=\"relative\"\n    defaultValue=\"false\"\n    type=\"boolean\"\n    description=\"Set to true to render the popover using relative positioning. \"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### Popover.Content\n\n<PropsTable>\n  <PropsTableRow\n    name=\"as\"\n    defaultValue=\"div\"\n    type=\"string\"\n    description=\"Sets the underlying HTML tag for the component\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\nitems={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Popover"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Portal.mdx","frontmatter":{"title":"Portal"},"rawBody":"---\ntitle: Portal\ndescription: Portals allow you to create a separation between the logical React component hierarchy and the physical DOM.\ncomponentId: portal\nsource: https://github.com/primer/react/blob/main/src/Portal/Portal.tsx\nstatus: Alpha\n---\n\n```js\nimport {Portal, registerPortalRoot} from '@primer/react'\n```\n\nThis `Portal` component will render all children into the portal root DOM node instead of as children of this Portal's parent DOM element. This is useful for breaking out of the current stacking context. For example, popup menus and tooltips may need to render on top of (read: covering up) other UI. The best way to guarantee this is to add these elements to top-level DOM, such as directly on `document.body`. These elements can then be moved to the correct location using absolute positioning.\n\n<Note variant=\"info\">\n\nSee the [React documentation on portals](https://reactjs.org/docs/portals.html) for an in-depth explanation.\n\n</Note>\n\n## Examples\n\n### Default example\n\n```jsx\n<Portal>\n  Regardless of where this appears in the React component tree, this text will be rendered in the DOM within the portal\n  root at document.body.\n</Portal>\n```\n\n### Customizing the portal root\n\n```html\n<!-- Wherever in your DOM tree you would like to have the default portal root -->\n<div id=\"__primerPortalRoot__\"></div>\n```\n\nor\n\n```js\nimport { registerPortalRoot } from \"@primer/react\"\nregisterPortalRoot(document.querySelector(\".my-portal-root\")!)\n```\n\nBy default, Primer will create a portal root for you as a child of the closest `<BaseStyles>` element, or `document.body` if none is found. That root will be positioned absolutely in the top-left corner of its parent element. If you would like to specify your own portal root, there are two options:\n\n1. Before rendering a `<Portal>` for the first time, ensure that an element exists with id `__primerPortalRoot__`. If that exists, it will be used as the default portal root.\n2. Call the `registerPortalRoot` function, passing in the element you would like to use as your default portal root.\n\nKeep in mind that any inherited styles applied to portaled elements are based on its physical DOM parent. Practically this means that styles added by a `<BaseStyles>` element will not apply to the portaled content unless the portal root is a descendent of a `<BaseStyles>` element.\n\nAlso, as `<ThemeProvider>` affects the _React_ context, which applies to the logical React component hierarchy, the portal root is not required to be a child of a `<ThemeProvider>` for its children to receive that context.\n\n### Multiple portal roots\n\n```jsx\nimport { Portal, registerPortalRoot } from \"@primer/react\"\n\nregisterPortalRoot(document.querySelector(\".scrolling-canvas-root\")!, \"scrolling-canvas\")\n\n// ...\n\nexport default () => (\n    <Portal containerName=\"scrolling-canvas\">\n        <div>This div will be rendered into the element registered above.</div>\n        <Portal>\n            <div>\n                This div will be rendered into the default\n                portal root created at document.body\n            </div>\n        </Portal>\n    </Portal>\n)\n```\n\nThere may be situations where you want to have multiple portal roots. Advanced scenarios may necessitate multiple stacking contexts for overlays. You can set up multiple roots using the `registerPortalRoot` function. Calling this function with an element and a string `name` will register the root, which can then be used by creating a `<Portal>` with a `name` prop matching the one you registered.\n\n## Props\n\n### Portal\n\n<PropsTable>\n  <PropsTableRow name=\"onMount\" type=\"function\" description=\"Called when this portal is added to the DOM\" />\n  <PropsTableRow\n    name=\"containerName\"\n    type=\"string\"\n    description=\"Renders the portal children into the container registered with the given name. If omitted, children are rendered into the default portal root.\"\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: null,\n    adaptsToScreenSizes: null,\n    fullTestCoverage: true,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    hasStorybookStories: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Portal"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/ProgressBar.mdx","frontmatter":{"title":"ProgressBar"},"rawBody":"---\ntitle: ProgressBar\ncomponentId: progress_bar\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/ProgressBar.tsx\n---\n\n```js\nimport {ProgressBar} from '@primer/react'\n```\n\n## Examples\n\n```jsx live\n<ProgressBar progress={80} />\n```\n\n### Inline\n\nIf you'd like to use ProgressBar inline, pass the `inline` boolean prop & **be sure to set a width**.\n\n```jsx live\n<>\n  <Text mr={3}>5 of 10</Text>\n  <ProgressBar progress={50} inline sx={{width: '100px'}} />\n</>\n```\n\n## Props\n\n### ProgressBar\n\n<PropsTable>\n  <PropsTableRow name=\"progress\" type=\"number\" description=\"Used to set the size of the green bar\" defaultValue={0} />\n  <PropsTableRow\n    name=\"barSize\"\n    type={`| 'small'\n| 'large'\n| 'default'`}\n    defaultValue=\"'default'\"\n    description=\"Controls the height of the progress bar. If omitted, height is set to the default height.\"\n  />\n  <PropsTableRow name=\"inline\" type=\"boolean\" defaultValue=\"false\" description=\"Styles the progress bar inline\" />\n  <PropsTableRow name=\"bg\" type=\"string\" defaultValue=\"'bg.successInverse'\" description=\"Set the progress bar color\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"ProgressBar"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Radio.mdx","frontmatter":{"title":"Radio"},"rawBody":"---\ncomponentId: radio\ntitle: Radio\ndescription: Use radios when a user needs to select one option from a list\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/Radio.tsx\nstorybook: '/react/storybook?path=/story/forms-radio-button--default'\n---\n\n## Examples\n\n<Note variant=\"warning\">\n\n**Use [FormControl](/FormControl) to render a standard radio input field.** This component is only meant to be used in the case that you're building a custom radio that is not yet supported by Primer (For example: the color mode selection in [Appearance settings](https://github.com/settings/appearance))\n\nIf you do use this component to build a custom radio, it should always be accompanied by a corresponding `<label>` to improve support for assistive technologies.\n\n</Note>\n\n```jsx live\n<>\n  <Radio value=\"one\" name=\"radio-group-name\" />\n  <Radio value=\"two\" name=\"radio-group-name\" />\n  <Radio disabled value=\"three\" name=\"radio-group-name\" />\n</>\n```\n\n<Note>\n\nPlease use a [Checkbox](/Checkbox) if the user needs to select more than one option in a list\n\n</Note>\n\n## Grouping Radio components\n\nUse the `name` prop to group together related `Radio` components in a list.\n\nIf you're not building something custom, you should use the [ChoiceFieldset](/ChoiceFieldset) component to render a group of radio inputs.\n\n```jsx live\n<form>\n  <FormControl>\n    <Radio value=\"1\" name=\"radio-example\" />\n    <FormControl.Label>Radio 1</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"2\" name=\"radio-example\" />\n    <FormControl.Label>Radio 2</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"3\" name=\"radio-example\" />\n    <FormControl.Label>Radio 3</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"4\" name=\"radio-example\" />\n    <FormControl.Label>Radio 4</FormControl.Label>\n  </FormControl>\n</form>\n```\n\n## Props\n\n<PropsTable>\n  <PropsTableRow name=\"value\" type=\"string\" required description=\"A unique value that is never shown to the user\" />\n  <PropsTableRow name=\"name\" type=\"string\" required description=\"Required for grouping multiple radios\" />\n  <PropsTableRow name=\"checked\" type=\"boolean\" description=\"Modifies true/false value of the native radio\" />\n  <PropsTableRow name=\"defaultChecked\" type=\"boolean\" description=\"Selects the radio by default in uncontrolled mode\" />\n  <PropsTableRow\n    name=\"onChange\"\n    type=\"(event: React.ChangeEvent) => void\"\n    description=\"A callback function that is triggered when the input state has been changed\"\n  />\n  <PropsTableRow\n    name=\"disabled\"\n    type=\"boolean\"\n    description=\"Modifies the native disabled state of the native checkbox\"\n  />\n  <PropsTableBasePropRows\n    elementType=\"input\"\n    refType=\"HTMLInputElement\"\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio#additional_attributes\">\n        MDN\n      </Link>\n    }\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Radio"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/RadioGroup.mdx","frontmatter":{"title":"RadioGroup"},"rawBody":"---\ntitle: RadioGroup\ncomponentId: radio_group\ndescription: Renders a set of radio inputs to let users make a single selection from a short list of options\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/RadioGroup/RadioGroup.tsx\nstorybook: '/react/storybook/?path=/story/forms-radiogroup-examples--basic'\n---\n\nimport {RadioGroup, Radio, Box} from '@primer/components'\nimport {CheckIcon, XIcon, AlertIcon} from '@primer/octicons-react'\n\n## Examples\n\n### Basic\n\n```jsx live\n<Box display=\"grid\" sx={{gap: 3}}>\n  <RadioGroup name=\"choiceGroup\">\n    <RadioGroup.Label>Choices</RadioGroup.Label>\n    <FormControl>\n      <Radio value=\"one\" />\n      <FormControl.Label>Choice one</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Radio value=\"two\" />\n      <FormControl.Label>Choice two</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Radio value=\"three\" />\n      <FormControl.Label>Choice three</FormControl.Label>\n    </FormControl>\n  </RadioGroup>\n</Box>\n```\n\n### Using onChange handlers\n\n```javascript live noinline\nconst WithOnChangeHandlers = () => {\n  const [selectedRadioValue, setSelectedCheckboxValues] = React.useState('two')\n  const [selectedRadioId, setSelectedRadioId] = React.useState()\n\n  const handleRadioGroupChange = (selectedValue, e) => {\n    setSelectedCheckboxValues(selectedValue)\n    setSelectedRadioId(e.currentTarget.id)\n  }\n\n  const handleChoiceOneChange = e => {\n    alert('Choice one has its own handler')\n  }\n\n  return (\n    <Box display=\"grid\" sx={{gap: 1}}>\n      <RadioGroup name=\"choiceGroup\" onChange={handleRadioGroupChange}>\n        <RadioGroup.Label>Choices</RadioGroup.Label>\n        <FormControl>\n          <Radio value=\"one\" onChange={handleChoiceOneChange} />\n          <FormControl.Label>Choice one</FormControl.Label>\n        </FormControl>\n        <FormControl>\n          <Radio value=\"two\" defaultChecked />\n          <FormControl.Label>Choice two</FormControl.Label>\n        </FormControl>\n        <FormControl>\n          <Radio value=\"three\" />\n          <FormControl.Label>Choice three</FormControl.Label>\n        </FormControl>\n      </RadioGroup>\n\n      {selectedRadioValue && <div>The selected radio value is {selectedRadioValue}</div>}\n      {selectedRadioId && <div>The last selected radio ID is {selectedRadioId}</div>}\n    </Box>\n  )\n}\n\nrender(<WithOnChangeHandlers />)\n```\n\n### Disabled\n\n```jsx live\n<RadioGroup disabled name=\"choiceGroup\">\n  <RadioGroup.Label>Choices</RadioGroup.Label>\n  <FormControl>\n    <Radio value=\"one\" />\n    <FormControl.Label>Choice one</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"two\" />\n    <FormControl.Label>Choice two</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"three\" />\n    <FormControl.Label>Choice three</FormControl.Label>\n  </FormControl>\n</RadioGroup>\n```\n\n### Required\n\n```jsx live\n<RadioGroup required name=\"choiceGroup\">\n  <RadioGroup.Label>Choices</RadioGroup.Label>\n  <FormControl>\n    <Radio value=\"one\" />\n    <FormControl.Label>Choice one</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"two\" />\n    <FormControl.Label>Choice two</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"three\" />\n    <FormControl.Label>Choice three</FormControl.Label>\n  </FormControl>\n</RadioGroup>\n```\n\n### With validation\n\n```jsx live\n<RadioGroup name=\"choiceGroup\">\n  <RadioGroup.Label>Choices</RadioGroup.Label>\n  <FormControl>\n    <Radio value=\"one\" />\n    <FormControl.Label>Choice one</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"two\" />\n    <FormControl.Label>Choice two</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"three\" />\n    <FormControl.Label>Choice three</FormControl.Label>\n  </FormControl>\n  <RadioGroup.Validation variant=\"error\">Your choices are wrong</RadioGroup.Validation>\n</RadioGroup>\n```\n\n### With caption\n\n```jsx live\n<RadioGroup name=\"choiceGroup\">\n  <RadioGroup.Label>Choices</RadioGroup.Label>\n  <RadioGroup.Caption>You can pick any of these choices</RadioGroup.Caption>\n  <FormControl>\n    <Radio value=\"one\" />\n    <FormControl.Label>Choice one</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"two\" />\n    <FormControl.Label>Choice two</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"three\" />\n    <FormControl.Label>Choice three</FormControl.Label>\n  </FormControl>\n</RadioGroup>\n```\n\n### A visually hidden label\n\n```jsx live\n<RadioGroup name=\"choiceGroup\">\n  <RadioGroup.Label visuallyHidden>Choices</RadioGroup.Label>\n  <FormControl>\n    <Radio value=\"one\" />\n    <FormControl.Label>Choice one</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"two\" />\n    <FormControl.Label>Choice two</FormControl.Label>\n  </FormControl>\n  <FormControl>\n    <Radio value=\"three\" />\n    <FormControl.Label>Choice three</FormControl.Label>\n  </FormControl>\n</RadioGroup>\n```\n\n### With an external label\n\n```jsx live\n<>\n  <Box\n    id=\"choiceHeading\"\n    borderBottomWidth=\"1px\"\n    borderBottomStyle=\"solid\"\n    borderBottomColor=\"border.default\"\n    pb={2}\n    mb={3}\n    fontSize={3}\n  >\n    Choices\n  </Box>\n  <RadioGroup aria-labelledby=\"choiceHeading\" name=\"choiceGroup\">\n    <FormControl>\n      <Radio value=\"one\" />\n      <FormControl.Label>Choice one</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Radio value=\"two\" />\n      <FormControl.Label>Choice two</FormControl.Label>\n    </FormControl>\n    <FormControl>\n      <Radio value=\"three\" />\n      <FormControl.Label>Choice three</FormControl.Label>\n    </FormControl>\n  </RadioGroup>\n</>\n```\n\n## Props\n\n### RadioGroup\n\n<PropsTable>\n  <PropsTableRow\n    name=\"aria-labelledby\"\n    type=\"string\"\n    description=\"Used when associating the input group with a label other than RadioGroup.Label\"\n  />\n  <PropsTableRow\n    name=\"children\"\n    type=\"RadioGroup.Label | RadioGroup.Caption | RadioGroup.Validation | FormControl\"\n    required\n  />\n  <PropsTableRow\n    name=\"disabled\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Whether the input group allows user input\"\n  />\n  <PropsTableRow\n    name=\"id\"\n    type=\"string\"\n    defaultValue=\"A generated string\"\n    description={\n      <span>\n        The unique identifier for this input group. Used to associate the label, validation text, and caption text.{' '}\n        <br /> You may want a custom ID to make it easier to select elements in integration tests.\n      </span>\n    }\n  />\n  <PropsTableRow name=\"name\" type=\"string\" description=\"The name used to identify this group of radios\" required />\n  <PropsTableRow\n    name=\"onChange\"\n    type=\"(selected: string | null, e?: ChangeEvent<HTMLInputElement>) => void\"\n    description=\"An onChange handler that gets called when the selection changes\"\n  />\n  <PropsTableRow\n    name=\"required\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"If true, the user must make a selection before the owning form can be submitted\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### RadioGroup.Label\n\nA title for the set of choices. If a `RadioGroup.Label` is not passed as a child, you must pass the external title's ID to the `aria-describedby` prop on `RadioGroup`\n\n<PropsTable>\n  <PropsTableRow\n    name=\"visuallyHidden\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"If true, the fieldset legend will be visually hidden\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n### RadioGroup.Description\n\n<PropsTable>\n  <PropsTableRow name=\"children\" type=\"React.ReactNode\" description=\"The caption content\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n### RadioGroup.Validation\n\nIf the user's selection has been flagged during validation, `RadioGroup.Validation` may be used to render contextual validation information to help the user complete their task\n\n<PropsTable>\n  <PropsTableRow name=\"children\" type=\"React.ReactNode\" description=\"The validation message\" />\n  <PropsTableRow\n    required\n    name=\"variant\"\n    type=\"'error' | 'success' | 'warning'\"\n    description=\"Changes the visual style to match the validation status\"\n  />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"RadioGroup"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/SegmentedControl.mdx","frontmatter":{"title":"SegmentedControl"},"rawBody":"---\ntitle: SegmentedControl\nstatus: Draft\ndescription: Use a segmented control to let users select an option from a short list and immediately apply the selection\n---\n\n<Note variant=\"warning\">Not implemented yet</Note>\n\n## Examples\n\n### Simple\n\n```jsx live drafts\n<SegmentedControl aria-label=\"File view\">\n  <SegmentedControl.Button selected>Preview</SegmentedControl.Button>\n  <SegmentedControl.Button>Raw</SegmentedControl.Button>\n  <SegmentedControl.Button>Blame</SegmentedControl.Button>\n</SegmentedControl>\n```\n\n### With icons and labels\n\n```jsx live drafts\n<SegmentedControl aria-label=\"File view\">\n  <SegmentedControl.Button selected leadingIcon={EyeIcon}>\n    Preview\n  </SegmentedControl.Button>\n  <SegmentedControl.Button leadingIcon={FileCodeIcon}>Raw</SegmentedControl.Button>\n  <SegmentedControl.Button leadingIcon={PeopleIcon}>Blame</SegmentedControl.Button>\n</SegmentedControl>\n```\n\n### With icons only\n\n```jsx live drafts\n<SegmentedControl aria-label=\"File view\">\n  <SegmentedControl.IconButton selected icon={EyeIcon} aria-label=\"Preview\" />\n  <SegmentedControl.IconButton icon={FileCodeIcon} aria-label=\"Raw\" />\n  <SegmentedControl.IconButton icon={PeopleIcon} aria-label=\"Blame\" />\n</SegmentedControl>\n```\n\n### With labels hidden on smaller viewports\n\n```jsx live drafts\n<SegmentedControl aria-label=\"File view\" variant={{narrow: 'hideLabels', regular: 'none'}}>\n  <SegmentedControl.Button selected leadingIcon={EyeIcon}>\n    Preview\n  </SegmentedControl.Button>\n  <SegmentedControl.Button leadingIcon={FileCodeIcon}>Raw</SegmentedControl.Button>\n  <SegmentedControl.Button leadingIcon={PeopleIcon}>Blame</SegmentedControl.Button>\n</SegmentedControl>\n```\n\n### Convert to a dropdown on smaller viewports\n\n```jsx live drafts\n<SegmentedControl aria-label=\"File view\" variant={{narrow: 'dropdown', regular: 'none'}}>\n  <SegmentedControl.Button selected leadingIcon={EyeIcon}>\n    Preview\n  </SegmentedControl.Button>\n  <SegmentedControl.Button leadingIcon={FileCodeIcon}>Raw</SegmentedControl.Button>\n  <SegmentedControl.Button leadingIcon={PeopleIcon}>Blame</SegmentedControl.Button>\n</SegmentedControl>\n```\n\n### Fill width of parent\n\n```jsx live drafts\n<SegmentedControl fullWidth aria-label=\"File view\">\n  <SegmentedControl.Button selected>Preview</SegmentedControl.Button>\n  <SegmentedControl.Button>Raw</SegmentedControl.Button>\n  <SegmentedControl.Button>Blame</SegmentedControl.Button>\n</SegmentedControl>\n```\n\n### In a loading state\n\n```jsx live drafts\n<SegmentedControl loading aria-label=\"File view\">\n  <SegmentedControl.Button selected>Preview</SegmentedControl.Button>\n  <SegmentedControl.Button>Raw</SegmentedControl.Button>\n  <SegmentedControl.Button>Blame</SegmentedControl.Button>\n</SegmentedControl>\n```\n\n### With a label and caption on the left\n\n```jsx live drafts\n<Box display=\"flex\">\n  <Box flexGrow={1}>\n    <Text fontSize={2} fontWeight=\"bold\" id=\"scLabel-vert\" display=\"block\">\n      File view\n    </Text>\n    <Text color=\"fg.subtle\" fontSize={1} id=\"scCaption-vert\" display=\"block\">\n      Change the way the file is viewed\n    </Text>\n  </Box>\n  <SegmentedControl aria-labelledby=\"scLabel-vert\" aria-describedby=\"scCaption-vert\">\n    <SegmentedControl.Button selected>Preview</SegmentedControl.Button>\n    <SegmentedControl.Button>Raw</SegmentedControl.Button>\n    <SegmentedControl.Button>Blame</SegmentedControl.Button>\n  </SegmentedControl>\n</Box>\n```\n\n### With a label above and caption below\n\n```jsx live drafts\n<FormControl>\n  <FormControl.Label id=\"scLabel-horiz\">File view</FormControl.Label>\n  <SegmentedControl aria-labelledby=\"scLabel-horiz\" aria-describedby=\"scCaption-horiz\">\n    <SegmentedControl.Button selected>Preview</SegmentedControl.Button>\n    <SegmentedControl.Button>Raw</SegmentedControl.Button>\n    <SegmentedControl.Button>Blame</SegmentedControl.Button>\n  </SegmentedControl>\n  <FormControl.Caption id=\"scCaption-horiz\">Change the way the file is viewed</FormControl.Caption>\n</FormControl>\n```\n\n### With something besides the first option selected\n\n```jsx live drafts\n<SegmentedControl aria-label=\"File view\">\n  <SegmentedControl.Button selected>Preview</SegmentedControl.Button>\n  <SegmentedControl.Button selected>Raw</SegmentedControl.Button>\n  <SegmentedControl.Button>Blame</SegmentedControl.Button>\n</SegmentedControl>\n```\n\n### With a selection change handler\n\n```jsx live drafts\n<SegmentedControl\n  aria-label=\"File view\"\n  onChange={selectedIndex => {\n    alert(`Segment ${selectedIndex}`)\n  }}\n>\n  <SegmentedControl.Button>Preview</SegmentedControl.Button>\n  <SegmentedControl.Button>Raw</SegmentedControl.Button>\n  <SegmentedControl.Button>Blame</SegmentedControl.Button>\n</SegmentedControl>\n```\n\n## Props\n\n### SegmentedControl\n\n<PropsTable>\n  <PropsTableRow name=\"aria-label\" type=\"string\" />\n  <PropsTableRow name=\"aria-labelledby\" type=\"string\" />\n  <PropsTableRow name=\"aria-describedby\" type=\"string\" />\n  <PropsTableRow name=\"fullWidth\" type=\"boolean\" description=\"Whether the control fills the width of its parent\" />\n  <PropsTableRow name=\"loading\" type=\"boolean\" description=\"Whether the selected segment is being calculated\" />\n  <PropsTableRow\n    name=\"onChange\"\n    type=\"(selectedIndex?: number) => void\"\n    description=\"The handler that gets called when a segment is selected\"\n  />\n  <PropsTableRow\n    name=\"variant\"\n    type=\"{\n      narrow?: 'hideLabels' | 'dropdown',\n      regular?: 'hideLabels' | 'dropdown',\n      wide?: 'hideLabels' | 'dropdown'\n    }\"\n    description=\"Configure alternative ways to render the control when it gets rendered in tight spaces\"\n  />\n  <PropsTableSxRow />\n  <PropsTableRefRow refType=\"HTMLDivElement\" />\n</PropsTable>\n\n### SegmentedControl.Button\n\n<PropsTable>\n  <PropsTableRow name=\"aria-label\" type=\"string\" />\n  <PropsTableRow name=\"leadingIcon\" type=\"Component\" description=\"The leading icon comes before item label\" />\n  <PropsTableRow name=\"selected\" type=\"boolean\" description=\"Whether the segment is selected\" />\n  <PropsTableSxRow />\n  <PropsTableRefRow refType=\"HTMLButtonElement\" />\n</PropsTable>\n\n### SegmentedControl.IconButton\n\n<PropsTable>\n  <PropsTableRow name=\"aria-label\" type=\"string\" />\n  <PropsTableRow name=\"icon\" type=\"Component\" description=\"The icon that represents the segmented control item\" />\n  <PropsTableRow name=\"selected\" type=\"boolean\" description=\"Whether the segment is selected\" />\n  <PropsTableSxRow />\n  <PropsTableRefRow refType=\"HTMLButtonElement\" />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: false,\n    adaptsToThemes: false,\n    adaptsToScreenSizes: false,\n    fullTestCoverage: false,\n    usedInProduction: false,\n    usageExamplesDocumented: false,\n    hasStorybookStories: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"SegmentedControl"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Select.mdx","frontmatter":{"title":"Select"},"rawBody":"---\ncomponentId: select\ntitle: Select\ndescription: Use a select input when a user needs to select one option from a long list\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/Select.tsx\nstorybook: '/react/storybook?path=/story/forms-select--default'\n---\n\nimport {Select, Text} from '@primer/react'\n\n## Examples\n\n### Basic\n\n```jsx live\n<FormControl>\n  <FormControl.Label>Preferred Primer component interface</FormControl.Label>\n  <Select>\n    <Select.Option value=\"figma\">Figma</Select.Option>\n    <Select.Option value=\"css\">Primer CSS</Select.Option>\n    <Select.Option value=\"prc\">Primer React components</Select.Option>\n    <Select.Option value=\"pvc\">Primer ViewComponents</Select.Option>\n  </Select>\n</FormControl>\n```\n\n### With grouped options\n\n```jsx live\n<FormControl>\n  <FormControl.Label>Preferred Primer component interface</FormControl.Label>\n  <Select>\n    <Select.OptGroup label=\"GUI\">\n      <Select.Option value=\"figma\">Figma</Select.Option>\n    </Select.OptGroup>\n    <Select.OptGroup label=\"Code\">\n      <Select.Option value=\"css\">Primer CSS</Select.Option>\n      <Select.Option value=\"prc\">Primer React components</Select.Option>\n      <Select.Option value=\"pvc\">Primer ViewComponents</Select.Option>\n    </Select.OptGroup>\n  </Select>\n</FormControl>\n```\n\n### With a placeholder\n\n```jsx live\n<FormControl>\n  <FormControl.Label>Preferred Primer component interface</FormControl.Label>\n  <Select placeholder=\"Pick an interface\">\n    <Select.Option value=\"figma\">Figma</Select.Option>\n    <Select.Option value=\"css\">Primer CSS</Select.Option>\n    <Select.Option value=\"prc\">Primer React components</Select.Option>\n    <Select.Option value=\"pvc\">Primer ViewComponents</Select.Option>\n  </Select>\n</FormControl>\n```\n\n## Props\n\n### Select\n\n<PropsTable>\n  <PropsTableRow\n    name=\"block\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description={<>Creates a full width input element</>}\n  />\n  <PropsTableRow\n    name=\"contrast\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Changes background color to a higher contrast color\"\n  />\n  <PropsTableRow\n    name=\"size\"\n    type=\"'small' | 'medium' | 'large'\"\n    description=\"Creates a smaller or larger input than the default.\"\n  />\n  <PropsTableRow name=\"validationStatus\" type=\"'warning' | 'error'\" description=\"Style the input to match the status\" />\n  <PropsTablePassthroughPropsRow\n    elementName=\"select\"\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select#attributes\">MDN</Link>\n    }\n  />\n\n</PropsTable>\n\n### Select.OptGroup\n\nThe `Select.OptGroup` component accepts the same props as a native HTML [`<optgroup>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup).\n\n### Select.Option\n\nThe `Select.Option` component accepts the same props as a native HTML [`<option>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option).\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Select"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/SelectPanel.mdx","frontmatter":{"title":"SelectPanel"},"rawBody":"---\ncomponentId: select_panel\ntitle: SelectPanel\nstatus: Alpha\n---\n\nA `SelectPanel` provides an anchor that will open an overlay with a list of selectable items, and a text input to filter the selectable items\n\n## Example\n\n```javascript live noinline\nfunction getColorCircle(color) {\n  return function () {\n    return (\n      <Box\n        borderWidth=\"1px\"\n        borderStyle=\"solid\"\n        bg={color}\n        borderColor={color}\n        width={14}\n        height={14}\n        borderRadius={10}\n        margin=\"auto\"\n      />\n    )\n  }\n}\n\nconst items = [\n  {leadingVisual: getColorCircle('#a2eeef'), text: 'enhancement', id: 1},\n  {leadingVisual: getColorCircle('#d73a4a'), text: 'bug', id: 2},\n  {leadingVisual: getColorCircle('#0cf478'), text: 'good first issue', id: 3},\n  {leadingVisual: getColorCircle('#ffd78e'), text: 'design', id: 4},\n  {leadingVisual: getColorCircle('#ff0000'), text: 'blocker', id: 5},\n  {leadingVisual: getColorCircle('#a4f287'), text: 'backend', id: 6},\n  {leadingVisual: getColorCircle('#8dc6fc'), text: 'frontend', id: 7}\n]\n\nfunction DemoComponent() {\n  const [selected, setSelected] = React.useState([items[0], items[1]])\n  const [filter, setFilter] = React.useState('')\n  const filteredItems = items.filter(item => item.text.toLowerCase().startsWith(filter.toLowerCase()))\n  const [open, setOpen] = React.useState(false)\n\n  return (\n    <SelectPanel\n      renderAnchor={({children, 'aria-labelledby': ariaLabelledBy, ...anchorProps}) => (\n        <Button trailingIcon={TriangleDownIcon} aria-labelledby={` ${ariaLabelledBy}`} {...anchorProps}>\n          {children || 'Select Labels'}\n        </Button>\n      )}\n      placeholderText=\"Filter Labels\"\n      open={open}\n      onOpenChange={setOpen}\n      items={filteredItems}\n      selected={selected}\n      onSelectedChange={setSelected}\n      onFilterChange={setFilter}\n      showItemDividers={true}\n      overlayProps={{width: 'small', height: 'xsmall'}}\n    />\n  )\n}\n\nrender(<DemoComponent />)\n```\n\n## Component props\n","parent":{"relativeDirectory":"","name":"SelectPanel"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/SideNav.md","frontmatter":{"title":"SideNav"},"rawBody":"---\ncomponentId: side_nav\ntitle: SideNav\nstatus: Alpha\n---\n\nThe Side Nav is a vertical list of navigational links, typically used on the left side of a page. For maximum flexibility, **SideNav elements have no default width or positioning.**\n\n## Default example\n\n```jsx live\n<SideNav bordered maxWidth={360} aria-label=\"Main\">\n  <SideNav.Link href=\"#account\">\n    <Text>Account</Text>\n  </SideNav.Link>\n  <SideNav.Link href=\"#home\" selected>\n    <Text>Profile</Text>\n  </SideNav.Link>\n  <SideNav.Link href=\"#emails\">\n    <Text>Emails</Text>\n  </SideNav.Link>\n  <SideNav.Link href=\"#notifications\">\n    <Text>Notifications</Text>\n  </SideNav.Link>\n</SideNav>\n```\n\nDifferent kinds of content can be added inside a SideNav item. Use system props to further style them if needed.\n\n## Full variant\n\nAdd the `variant='full'` prop to a `SideNav.Link` to spread child elements across the link, which is useful for status icons, labels, and the like.\n\n```jsx live\n<SideNav bordered maxWidth={360} aria-label=\"Main\">\n  <SideNav.Link href=\"#url\">\n    <Text>Text Only</Text>\n  </SideNav.Link>\n  <SideNav.Link href=\"#url\">\n    <Avatar size={16} mr={2} src=\"https://avatars.githubusercontent.com/hubot?s=32\" />\n    <Text>With an avatar</Text>\n  </SideNav.Link>\n  <SideNav.Link href=\"#url\">\n    <StyledOcticon sx={{mr: 2}} size={16} icon={ZapIcon} />\n    <Text>With an Octicon</Text>\n  </SideNav.Link>\n  <SideNav.Link href=\"#url\" variant=\"full\" selected>\n    <Text>With a status icon</Text>\n    <StyledOcticon sx={{mr: 2}} size={16} icon={DotIcon} color=\"success.fg\" />\n  </SideNav.Link>\n  <SideNav.Link href=\"#url\" variant=\"full\">\n    <Text>With a label</Text>\n    <Label outline>label</Label>\n  </SideNav.Link>\n  <SideNav.Link href=\"#url\" variant=\"full\">\n    <Text>With a counter</Text>\n    <CounterLabel>16</CounterLabel>\n  </SideNav.Link>\n  <SideNav.Link href=\"#url\">\n    <Heading as=\"h5\" sx={{fontSize: 1}}>\n      A heading\n    </Heading>\n    <Text>and some more content</Text>\n  </SideNav.Link>\n</SideNav>\n```\n\n## Lightweight variant\n\nAdd the `variant=\"lightweight\"` prop to `SideNav` to render an alternative, more lightweight version that has items with no borders and are more condensed.\n\n```jsx live\n<Box\n  borderWidth=\"1px\"\n  borderStyle=\"solid\"\n  borderColor=\"border.default\"\n  borderRadius={2}\n  p={3}\n  backgroundColor=\"canvas.subtle\"\n  maxWidth={360}\n>\n  <Box\n    borderStyle=\"solid\"\n    borderColor=\"border.default\"\n    borderWidth={0}\n    borderBottomWidth={1}\n    borderRadius={0}\n    mb={2}\n    pb={1}\n  >\n    <Heading as=\"h5\" fontSize={1} color=\"fg.muted\">\n      Menu\n    </Heading>\n  </Box>\n  <SideNav variant=\"lightweight\">\n    <SideNav.Link href=\"#url\">\n      <Text>Account</Text>\n    </SideNav.Link>\n    <SideNav.Link href=\"#url\" selected>\n      <Text>Profile</Text>\n    </SideNav.Link>\n    <SideNav.Link href=\"#url\">\n      <Text>Emails</Text>\n    </SideNav.Link>\n    <SideNav.Link href=\"#url\">\n      <Text>Notifications</Text>\n    </SideNav.Link>\n  </SideNav>\n</Box>\n```\n\nIt can also appear nested, as a sub navigation. Use margin/padding [System Props](/system-props) to add indentation.\n\n```jsx live\n<SideNav bordered maxWidth={360}>\n  <SideNav.Link href=\"#url\">\n    <StyledOcticon size={16} icon={PersonIcon} />\n    <Text>Account</Text>\n  </SideNav.Link>\n  <SideNav.Link href=\"#url\" selected>\n    <StyledOcticon mr={2} size={16} icon={SmileyIcon} />\n    <Text>Profile</Text>\n  </SideNav.Link>\n\n  <SideNav bordered variant=\"lightweight\" py={3} pl={6} backgroundColor=\"sidenav.selectedBg\">\n    <SideNav.Link href=\"#url\" selected>\n      <Text>Sub item 1</Text>\n    </SideNav.Link>\n    <SideNav.Link href=\"#url\">\n      <Text>Sub item 2</Text>\n    </SideNav.Link>\n    <SideNav.Link href=\"#url\">\n      <Text>Sub item 3</Text>\n    </SideNav.Link>\n  </SideNav>\n\n  <SideNav.Link href=\"#url\">\n    <StyledOcticon mr={2} size={16} icon={MailIcon} />\n    <Text>Emails</Text>\n  </SideNav.Link>\n</SideNav>\n```\n\n## Usage with React Router\n\nIf using React Router, you can use the `as` prop to render the element as a `NavLink`. React Router will automatically handle setting `aria-current=\"page\"` for you.\n\n```\n<SideNav.Link as={NavLink} to=\"...\">...</SideNav.Link>\n```\n\n## Component props\n\n### SideNav\n\n| Name     | Type              | Default  | Description                                                                    |\n| :------- | :---------------- | :------: | :----------------------------------------------------------------------------- |\n| as       | String            |  'nav'   | Sets the HTML tag for the component.                                           |\n| bordered | Boolean           |  false   | Renders the component with a border.                                           |\n| variant  | String            | 'normal' | Set to `lightweight` to render [in a lightweight style](#lightweight-variant). |\n| sx       | SystemStyleObject |    {}    | Style to be applied to the component                                           |\n\n### SideNav.Link\n\n| Name      | Type              | Default  | Description                                                                                       |\n| :-------- | :---------------- | :------: | :------------------------------------------------------------------------------------------------ |\n| as        | String            |   'a'    | Sets the HTML tag for the component.                                                              |\n| href      | String            |          | URL to be used for the Link                                                                       |\n| muted     | Boolean           |  false   | Uses a less prominent shade for Link color, and the default link shade on hover                   |\n| selected  | Boolean           |  false   | Sets the link as selected, giving it a different style and setting the `aria-current` attribute.  |\n| underline | Boolean           |  false   | Adds underline to the Link                                                                        |\n| variant   | String            | 'normal' | Set to `full` to render [a full variant](#full-variant), suitable for including icons and labels. |\n| sx        | SystemStyleObject |    {}    | Style to be applied to the component                                                              |\n","parent":{"relativeDirectory":"","name":"SideNav"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Spinner.mdx","frontmatter":{"title":"Spinner"},"rawBody":"---\ntitle: Spinner\nstatus: Alpha\ndescription: Use spinners to let users know that content is being loaded.\ncomponentId: spinner\nsource: https://github.com/primer/components/blob/main/src/Spinner.tsx\n---\n\nimport {Props} from '../src/props'\nimport {Spinner} from '@primer/react'\n\n```jsx live\n<Spinner />\n```\n\n## Props\n\n<Props of={Spinner} />\n\n## Examples\n\n### Small\n\n```jsx live\n<Spinner size=\"small\" />\n```\n\n### Large\n\n```jsx live\n<Spinner size=\"large\" />\n```\n","parent":{"relativeDirectory":"","name":"Spinner"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/StateLabel.md","frontmatter":{"title":"StateLabel"},"rawBody":"---\ncomponentId: state_label\ntitle: StateLabel\nstatus: Alpha\n---\n\nUse StateLabel components to show the status of an issue or pull request.\n\n## Default example\n\n```jsx live\n<>\n  <StateLabel status=\"issueOpened\">Open</StateLabel>\n  <StateLabel status=\"issueClosed\">Closed</StateLabel>\n  <StateLabel status=\"pullOpened\">Open</StateLabel>\n  <StateLabel status=\"pullClosed\">Closed</StateLabel>\n  <StateLabel status=\"pullMerged\">Merged</StateLabel>\n  <StateLabel status=\"draft\">Draft</StateLabel>\n  <StateLabel status=\"issueDraft\">Draft</StateLabel>\n</>\n```\n\n## Component props\n\n| Name    | Type              | Default  | Description                                                                                                    |\n| :------ | :---------------- | :------: | :------------------------------------------------------------------------------------------------------------- |\n| variant | String            | 'normal' | a value of `small` or `normal` results in a smaller or larger version of the StateLabel.                       |\n| status  | String            |          | Can be one of `issueOpened`, `issueClosed`, `pullOpened`, `pullClosed`, `pullMerged`, `draft` or `issueDraft`. |\n| sx      | SystemStyleObject |    {}    | Style to be applied to the component                                                                           |\n","parent":{"relativeDirectory":"","name":"StateLabel"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/StyledOcticon.mdx","frontmatter":{"title":"StyledOcticon"},"rawBody":"---\ndescription: Use StyledOcticon to render an Octicon as a component.\ntitle: StyledOcticon\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/StyledOcticon.tsx\ncomponentId: styled_octicon\n---\n\n## Example\n\n```jsx live\n<>\n  <StyledOcticon icon={CheckIcon} size={32} color=\"success.fg\" sx={{mr: 2}} />\n  <StyledOcticon icon={XIcon} size={32} color=\"danger.fg\" />\n</>\n```\n\n## Props\n\n<PropsTable>\n  <PropsTableRow\n    name=\"ariaLabel\"\n    type=\"string\"\n    description=\"Specifies the aria-label attribute, which is read verbatim by screen readers \"\n  />\n  <PropsTableRow\n    name=\"icon\"\n    type=\"Component\"\n    description={\n      <>\n        Checks the input by default in uncontrolled modeName of the <Link href=\"https://primer.style/octicons/\">Octicon component</Link> used in the \n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"color\"\n    type=\"string\"\n    description={\n      <>\n        Sets an override color for the Octicon. Compatible with colors from the <Link href=\"https://primer.style/primitives/colors\">Primer color system</Link>.\" \n      </>  \n    }\n  />\n  <PropsTableRow\n    name=\"size\"\n    defaultValue=\"16\"\n    type=\"number\"\n    description=\"Sets the uniform `width` and `height` of the SVG element\"    \n  />\n  <PropsTableRow \n    name=\"verticalAlign\"\n    defaultValue=\"text-bottom\"\n    type=\"string\"\n    description=\"Sets the `vertical-align` CSS property\"\n  />\n  <PropsTableSxRow />\n\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: false,\n    fullTestCoverage: false,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"StyledOcticon"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/SubNav.md","frontmatter":{"title":"SubNav"},"rawBody":"---\ncomponentId: sub_nav\ntitle: SubNav\nstatus: Alpha\n---\n\nUse the SubNav component for navigation on a dashboard-type interface with another set of navigation components above it. This helps distinguish navigation hierarchy.\n\nTo use SubNav with [react-router](https://github.com/ReactTraining/react-router) or\n[react-router-dom](https://www.npmjs.com/package/react-router-dom), pass\n`as={NavLink}` and omit the `selected` prop.\nThis ensures that the NavLink gets `activeClassName='selected'`\n\n**Attention:** Make sure to properly label your `SubNav` with an `aria-label` to provide context about the type of navigation contained in `SubNav`.\n\n## Default example\n\n```jsx live\n<SubNav aria-label=\"Main\">\n  <SubNav.Links>\n    <SubNav.Link href=\"#home\" selected>\n      Home\n    </SubNav.Link>\n    <SubNav.Link href=\"#documentation\">Documentation</SubNav.Link>\n    <SubNav.Link href=\"#support\">Support</SubNav.Link>\n  </SubNav.Links>\n</SubNav>\n```\n\n## SubNav with search example\n\n```jsx live\n<SubNav aria-label=\"Main\">\n  <SubNav.Links>\n    <SubNav.Link href=\"#home\" selected>\n      Home\n    </SubNav.Link>\n    <SubNav.Link href=\"#documentation\">Documentation</SubNav.Link>\n    <SubNav.Link href=\"#support\">Support</SubNav.Link>\n  </SubNav.Links>\n\n  <TextInput type=\"search\" leadingVisual={SearchIcon} sx={{width: 320}} />\n</SubNav>\n```\n\n## SubNav with filtered search example\n\n```jsx live\n<SubNav aria-label=\"Main\">\n  <FilteredSearch>\n    <ActionMenu>\n      <ActionMenu.Button>Filter</ActionMenu.Button>\n      <ActionMenu.Overlay>\n        <ActionList direction=\"sw\">\n          <ActionList.Item>\n            <a href=\"#\">Item 1</a>\n          </ActionList.Item>\n          <ActionList.Item>\n            <a href=\"#\">Item 2</a>\n          </ActionList.Item>\n          <ActionList.Item>\n            <a href=\"#\">Item 3</a>\n          </ActionList.Item>\n        </ActionList>\n      </ActionMenu.Overlay>\n    </ActionMenu>\n    <TextInput type=\"search\" leadingVisual={SearchIcon} width={320} />\n  </FilteredSearch>\n  <SubNav.Links>\n    <SubNav.Link href=\"#home\" selected>\n      Home\n    </SubNav.Link>\n    <SubNav.Link href=\"#documentation\">Documentation</SubNav.Link>\n    <SubNav.Link href=\"#support\">Support</SubNav.Link>\n  </SubNav.Links>\n</SubNav>\n```\n\n## Component props\n\n### SubNav\n\n| Name       | Type              | Default | Description                                                                            |\n| :--------- | :---------------- | :-----: | :------------------------------------------------------------------------------------- |\n| actions    | Node              |         | Place another element, such as a button, to the opposite side of the navigation items. |\n| align      | String            |         | Use `right` to have navigation items aligned right.                                    |\n| full       | Boolean           |         | Used to make navigation fill the width of the container.                               |\n| aria-label | String            |         | Used to set the `aria-label` on the top level `<nav>` element.                         |\n| sx         | SystemStyleObject |   {}    | Style to be applied to the component                                                   |\n\n### SubNav.Link\n\n| Name     | Type              | Default | Description                                      |\n| :------- | :---------------- | :-----: | :----------------------------------------------- |\n| as       | String            |         | sets the HTML tag for the component              |\n| href     | String            |         | URL to be used for the Link                      |\n| selected | Boolean           |         | Used to style the link as selected or unselected |\n| sx       | SystemStyleObject |   {}    | Style to be applied to the component             |\n\n### SubNav.Links\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n","parent":{"relativeDirectory":"","name":"SubNav"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/TabNav.md","frontmatter":{"title":"TabNav"},"rawBody":"---\ncomponentId: tab_nav\ntitle: TabNav\nstatus: Alpha\n---\n\nUse the TabNav component to style navigation with a tab-based selected state, typically used for navigation placed at the top of the page.\n\nTo use TabNav with [react-router](https://github.com/ReactTraining/react-router) or\n[react-router-dom](https://www.npmjs.com/package/react-router-dom), pass\n`as={NavLink}` and omit the `selected` prop.\nThis ensures that the NavLink gets `activeClassName='selected'`\n\n**Attention:** Make sure to properly label your `TabNav` with an `aria-label` to provide context about the type of navigation contained in `TabNav`.\n\n## Default example\n\n```jsx live\n<TabNav aria-label=\"Main\">\n  <TabNav.Link href=\"#home\" selected>\n    Home\n  </TabNav.Link>\n  <TabNav.Link href=\"#documentation\">Documentation</TabNav.Link>\n  <TabNav.Link href=\"#support\">Support</TabNav.Link>\n</TabNav>\n```\n\n## Component props\n\n### TabNav\n\n| Name       | Type              | Default | Description                                                    |\n| :--------- | :---------------- | :-----: | :------------------------------------------------------------- |\n| aria-label | String            |         | Used to set the `aria-label` on the top level `<nav>` element. |\n| sx         | SystemStyleObject |   {}    | Style to be applied to the component                           |\n\n### TabNav.Link\n\n| Name     | Type              | Default | Description                                      |\n| :------- | :---------------- | :-----: | :----------------------------------------------- |\n| as       | String            |         | sets the HTML tag for the component              |\n| href     | String            |         | URL to be used for the Link                      |\n| selected | Boolean           |         | Used to style the link as selected or unselected |\n| sx       | SystemStyleObject |   {}    | Style to be applied to the component             |\n","parent":{"relativeDirectory":"","name":"TabNav"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Text.md","frontmatter":{"title":"Text"},"rawBody":"---\ncomponentId: text\ntitle: Text\nstatus: Alpha\n---\n\nThe Text component is a wrapper component that will apply typography styles to the text inside.\n\n## Default example\n\n```jsx live\n<>\n  <Text as=\"p\" fontWeight=\"bold\">\n    bold\n  </Text>\n  <Text as=\"p\" color=\"danger.fg\">\n    danger color\n  </Text>\n  <Text as=\"p\" color=\"fg.onEmphasis\" bg=\"neutral.emphasis\" p={2}>\n    inverse colors\n  </Text>\n</>\n```\n\n## System props\n\nText components get `TYPOGRAPHY` and `COMMON` system props. Read our [System Props](/system-props) doc page for a full list of available props.\n\n## Component props\n\n| Name | Type   | Default | Description                         |\n| :--- | :----- | :-----: | :---------------------------------- |\n| as   | String | `span`  | Sets the HTML tag for the component |\n","parent":{"relativeDirectory":"","name":"Text"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/TextInput.mdx","frontmatter":{"title":"TextInput"},"rawBody":"---\ncomponentId: text_input\ntitle: TextInput\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/TextInput.tsx\n---\n\nTextInput is a form component to add default styling to the native text input.\n\n**Note:** Don't forget to set `aria-label` to make the TextInput accessible to screen reader users.\n\n## Examples\n\n### Basic\n\n```jsx live\n<TextInput aria-label=\"Zipcode\" name=\"zipcode\" placeholder=\"Zipcode\" autoComplete=\"postal-code\" />\n```\n\n### With icons\n\n```jsx live\n<>\n  <TextInput\n    leadingVisual={SearchIcon}\n    aria-label=\"Zipcode\"\n    name=\"zipcode\"\n    placeholder=\"Zip\"\n    autoComplete=\"postal-code\"\n  />\n\n  <TextInput\n    trailingVisual={SearchIcon}\n    aria-label=\"Zipcode\"\n    name=\"zipcode\"\n    placeholder=\"Zip\"\n    autoComplete=\"postal-code\"\n  />\n</>\n```\n\n### With text visuals\n\n```jsx live\n<>\n  <TextInput leadingVisual=\"$\" aria-label=\"Cost of the thing\" name=\"cost\" placeholder=\"23.45\" />\n\n  <TextInput sx={{width: '150px'}} trailingVisual=\"minutes\" aria-label=\"Time in minutes\" name=\"time\" placeholder=\"25\" />\n</>\n```\n\n### With visuals and loading indicators\n\n```javascript live noinline\nconst WithIconAndLoadingIndicator = () => {\n  const [loading, setLoading] = React.useState(true)\n\n  const toggleLoadingState = () => {\n    setLoading(!loading)\n  }\n\n  return (\n    <>\n      <Box mb={6}>\n        <button type=\"button\" onClick={toggleLoadingState}>\n          Toggle loading state {loading ? 'off' : 'on'}\n        </button>\n      </Box>\n\n      <Text fontSize={3} mb={1} display=\"block\">\n        No visual\n      </Text>\n      <Box mb={3}>\n        <TextInput loading={loading} />\n      </Box>\n\n      <Text fontSize={3} mb={1} display=\"block\">\n        Leading visual\n      </Text>\n      <Box mb={3}>\n        <TextInput leadingVisual={SearchIcon} loading={loading} />\n      </Box>\n\n      <Text fontSize={3} mb={1} display=\"block\">\n        Trailing visual\n      </Text>\n      <Box mb={3}>\n        <TextInput trailingVisual={SearchIcon} loading={loading} />\n      </Box>\n\n      <Text fontSize={3} mb={1} display=\"block\">\n        Both visuals\n      </Text>\n      <Box mb={3}>\n        <TextInput leadingVisual={SearchIcon} trailingVisual={SearchIcon} loading={loading} />\n      </Box>\n\n      <Text fontSize={3} mb={2} display=\"block\">\n        Both visuals, position overriden\n      </Text>\n      <Box mb={3}>\n        <TextInput loaderPosition=\"trailing\" leadingVisual={SearchIcon} trailingVisual={SearchIcon} loading={loading} />\n      </Box>\n    </>\n  )\n}\n\nrender(<WithIconAndLoadingIndicator />)\n```\n\n### With trailing action\n\n```jsx live\n<FormControl>\n  <FormControl.Label>Icon action</FormControl.Label>\n  <TextInput\n    trailingAction={\n      <TextInput.Action\n        onClick={() => {\n          alert('clear input')\n        }}\n        icon={XIcon}\n        aria-label=\"Clear input\"\n        sx={{color: 'fg.subtle'}}\n      />\n    }\n  />\n</FormControl>\n```\n\n### With error and warning states\n\n```jsx live\n<>\n  <TextInput\n    validationStatus=\"error\"\n    aria-label=\"Zipcode\"\n    name=\"zipcode\"\n    placeholder=\"Error\"\n    autoComplete=\"postal-code\"\n  />\n\n  <TextInput\n    validationStatus=\"warning\"\n    aria-label=\"Zipcode\"\n    name=\"zipcode\"\n    placeholder=\"Warning\"\n    autoComplete=\"postal-code\"\n  />\n</>\n```\n\n### Block text input\n\n```jsx live\n<TextInput block aria-label=\"Zipcode\" name=\"zipcode\" placeholder=\"560076\" autoComplete=\"postal-code\" />\n```\n\n### Contrast text input\n\n```jsx live\n<TextInput contrast aria-label=\"Zipcode\" name=\"zipcode\" placeholder=\"Find user\" autoComplete=\"postal-code\" />\n```\n\n### Monospace text input\n\n```jsx live\n<TextInput\n  monospace\n  aria-label=\"personal access token\"\n  name=\"pat\"\n  leadingVisual={CheckIcon}\n  placeholder=\"github_pat_abcdefg123456789\"\n/>\n```\n\n## Props\n\n### TextInput\n\n<PropsTable>\n  <PropsTableRow name=\"aria-label\" type=\"string\" description=\"Allows input to be accessible.\" />\n  <PropsTableRow name=\"block\" type=\"boolean\" defaultValue=\"false\" description=\"Creates a full-width input element\" />\n  <PropsTableRow\n    name=\"contrast\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Changes background color to a higher contrast color\"\n  />\n  <PropsTableRow\n    name=\"size\"\n    type=\"'small' | 'medium' | 'large'\"\n    description=\"Creates a smaller or larger input than the default.\"\n  />\n  <PropsTableRow name=\"loading\" type=\"boolean\" description=\"Whether to show a loading indicator in the input\" />\n  <PropsTableRow\n    name=\"loaderPosition\"\n    type=\"'auto' | 'leading' | 'trailing'\"\n    description={\n      <>\n        <div>Which position to render the loading indicator</div>\n        <ul>\n          <li>\n            'auto' (default): at the end of the input, unless a `leadingVisual` is passed. Then, it will render at the\n            beginning\n          </li>\n          <li>'leading': at the beginning of the input</li>\n          <li>'trailing': at the end of the input</li>\n        </ul>\n      </>\n    }\n  />\n  <PropsTableRow\n    name=\"leadingVisual\"\n    type={<>string | React.ComponentType</>}\n    description=\"Visual positioned on the left edge inside the input\"\n  />\n  <PropsTableRow name=\"monospace\" type=\"boolean\" defaultValue=\"false\" description=\"Shows input in monospace font\" />\n  <PropsTableRow\n    name=\"trailingVisual\"\n    type={<>string | React.ComponentType</>}\n    description=\"Visual positioned on the right edge inside the input\"\n  />\n  <PropsTableRow\n    name=\"trailingAction\"\n    type=\"React.ReactElement<HTMLProps<HTMLButtonElement>>\"\n    description=\"A visual that renders inside the input after the typing area\"\n  />\n  <PropsTableRow\n    name=\"validationStatus\"\n    type=\"'error' | 'success' | 'warning'\"\n    description=\"Style the input to match the status\"\n  />\n  <PropsTableRow\n    name=\"variant\"\n    type=\"'small' | 'medium' | 'large'\"\n    description=\"(Use size) Creates a smaller or larger input than the default.\"\n    deprecated\n  />\n  <PropsTableRow\n    name=\"width\"\n    type={\n      <>\n        string | number | <Link href=\"https://styled-system.com/guides/array-props\">Array&lt;string | number&gt;</Link>\n      </>\n    }\n    description=\"(Use sx prop) Set the width of the input\"\n    deprecated\n  />\n  <PropsTableRow\n    name=\"maxWidth\"\n    type={\n      <>\n        string | number | <Link href=\"https://styled-system.com/guides/array-props\">Array&lt;string | number&gt;</Link>\n      </>\n    }\n    description=\"(Use sx prop) Set the maximum width of the input\"\n    deprecated\n  />\n  <PropsTableRow\n    name=\"minWidth\"\n    type={\n      <>\n        string | number | <Link href=\"https://styled-system.com/guides/array-props\">Array&lt;string | number&gt;</Link>\n      </>\n    }\n    description=\"(Use sx prop) Set the minimum width of the input\"\n    deprecated\n  />\n  <PropsTableRow\n    name=\"icon\"\n    type=\"React.ComponentType\"\n    description=\"(Use leadingVisual or trailingVisual) An Octicon React component. To be used inside of input. Positioned on the left edge.\"\n    deprecated\n  />\n  <PropsTableSxRow />\n  <PropsTableRefRow\n    elementType=\"input\"\n    refType=\"HTMLInputElement\"\n    description=\"A ref to the input element rendered by this component. Note: this is not the outermost element rendered by TextInput. There is also a div wrapper for which a ref is not accepted.\"\n  />\n  <PropsTablePassthroughPropsRow\n    elementName=\"input\"\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes\">MDN</Link>\n    }\n  />\n</PropsTable>\n\n### TextInput.Action\n\n<PropsTable>\n  <PropsTableRow\n    name=\"aria-label\"\n    type=\"string\"\n    description=\"Text that appears in a tooltip. If an icon is passed, this is also used as the label used by assistive technologies.\"\n  />\n  <PropsTableRow name=\"icon\" type=\"React.FunctionComponent\" description=\"The icon to render inside the button\" />\n  <PropsTableRow\n    name=\"variant\"\n    type=\"'default' | 'primary' | 'invisible' | 'danger'\"\n    description=\"(Deprecated so that only the 'invisible' variant is used) Determine's the styles on a button\"\n    deprecated\n  />\n  <PropsTableBasePropRows\n    elementType=\"button\"\n    refType=\"HTMLButtonElement\"\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attributes\">MDN</Link>\n    }\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: false,\n    usedInProduction: true,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"TextInput"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/TextInputWithTokens.mdx","frontmatter":{"title":"TextInputWithTokens"},"rawBody":"---\ncomponentId: text_input_with_tokens\ntitle: TextInputWithTokens\nstatus: Alpha\ndescription: Used to show multiple values in one field\nsource: https://github.com/primer/react/tree/main/src/TextInputWithTokens.tsx\nstorybook: '/react/storybook?path=/story/forms-text-input-with-tokens--default'\n---\n\nimport {TextInputWithTokens} from '@primer/react'\n\nA `TextInputWithTokens` component supports all of the features of a [TextInput](/TextInput) component, but it can render a list of [Tokens](/Token) next to the area a user types in.\n\n## Examples\n\n### Basic\n\n```javascript live noinline\nconst BasicExample = () => {\n  const [tokens, setTokens] = React.useState([\n    {text: 'zero', id: 0},\n    {text: 'one', id: 1},\n    {text: 'two', id: 2}\n  ])\n  const onTokenRemove = tokenId => {\n    setTokens(tokens.filter(token => token.id !== tokenId))\n  }\n\n  return (\n    <FormControl>\n      <FormControl.Label>Basic example tokens</FormControl.Label>\n      <TextInputWithTokens tokens={tokens} onTokenRemove={onTokenRemove} />\n    </FormControl>\n  )\n}\n\nrender(BasicExample)\n```\n\n### Using a different token component\n\nBy default, the `Token` component is used to render the tokens in the input. If this component does not make sense for the kinds of tokens you're rendering, you can pass a component to the `tokenComponent` prop\n\n```javascript live noinline\nconst UsingIssueLabelTokens = () => {\n  const [tokens, setTokens] = React.useState([\n    {text: 'enhancement', id: 1, fillColor: '#a2eeef'},\n    {text: 'bug', id: 2, fillColor: '#d73a4a'},\n    {text: 'good first issue', id: 3, fillColor: '#0cf478'}\n  ])\n  const onTokenRemove = tokenId => {\n    setTokens(tokens.filter(token => token.id !== tokenId))\n  }\n\n  return (\n    <FormControl>\n      <FormControl.Label>Issue labels</FormControl.Label>\n      <TextInputWithTokens tokenComponent={IssueLabelToken} tokens={tokens} onTokenRemove={onTokenRemove} />\n    </FormControl>\n  )\n}\n\nrender(<UsingIssueLabelTokens />)\n```\n\n### Dealing with long lists of tokens\n\nBy default, all tokens will be visible when the component is rendered.\n\nIf the component is being used in an area where it's height needs to be constrained, there are options to limit the height of the input.\n\n```javascript live noinline\nconst VisibleTokenCountExample = () => {\n  const [tokens, setTokens] = React.useState([\n    {text: 'zero', id: 0},\n    {text: 'one', id: 1},\n    {text: 'two', id: 2},\n    {text: 'three', id: 3}\n  ])\n  const onTokenRemove = tokenId => {\n    setTokens(tokens.filter(token => token.id !== tokenId))\n  }\n\n  return (\n    <Box maxWidth=\"500px\">\n      <FormControl>\n        <FormControl.Label>Tokens truncated after 2</FormControl.Label>\n        <TextInputWithTokens visibleTokenCount={2} block tokens={tokens} onTokenRemove={onTokenRemove} />\n      </FormControl>\n    </Box>\n  )\n}\n\nrender(VisibleTokenCountExample)\n```\n\n### Render tokens on a single line\n\n```javascript live noinline\nconst PreventTokenWrappingExample = () => {\n  const [tokens, setTokens] = React.useState([\n    {text: 'zero', id: 0},\n    {text: 'one', id: 1},\n    {text: 'two', id: 2},\n    {text: 'three', id: 3},\n    {text: 'four', id: 4},\n    {text: 'five', id: 5},\n    {text: 'six', id: 6},\n    {text: 'seven', id: 7}\n  ])\n  const onTokenRemove = tokenId => {\n    setTokens(tokens.filter(token => token.id !== tokenId))\n  }\n\n  return (\n    <Box maxWidth=\"500px\">\n      <FormControl>\n        <FormControl.Label>Tokens on one line</FormControl.Label>\n        <TextInputWithTokens\n          preventTokenWrapping\n          block\n          tokens={tokens}\n          onTokenRemove={onTokenRemove}\n          id=\"inputWithTokens-basic\"\n        />\n      </FormControl>\n    </Box>\n  )\n}\n\nrender(PreventTokenWrappingExample)\n```\n\n### Set a maximum height for the input\n\n```javascript live noinline\nconst MaxHeightExample = () => {\n  const [tokens, setTokens] = React.useState([\n    {text: 'zero', id: 0},\n    {text: 'one', id: 1},\n    {text: 'two', id: 2},\n    {text: 'three', id: 3},\n    {text: 'four', id: 4},\n    {text: 'five', id: 5},\n    {text: 'six', id: 6},\n    {text: 'seven', id: 7}\n  ])\n  const onTokenRemove = tokenId => {\n    setTokens(tokens.filter(token => token.id !== tokenId))\n  }\n\n  return (\n    <Box maxWidth=\"500px\">\n      <FormControl>\n        <FormControl.Label>Tokens restricted to a max height</FormControl.Label>\n        <TextInputWithTokens\n          maxHeight=\"50px\"\n          block\n          tokens={tokens}\n          onTokenRemove={onTokenRemove}\n          id=\"inputWithTokens-basic\"\n        />\n      </FormControl>\n    </Box>\n  )\n}\n\nrender(MaxHeightExample)\n```\n\n### With an error validation status\n\n```javascript live noinline\nconst ErrorExample = () => {\n  const [tokens, setTokens] = React.useState([\n    {text: 'zero', id: 0},\n    {text: 'one', id: 1},\n    {text: 'two', id: 2}\n  ])\n  const onTokenRemove = tokenId => {\n    setTokens(tokens.filter(token => token.id !== tokenId))\n  }\n\n  return (\n    <>\n      <Box as=\"label\" display=\"block\" htmlFor=\"inputWithTokens-basic\">\n        Basic example tokens\n      </Box>\n      <TextInputWithTokens\n        tokens={tokens}\n        onTokenRemove={onTokenRemove}\n        id=\"inputWithTokens-basic\"\n        validationStatus=\"error\"\n      />\n    </>\n  )\n}\n\nrender(ErrorExample)\n```\n\n### With leading and trailing visuals\n\n```javascript live noinline\nconst LeadingVisualExample = () => {\n  const [dates, setDates] = React.useState([\n    {text: '01 Jan', id: 0},\n    {text: '01 Feb', id: 1},\n    {text: '01 Mar', id: 2}\n  ])\n  const [tokens, setTokens] = React.useState([\n    {text: 'zero', id: 0},\n    {text: 'one', id: 1},\n    {text: 'two', id: 2}\n  ])\n  const onDateRemove = tokenId => {\n    setDates(dates.filter(token => token.id !== tokenId))\n  }\n  const onTokenRemove = tokenId => {\n    setTokens(tokens.filter(token => token.id !== tokenId))\n  }\n\n  return (\n    <>\n      <FormControl>\n        <FormControl.Label>Dates</FormControl.Label>\n        <TextInputWithTokens leadingVisual={CalendarIcon} tokens={dates} onTokenRemove={onDateRemove} />\n      </FormControl>\n      <FormControl>\n        <FormControl.Label>Tokens</FormControl.Label>\n        <TextInputWithTokens trailingVisual={CheckIcon} tokens={tokens} onTokenRemove={onTokenRemove} />\n      </FormControl>\n    </>\n  )\n}\n\nrender(LeadingVisualExample)\n```\n\n## With visuals and loading indicators\n\n```javascript live noinline\nconst WithIconAndLoadingIndicator = () => {\n  const [dates, setDates] = React.useState([\n    {text: '01 Jan', id: 0},\n    {text: '01 Feb', id: 1},\n    {text: '01 Mar', id: 2}\n  ])\n  const onDateRemove = tokenId => {\n    setDates(dates.filter(token => token.id !== tokenId))\n  }\n\n  const [loading, setLoading] = React.useState(true)\n  const toggleLoadingState = () => {\n    setLoading(!loading)\n  }\n\n  return (\n    <>\n      <Box mb={5} display=\"flex\" justifyContent=\"flex-end\">\n        <button type=\"button\" onClick={toggleLoadingState}>\n          Toggle loading state {loading ? 'off' : 'on'}\n        </button>\n      </Box>\n\n      <h3>No visual</h3>\n      <Box mb={2}>\n        <TextInputWithTokens tokens={dates} onTokenRemove={onDateRemove} value=\"auto\" loading={loading} />\n      </Box>\n      <Box mb={2}>\n        <TextInputWithTokens\n          tokens={dates}\n          onTokenRemove={onDateRemove}\n          value=\"leading\"\n          loading={loading}\n          loaderPosition=\"leading\"\n        />\n      </Box>\n      <Box mb={5}>\n        <TextInputWithTokens\n          tokens={dates}\n          onTokenRemove={onDateRemove}\n          value=\"trailing\"\n          loading={loading}\n          loaderPosition=\"trailing\"\n        />\n      </Box>\n\n      <h3>Leading visual</h3>\n      <Box mb={2}>\n        <TextInputWithTokens\n          tokens={dates}\n          onTokenRemove={onDateRemove}\n          leadingVisual={CalendarIcon}\n          loading={loading}\n          value=\"auto\"\n        />\n      </Box>\n      <Box mb={2}>\n        <TextInputWithTokens\n          tokens={dates}\n          onTokenRemove={onDateRemove}\n          leadingVisual={CalendarIcon}\n          loading={loading}\n          loaderPosition=\"leading\"\n          value=\"leading\"\n        />\n      </Box>\n      <Box mb={5}>\n        <TextInputWithTokens\n          tokens={dates}\n          onTokenRemove={onDateRemove}\n          leadingVisual={CalendarIcon}\n          loading={loading}\n          loaderPosition=\"trailing\"\n          value=\"trailing\"\n        />\n      </Box>\n\n      <h3>Trailing visual</h3>\n      <Box mb={2}>\n        <TextInputWithTokens\n          tokens={dates}\n          onTokenRemove={onDateRemove}\n          trailingVisual={CalendarIcon}\n          loading={loading}\n          value=\"auto\"\n        />\n      </Box>\n      <Box mb={2}>\n        <TextInputWithTokens\n          tokens={dates}\n          onTokenRemove={onDateRemove}\n          trailingVisual={CalendarIcon}\n          loading={loading}\n          loaderPosition=\"leading\"\n          value=\"leading\"\n        />\n      </Box>\n      <Box mb={5}>\n        <TextInputWithTokens\n          tokens={dates}\n          onTokenRemove={onDateRemove}\n          trailingVisual={CalendarIcon}\n          loading={loading}\n          loaderPosition=\"trailing\"\n          value=\"trailing\"\n        />\n      </Box>\n\n      <h3>Both visuals</h3>\n      <Box mb={2}>\n        <TextInputWithTokens\n          tokens={dates}\n          onTokenRemove={onDateRemove}\n          size=\"small\"\n          leadingVisual={CalendarIcon}\n          trailingVisual={CalendarIcon}\n          loading={loading}\n          value=\"auto\"\n        />\n      </Box>\n      <Box mb={2}>\n        <TextInputWithTokens\n          tokens={dates}\n          onTokenRemove={onDateRemove}\n          leadingVisual={CalendarIcon}\n          trailingVisual={CalendarIcon}\n          loading={loading}\n          loaderPosition=\"leading\"\n          value=\"leading\"\n        />\n      </Box>\n      <Box mb={2}>\n        <TextInputWithTokens\n          tokens={dates}\n          onTokenRemove={onDateRemove}\n          size=\"large\"\n          leadingVisual={CalendarIcon}\n          trailingVisual={CalendarIcon}\n          loading={loading}\n          loaderPosition=\"trailing\"\n          value=\"trailing\"\n        />\n      </Box>\n    </>\n  )\n}\n\nrender(<WithIconAndLoadingIndicator />)\n```\n\n## Props\n\n<PropsTable>\n  <PropsTableRow required name=\"tokens\" type=\"TokenProps[]\" description=\"The array of tokens to render\" />\n  <PropsTableRow\n    required\n    name=\"onTokenRemove\"\n    type=\"(tokenId: string|number) => void\"\n    description=\"The function that gets called when a token is removed\"\n  />\n  <PropsTableRow\n    name=\"tokenComponent\"\n    type=\"React.ComponentType<any>\"\n    defaultValue=\"Token\"\n    description=\"The component used to render each token\"\n  />\n  <PropsTableRow\n    name=\"maxHeight\"\n    type=\"React.CSSProperties['maxHeight']\"\n    description=\"The maximum height of the component. If the content in the input exceeds this height, it will scroll vertically\"\n  />\n  <PropsTableRow\n    name=\"preventTokenWrapping\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Whether tokens should render inline horizontally. By default, tokens wrap to new lines\"\n  />\n  <PropsTableRow\n    name=\"size\"\n    type=\"'small' | 'medium' | 'large' | 'xlarge'\"\n    defaultValue=\"xlarge\"\n    description=\"The size of the tokens and text input\"\n  />\n  <PropsTableRow\n    name=\"hideTokenRemoveButtons\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Whether the remove buttons should be rendered in the tokens\"\n  />\n  <PropsTableRow\n    name=\"validationStatus\"\n    type=\"'error' | 'success' | 'warning'\"\n    description=\"Style the input to match the status\"\n  />\n  <PropsTableRow\n    name=\"visibleTokenCount\"\n    type=\"number\"\n    description=\"The number of tokens to display before truncating\"\n  />\n</PropsTable>\n\n### Adding and removing tokens\n\nThe array passed to the `tokens` prop needs to be manually updated to add and remove tokens.\n\nThe function passed to the `onRemoveToken` prop is called when:\n\n- Clicking the remove button in the token\n- Pressing the `Backspace` key when the input is empty\n- Selecting a token using the arrow keys or by clicking on a token and then pressing the `Backspace` key\n\nThere is no function that gets called to \"add\" a token, so the user needs to be provided with a UI to select tokens.\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: true,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"TextInputWithTokens"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Textarea.mdx","frontmatter":{"title":"Textarea"},"rawBody":"---\ncomponentId: textarea\ntitle: Textarea\ndescription: Use Textarea for multi-line text input form fields\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/Textarea.tsx\nstorybook: /react/storybook?path=/story/forms-textarea--default\n---\n\nimport {Textarea} from '@primer/react'\n\n<Box sx={{border: '1px solid', borderColor: 'border.default', borderRadius: 2, padding: 6, marginBottom: 3}}>\n  <Textarea />\n</Box>\n\n```js\nimport {Textarea} from '@primer/react'\n```\n\n## Examples\n\n<Note variant=\"warning\">\n\nTextarea components **must always** be accompanied by a corresponding label to improve support for assistive\ntechnologies. Examples below are provided for conciseness and may not reflect accessibility best practices.\n\nUse the [FormControl](/FormControl) component to render a Textarea with a corresponding label.\n\n</Note>\n\n### Controlled mode\n\n```javascript live noinline\nconst TextareaExample = () => {\n  // Running in controlled mode (recommended)\n  const [value, setValue] = React.useState('')\n\n  const handleChange = event => {\n    setValue(event.target.value)\n  }\n\n  return <Textarea placeholder=\"Enter a description\" onChange={handleChange} value={value} />\n}\n\nrender(<TextareaExample />)\n```\n\n### Uncontrolled mode\n\n```javascript live noinline\nconst TextareaExample = () => {\n  const ref = React.useRef()\n\n  const handleSubmit = event => {\n    event.preventDefault()\n    if (!ref.current.value) {\n      alert(`Enter a value into the Textarea and press submit`)\n      return\n    }\n\n    alert(`Current Textarea value: ${ref.current.value}`)\n  }\n\n  return (\n    <form onSubmit={handleSubmit}>\n      <Textarea\n        cols={40}\n        rows={8}\n        ref={ref}\n        defaultValue=\"Set the initial state in uncontrolled mode using the defaultValue prop\"\n      />\n      <br />\n      <Button type=\"submit\">Submit</Button>\n    </form>\n  )\n}\n\nrender(<TextareaExample />)\n```\n\n### Displaying form validation state\n\n```jsx live\n<>\n  <Box as=\"label\" htmlFor=\"success-state\" sx={{display: 'block'}}>\n    Success state:\n  </Box>\n  <Textarea id=\"success-state\" validationStatus=\"success\" />\n  <Box as=\"label\" htmlFor=\"error-state\" sx={{display: 'block', mt: 5}}>\n    Error state:\n  </Box>\n  <Textarea id=\"error-state\" validationStatus=\"error\" />\n</>\n```\n\n### Inactive\n\n```jsx live\n<>\n  <Textarea disabled>This text is inactive</Textarea>\n</>\n```\n\n### Resize\n\nBy default, `Textarea` can be resized by the user vertically and horizontally. Resizing can be prevented by setting `resize` to `none`\n\n```jsx live\n<Textarea cols={40} resize=\"none\" />\n```\n\n### Custom styling\n\n```jsx live\n<>\n  <Textarea sx={{marginBottom: 2}} />\n  <p>Custom styles like `margin` and `padding` can be applied using the `sx` prop</p>\n</>\n```\n\n## Props\n\n### Textarea\n\n<PropsTable>\n  <PropsTableRow\n    name=\"required\"\n    type=\"boolean\"\n    description=\"Indicates to the user and assistive technologies that the field value is required\"\n  />\n  <PropsTableRow\n    name=\"cols\"\n    type=\"number\"\n    description=\"Specifies the visible width of a text area.\"\n  />\n  <PropsTableRow\n    name=\"rows\"\n    type=\"number\"\n    description=\"Specifies the visible height of a text area.\"\n  />\n  <PropsTableRow\n    name=\"block\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Expands with width of the component to fill the parent elements\"\n  />\n  <PropsTableRow\n    name=\"resize\"\n    type=\"'both' | 'horizontal' | 'vertical' | 'none'\"\n    defaultValue=\"'both'\"\n    description=\"Changes background color to a higher contrast color\"\n  />\n  <PropsTableRow name=\"validationStatus\"  \n    type=\"'success' | 'error' | undefined\" \n    description=\"Style the textarea to match the current form validation status\"\n  />\n  <PropsTableRefRow\n    elementType=\"textarea\"\n    refType=\"HTMLTextAreaElement\"\n  />\n  <PropsTablePassthroughPropsRow\n    elementName=\"textarea\"\n    passthroughPropsLink={\n      <Link href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attributes\">MDN</Link>\n    }\n  />\n\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Textarea"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Timeline.md","frontmatter":{"title":"Timeline"},"rawBody":"---\ncomponentId: timeline\ntitle: Timeline\nstatus: Alpha\n---\n\nThe Timeline.Item component is used to display items on a vertical timeline, connected by Timeline.Badge elements.\n\n## Example with in-line links\n\n```jsx live\n<Timeline>\n  <Timeline.Item>\n    <Timeline.Badge>\n      <StyledOcticon icon={FlameIcon} />\n    </Timeline.Badge>\n    <Timeline.Body>\n      <Link href=\"#\" sx={{fontWeight: 'bold', color: 'fg.default', mr: 1}} muted>\n        Monalisa\n      </Link>\n      created one <Link href=\"#\" sx={{fontWeight: 'bold', color: 'fg.default', mr: 1}} muted>\n        hot potato\n      </Link>\n      <Link href=\"#\" color=\"fg.muted\" muted>\n        Just now\n      </Link>\n    </Timeline.Body>\n  </Timeline.Item>\n</Timeline>\n```\n\n## Default Color example\n\nThe default Timeline.Badge color is dark text on a light grey background.\n\n```jsx live\n<Timeline>\n  <Timeline.Item>\n    <Timeline.Badge>\n      <StyledOcticon icon={FlameIcon} />\n    </Timeline.Badge>\n    <Timeline.Body>Default badge color</Timeline.Body>\n  </Timeline.Item>\n</Timeline>\n```\n\n## Adding color to a Badge\n\nTo have color variants, use the `bg` prop on the `Timeline.Badge`. If an icon is being used, set the `color` prop\nof the child `StyledOcticon` if necessary.\n\n```jsx live\n<Timeline>\n  <Timeline.Item>\n    <Timeline.Badge sx={{bg: 'danger.emphasis'}}>\n      <StyledOcticon icon={FlameIcon} sx={{color: 'fg.onEmphasis'}} />\n    </Timeline.Badge>\n    <Timeline.Body>Background used when closed events occur</Timeline.Body>\n  </Timeline.Item>\n  <Timeline.Item>\n    <Timeline.Badge sx={{bg: 'danger.emphasis'}}>\n      <StyledOcticon icon={FlameIcon} color=\"fg.onEmphasis\" />\n    </Timeline.Badge>\n    <Timeline.Body>Background when opened or passed events occur</Timeline.Body>\n  </Timeline.Item>\n  <Timeline.Item>\n    <Timeline.Badge sx={{bg: 'danger.emphasis'}}>\n      <StyledOcticon icon={FlameIcon} sx={{color: 'fg.onEmphasis'}} />\n    </Timeline.Badge>\n    <Timeline.Body>Background used when pull requests are merged</Timeline.Body>\n  </Timeline.Item>\n</Timeline>\n```\n\n## Condensed items\n\nTimeline has a condensed prop that will reduce the vertical padding and remove the background from the badge item. These are most commonly used in commits. To condense a single item, remove the top or bottom padding with the `pt={0}` or `pb={0}` prop.\n\n```jsx live\n<Timeline>\n  <Timeline.Item condensed>\n    <Timeline.Badge>\n      <StyledOcticon icon={GitCommitIcon} />\n    </Timeline.Badge>\n    <Timeline.Body>This is the message of a condensed TimelineItem</Timeline.Body>\n  </Timeline.Item>\n  <Timeline.Item condensed>\n    <Timeline.Badge>\n      <StyledOcticon icon={GitCommitIcon} />\n    </Timeline.Badge>\n    <Timeline.Body>This is the message of a condensed TimelineItem</Timeline.Body>\n  </Timeline.Item>\n</Timeline>\n```\n\n## Timeline Break\n\nTo create a visual break in the timeline, use Timeline.Break. This adds a horizontal bar across the timeline to show that something has disrupted it. Usually this happens when a close or merged event occurs.\n\n```jsx live\n<Timeline>\n  <Timeline.Item>\n    <Timeline.Badge sx={{bg: 'danger.emphasis'}}>\n      <StyledOcticon icon={FlameIcon} color=\"fg.onEmphasis\" />\n    </Timeline.Badge>\n    <Timeline.Body>Background used when closed events occur</Timeline.Body>\n  </Timeline.Item>\n  <Timeline.Break />\n  <Timeline.Item>\n    <Timeline.Badge sx={{bg: 'success.emphasis'}}>\n      <StyledOcticon icon={FlameIcon} sx={{color: 'fg.onEmphasis'}} />\n    </Timeline.Badge>\n    <Timeline.Body>Background when opened or passed events occur</Timeline.Body>\n  </Timeline.Item>\n</Timeline>\n```\n\n## Component props\n\n### Timeline\n\n| Name        | Type              | Default | Description                                                                       |\n| :---------- | :---------------- | :-----: | :-------------------------------------------------------------------------------- |\n| clipSidebar | Boolean           |         | Hides the sidebar above the first Timeline.Item and below the last Timeline.Item. |\n| sx          | SystemStyleObject |   {}    | Style to be applied to the component                                              |\n\n### Timeline.Item\n\n| Name      | Type              | Default | Description                                                           |\n| :-------- | :---------------- | :-----: | :-------------------------------------------------------------------- |\n| condensed | Boolean           |         | Reduces vertical padding and removes background from an item's badge. |\n| sx        | SystemStyleObject |   {}    | Style to be applied to the component                                  |\n\n### Timeline.Badge\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n\n### Timeline.Body\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n\n### Timeline.Break\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n","parent":{"relativeDirectory":"","name":"Timeline"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/ToggleSwitch.mdx","frontmatter":{"title":"ToggleSwitch"},"rawBody":"---\ncomponentId: toggle_switch\ntitle: ToggleSwitch\ndescription: Toggles a setting on or off, and immediately saves the change\nstatus: Alpha\nsource: https://github.com/primer/react/blob/main/src/ToggleSwitch.tsx\nstorybook: '/react/storybook?path=/story/toggleswitch-examples--default'\n---\n\n## Examples\n\n### Basic\n\n```jsx live\n<Box display=\"flex\" maxWidth=\"300px\">\n  <Box flexGrow={1} fontSize={2} fontWeight=\"bold\" id=\"switchLabel\">\n    Notifications\n  </Box>\n  <ToggleSwitch aria-labelledby=\"switchLabel\" />\n</Box>\n```\n\n### Uncontrolled with default value\n\n```jsx live\n<Box display=\"flex\" maxWidth=\"300px\">\n  <Box flexGrow={1} fontSize={2} fontWeight=\"bold\" id=\"switchLabel\">\n    Notifications\n  </Box>\n  <ToggleSwitch defaultChecked aria-labelledby=\"switchLabel\" />\n</Box>\n```\n\n### Controlled\n\n```javascript noinline live\nconst Controlled = () => {\n  const [isOn, setIsOn] = React.useState(false)\n\n  const onClick = () => {\n    setIsOn(!isOn)\n  }\n\n  const handleSwitchChange = on => {\n    console.log(`new switch \"on\" state: ${on}`)\n  }\n\n  return (\n    <>\n      <Box display=\"flex\" maxWidth=\"300px\">\n        <Box flexGrow={1} fontSize={2} fontWeight=\"bold\" id=\"switchLabel\">\n          Notifications\n        </Box>\n        <ToggleSwitch onClick={onClick} onChange={handleSwitchChange} checked={isOn} aria-labelledby=\"switchLabel\" />\n      </Box>\n      <p>The switch is {isOn ? 'on' : 'off'}</p>\n    </>\n  )\n}\n\nrender(Controlled)\n```\n\n### Small\n\n```jsx live\n<Box display=\"flex\" maxWidth=\"300px\">\n  <Box flexGrow={1} fontSize={1} fontWeight=\"bold\" id=\"switchLabel\">\n    Notifications\n  </Box>\n  <ToggleSwitch aria-labelledby=\"switchLabel\" size=\"small\" />\n</Box>\n```\n\n### Delayed toggle with loading state\n\n```javascript noinline live\nconst LoadingToggle = () => {\n  const [loading, setLoading] = React.useState(false)\n  const [isOn, setIsOn] = React.useState(false)\n\n  async function switchSlowly(currentOn) {\n    await new Promise(resolve => setTimeout(resolve, 1500))\n    return await !currentOn\n  }\n\n  async function onClick() {\n    setLoading(!loading)\n    const newSwitchState = await switchSlowly(isOn)\n    setIsOn(newSwitchState)\n  }\n\n  const handleSwitchChange = React.useCallback(\n    on => {\n      setLoading(false)\n    },\n    [setLoading]\n  )\n\n  return (\n    <>\n      <Box display=\"flex\" maxWidth=\"300px\">\n        <Box flexGrow={1} fontSize={2} fontWeight=\"bold\" id=\"switchLabel\">\n          Notifications\n        </Box>\n        <ToggleSwitch\n          aria-labelledby=\"switchLabel\"\n          loading={loading}\n          checked={isOn}\n          onClick={onClick}\n          onChange={handleSwitchChange}\n        />\n      </Box>\n      <p>The switch is {isOn ? 'on' : 'off'}</p>\n    </>\n  )\n}\n\nrender(LoadingToggle)\n```\n\n### Disabled\n\n```jsx live\n<Box display=\"flex\" maxWidth=\"300px\">\n  <Box flexGrow={1} fontSize={2} fontWeight=\"bold\" id=\"switchLabel\">\n    Notifications\n  </Box>\n  <ToggleSwitch aria-labelledby=\"switchLabel\" disabled />\n</Box>\n```\n\n### With associated caption text\n\n```jsx live\n<Box display=\"flex\">\n  <Box flexGrow={1}>\n    <Text fontSize={2} fontWeight=\"bold\" id=\"switchLabel\" display=\"block\">\n      Notifications\n    </Text>\n    <Text color=\"fg.subtle\" fontSize={1} id=\"switchCaption\" display=\"block\">\n      Notifications will be delivered via email and the GitHub notification center\n    </Text>\n  </Box>\n  <ToggleSwitch aria-labelledby=\"switchLabel\" aria-describedby=\"switchCaption\" />\n</Box>\n```\n\n### Left-aligned with label\n\n```jsx live\n<>\n  <Text fontSize={2} fontWeight=\"bold\" id=\"switchLabel\" display=\"block\" mb={1}>\n    Notifications\n  </Text>\n  <ToggleSwitch statusLabelPosition=\"end\" aria-labelledby=\"switchLabel\" />\n</>\n```\n\n## Props\n\n<PropsTable>\n  <PropsTableRow name=\"aria-describedby\" type=\"string\" description=\"The id of the DOM node that describes the switch\" />\n  <PropsTableRow\n    name=\"aria-labelledby\"\n    type=\"string\"\n    required\n    description=\"The id of the DOM node that labels the switch\"\n  />\n  <PropsTableRow name=\"defaultChecked\" type=\"boolean\" description=\"Uncontrolled - whether the switch is turned on\" />\n  <PropsTableRow name=\"disabled\" type=\"boolean\" description=\"Whether the switch is ready for user input\" />\n  <PropsTableRow name=\"loading\" type=\"boolean\" description=\"Whether the switch's value is being calculated\" />\n  <PropsTableRow name=\"checked\" type=\"boolean\" description=\"Whether the switch is turned on\" />\n  <PropsTableRow\n    name=\"onChange\"\n    type=\"(on: boolean) => void\"\n    description=\"The callback that is called when the switch is toggled on or off\"\n  />\n  <PropsTableRow\n    name=\"onClick\"\n    type=\"(e: MouseEvent) => void\"\n    description=\"The callback that is called when the switch is clicked\"\n  />\n  <PropsTableRow name=\"size\" type=\"'small' | 'medium'\" defaultValue=\"'medium'\" description=\"Size of the switch\" />\n  <PropsTableRow\n    name=\"statusLabelPosition\"\n    type=\"'start' | 'end'\"\n    defaultValue=\"'start'\"\n    description={\n      <>\n        <div>Whether the \"on\" and \"off\" labels should appear before or after the switch.</div>\n        <div>\n          <Text fontWeight=\"bold\">This should only be changed when the switch's alignment needs to be adjusted.</Text>{' '}\n          For example: It needs to be left-aligned because the label appears above it and the caption appears below it.\n        </div>\n      </>\n    }\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"ToggleSwitch"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Token.mdx","frontmatter":{"title":"Token"},"rawBody":"---\ncomponentId: token\ntitle: Token\nstatus: Alpha\ndescription: A Token represents a piece of data. They are typically used to show a collection of related attributes.\nsource: https://github.com/primer/react/tree/main/src/Token\nstorybook: '/react/storybook?path=/story/tokens-default--default-token'\n---\n\nimport {AvatarToken, IssueLabelToken, Token} from '@primer/react'\n\nThe default `Token` can be used for most cases, but specialized token components are provided for specific use cases (see below for more info).\n\nAll types of tokens may have the same interactive qualities as links or buttons. They also have a sense of being \"selected\" and ready for user interaction such as being removed from a collection.\n\n## Examples\n\n### Basic\n\n```jsx live\n<>\n  <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n    Token\n  </Text>\n  <Token text=\"Default Token\" />\n</>\n```\n\n### Kitchen sink\n\n```jsx live\n<Box\n  display=\"flex\"\n  sx={{\n    alignItems: 'start',\n    flexDirection: 'column',\n    gap: 6\n  }}\n>\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      Resting\n    </Text>\n    <Token text=\"Default Token\" />\n  </div>\n\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      isSelected\n    </Text>\n    <Token text=\"Default Token\" isSelected />\n  </div>\n\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      With `leadingVisual` passed\n    </Text>\n    <Token text=\"Default Token\" leadingVisual={GitBranchIcon} />\n  </div>\n\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      With `onRemove` passed\n    </Text>\n    <Token\n      text=\"Default Token\"\n      onRemove={() => {\n        console.log('remove me')\n      }}\n    />\n  </div>\n\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      Size options\n    </Text>\n    <Box\n      display=\"flex\"\n      sx={{\n        alignItems: 'start',\n        gap: 2\n      }}\n    >\n      <Token size=\"small\" text=\"'small' Token\" />\n      <Token size=\"medium\" text=\"'medium' Token\" />\n      <Token size=\"large\" text=\"'large' Token (default)\" />\n      <Token size=\"xlarge\" text=\"'xlarge' Token\" />\n    </Box>\n  </div>\n</Box>\n```\n\n### With leadingVisual\n\n<Note variant=\"warning\">\n  A <InlineCode>leadingVisual</InlineCode> should not be used with the <InlineCode>small</InlineCode> size option if\n  you're rendering an icon from Octicons\n</Note>\n\n```jsx live\n<Box\n  display=\"flex\"\n  sx={{\n    alignItems: 'start',\n    flexDirection: 'column',\n    gap: 6\n  }}\n>\n  <Token size=\"medium\" text=\"'medium' Token\" leadingVisual={GitBranchIcon} />\n  <Token size=\"large\" text=\"'large' Token (default)\" leadingVisual={GitBranchIcon} />\n  <Token size=\"xlarge\" text=\"'xlarge' Token\" leadingVisual={GitBranchIcon} />\n</Box>\n```\n\n### Interactive tokens\n\nIf any token is interactive (it is a link or a button), it will become focusable, and react to being hovered or focused on.\n\nIf a token is interactive _and_ has a remove button (appears when passing `onRemove`), the remove button should not get focus. To invoke the `onRemove` callback without using the cursor, press 'Backspace' when the token is focused.\n\nThese rules apply to all token components mentioned in this document.\n\n#### Interactive tokens with and without an `onRemove` prop\n\n```jsx live\n<Box\n  display=\"flex\"\n  sx={{\n    alignItems: 'start',\n    flexDirection: 'column',\n    gap: 6\n  }}\n>\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      Interactive\n    </Text>\n    <Box\n      display=\"flex\"\n      sx={{\n        alignItems: 'start',\n        gap: 2\n      }}\n    >\n      <Token as=\"a\" href=\"http://google.com/\" text=\"Link\" />\n      <Token as=\"button\" onClick={() => console.log('clicked')} text=\"Button\" />\n      <Token as=\"span\" tabIndex={0} onFocus={() => console.log('focused')} text=\"Focusable Span\" />\n    </Box>\n  </div>\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      Interactive with `onRemove` passed\n    </Text>\n    <Box\n      display=\"flex\"\n      sx={{\n        alignItems: 'start',\n        gap: 2\n      }}\n    >\n      <Token\n        as=\"a\"\n        href=\"http://google.com/\"\n        text=\"Link\"\n        onRemove={() => {\n          console.log('remove me')\n        }}\n      />\n      <Token\n        as=\"button\"\n        onClick={() => console.log('clicked')}\n        text=\"Button\"\n        onRemove={() => {\n          console.log('remove me')\n        }}\n      />\n      <Token\n        as=\"span\"\n        tabIndex={0}\n        onFocus={() => console.log('focused')}\n        text=\"Focusable Span\"\n        onRemove={() => {\n          console.log('remove me')\n        }}\n      />\n    </Box>\n  </div>\n</Box>\n```\n\n### IssueLabelToken\n\nTokens that represent Issue labels should use the `IssueLabelToken` component.\n\n```jsx live\n<Box\n  display=\"flex\"\n  sx={{\n    alignItems: 'start',\n    flexDirection: 'column',\n    gap: 6\n  }}\n>\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      Resting\n    </Text>\n    <IssueLabelToken text=\"good first issue\" fillColor=\"#0366d6\" />\n  </div>\n\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      isSelected\n    </Text>\n    <IssueLabelToken text=\"good first issue\" fillColor=\"#0366d6\" isSelected />\n  </div>\n\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      With `onRemove` passed\n    </Text>\n    <IssueLabelToken\n      text=\"good first issue\"\n      fillColor=\"#0366d6\"\n      onRemove={() => {\n        console.log('remove me')\n      }}\n    />\n  </div>\n\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      Size options\n    </Text>\n    <Box\n      display=\"flex\"\n      sx={{\n        alignItems: 'start',\n        gap: 2\n      }}\n    >\n      <IssueLabelToken\n        fillColor=\"#0366d6\"\n        size=\"small\"\n        text=\"'small' Token\"\n        onRemove={() => {\n          console.log('remove me')\n        }}\n      />\n      <IssueLabelToken\n        fillColor=\"#0366d6\"\n        size=\"medium\"\n        text=\"'medium' Token\"\n        onRemove={() => {\n          console.log('remove me')\n        }}\n      />\n      <IssueLabelToken\n        fillColor=\"#0366d6\"\n        size=\"large\"\n        text=\"'large' Token (default)\"\n        onRemove={() => {\n          console.log('remove me')\n        }}\n      />\n      <IssueLabelToken\n        fillColor=\"#0366d6\"\n        size=\"xlarge\"\n        text=\"'xlarge' Token\"\n        onRemove={() => {\n          console.log('remove me')\n        }}\n      />\n    </Box>\n  </div>\n</Box>\n```\n\n### AvatarToken\n\nTokens that represent GitHub users should use the `AvatarToken` component.\n\n<Note variant=\"warning\">\n  This component should not be used with the <InlineCode>small</InlineCode> or <InlineCode>medium</InlineCode> size\n  option\n</Note>\n\n```jsx live\n<Box\n  display=\"flex\"\n  sx={{\n    alignItems: 'start',\n    flexDirection: 'column',\n    gap: 6\n  }}\n>\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      Resting\n    </Text>\n    <AvatarToken avatarSrc=\"https://avatars.githubusercontent.com/mperrotti\" text=\"Default Token\" />\n  </div>\n\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      isSelected\n    </Text>\n    <AvatarToken avatarSrc=\"https://avatars.githubusercontent.com/mperrotti\" text=\"Default Token\" isSelected />\n  </div>\n\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      With `onRemove` passed\n    </Text>\n    <AvatarToken\n      avatarSrc=\"https://avatars.githubusercontent.com/mperrotti\"\n      text=\"Default Token\"\n      onRemove={() => {\n        console.log('remove me')\n      }}\n    />\n  </div>\n\n  <div>\n    <Text fontSize={0} display=\"block\" color=\"fg.subtle\">\n      Size options\n    </Text>\n    <Box\n      display=\"flex\"\n      sx={{\n        alignItems: 'start',\n        gap: 2\n      }}\n    >\n      <AvatarToken\n        avatarSrc=\"https://avatars.githubusercontent.com/mperrotti\"\n        size=\"large\"\n        text=\"'large' Token (default)\"\n        onRemove={() => {\n          console.log('remove me')\n        }}\n      />\n      <AvatarToken\n        avatarSrc=\"https://avatars.githubusercontent.com/mperrotti\"\n        size=\"xlarge\"\n        text=\"'xlarge' Token\"\n        onRemove={() => {\n          console.log('remove me')\n        }}\n      />\n    </Box>\n  </div>\n</Box>\n```\n\n## Props\n\n<Props of={Token} />\n\n<Props of={IssueLabelToken} />\n\n<Props of={AvatarToken} />\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: true,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"","name":"Token"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Tooltip.md","frontmatter":{"title":"Tooltip"},"rawBody":"---\ncomponentId: tooltip\ntitle: Tooltip\nstatus: Alpha\n---\n\nThe Tooltip component adds a tooltip to add context to elements on the page.\n\n**_⚠️ Usage warning! ⚠️_**\n\nTooltips as a UI pattern should be our last resort for conveying information because it is hidden by default and often with zero or little visual indicator of its existence.\n\nBefore adding a tooltip, please consider: Is this information essential and necessary? Can the UI be made clearer? Can the information be shown on the page by default?\n\n**Attention:** we use aria-label for tooltip contents, because it is crucial that they are accessible to screen reader users. However, aria-label replaces the text content of an element in screen readers, so only use Tooltip on elements with no existing text content, or consider using `title` for supplemental information.\n\n## Default example\n\n```jsx live\n<Box borderWidth=\"1px\" borderStyle=\"solid\" borderColor=\"border.default\" borderRadius={2} p={3}>\n  <Tooltip aria-label=\"Hello, Tooltip!\">Text with a tooltip</Tooltip>\n</Box>\n```\n\n## Component props\n\n| Name       | Type              | Default | Description                                                                                                         |\n| :--------- | :---------------- | :-----: | :------------------------------------------------------------------------------------------------------------------ |\n| align      | String            |         | Can be either `left` or `right`.                                                                                    |\n| direction  | String            |         | Can be one of `n`, `ne`, `e`, `se`, `s`, `sw`, `w`, `nw`. Sets where the tooltip renders in relation to the target. |\n| noDelay    | Boolean           |         | When set to `true`, tooltip appears without any delay                                                               |\n| aria-label | String            |         | Text used in `aria-label` (for accessibility).                                                                      |\n| wrap       | Boolean           |         | Use `true` to allow text within tooltip to wrap.                                                                    |\n| sx         | SystemStyleObject |   {}    | Style to be applied to the component                                                                                |\n","parent":{"relativeDirectory":"","name":"Tooltip"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/Truncate.md","frontmatter":{"title":"Truncate"},"rawBody":"---\ncomponentId: truncate\ntitle: Truncate\nstatus: Alpha\n---\n\nThe Truncate component will shorten text with an ellipsis. Always add a `title` attribute to the truncated element so the full text remains accessible.\n\n## Default example\n\nTruncate will prevent text that overflows from wrapping. The default max-width is 125px.\n\n```jsx live\n<Truncate title=\"Some text with a branch-name-that-is-really-long\">\n  Some text with a branch-name-that-is-really-long\n</Truncate>\n```\n\n## Custom max-width example\n\nYou can override the maximum width of the truncated text with the `maxWidth` prop.\n\n```jsx live\n<Truncate maxWidth={250} title=\"Some text with a branch-name-that-is-really-long\">\n  Some text with a branch-name-that-is-really-long\n</Truncate>\n```\n\n## Inline example\n\nYou can use the `inline` boolean prop for inline (or inline-block) elements with a fixed maximum width (default: 125px).\n\n```jsx live\n<Truncate as=\"strong\" inline title=\"branch-name-that-is-really-long\">\n  Some text with a branch-name-that-is-really-long\n</Truncate>\n```\n\n## Expandable example\n\nYou can use the `expandable` boolean prop to display the truncated text on hover.\n\n```jsx live\n<Truncate expandable title=\"Some text with a branch-name-that-is-really-long\">\n  Some text with a branch-name-that-is-really-long\n</Truncate>\n```\n\n## Component props\n\n| Name       | Type              | Default | Description                                                  |\n| :--------- | :---------------- | :-----: | :----------------------------------------------------------- |\n| as         | String            |  `div`  | Sets the HTML tag for the component                          |\n| maxWidth   | Number            |   125   | Sets the max-width of the text                               |\n| inline     | Boolean           |  false  | displays text as inline block and vertical aligns to the top |\n| expandable | Boolean           |  false  | allows the truncated text to be displayed on hover           |\n| sx         | SystemStyleObject |   {}    | Style to be applied to the component                         |\n","parent":{"relativeDirectory":"","name":"Truncate"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/UnderlineNav.md","frontmatter":{"title":"UnderlineNav"},"rawBody":"---\ncomponentId: underline_nav\ntitle: UnderlineNav\nstatus: Alpha\n---\n\nUse the UnderlineNav component to style navigation with a minimal underlined selected state, typically used for navigation placed at the top of the page.\n\nTo use UnderlineNav with [react-router](https://github.com/ReactTraining/react-router) or\n[react-router-dom](https://www.npmjs.com/package/react-router-dom), pass\n`as={NavLink}` and omit the `selected` prop.\nThis ensures that the NavLink gets `activeClassName='selected'`\n\n**Attention:** Make sure to properly label your `UnderlineNav` with an `aria-label` to provide context about the type of navigation contained in `UnderlineNav`.\n\n## Default example\n\n```jsx live\n<UnderlineNav aria-label=\"Main\">\n  <UnderlineNav.Link href=\"#home\" selected>\n    Home\n  </UnderlineNav.Link>\n  <UnderlineNav.Link href=\"#documentation\">Documentation</UnderlineNav.Link>\n  <UnderlineNav.Link href=\"#support\">Support</UnderlineNav.Link>\n</UnderlineNav>\n```\n\n## Component props\n\n### UnderlineNav\n\n| Name       | Type              | Default | Description                                                                            |\n| :--------- | :---------------- | :-----: | :------------------------------------------------------------------------------------- |\n| actions    | Node              |         | Place another element, such as a button, to the opposite side of the navigation items. |\n| align      | String            |         | Use `right` to have navigation items aligned right.                                    |\n| full       | Boolean           |         | Used to make navigation fill the width of the container.                               |\n| aria-label | String            |         | Used to set the `aria-label` on the top level `<nav>` element.                         |\n| sx         | SystemStyleObject |   {}    | Style to be applied to the component                                                   |\n\n### UnderlineNav.Link\n\n| Name     | Type              | Default | Description                                      |\n| :------- | :---------------- | :-----: | :----------------------------------------------- |\n| as       | String            |         | sets the HTML tag for the component              |\n| href     | String            |         | URL to be used for the Link                      |\n| selected | Boolean           |         | Used to style the link as selected or unselected |\n| sx       | SystemStyleObject |   {}    | Style to be applied to the component             |\n","parent":{"relativeDirectory":"","name":"UnderlineNav"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/anchoredPosition.mdx","frontmatter":{"title":"Anchored Position Behavior"},"rawBody":"---\ntitle: Anchored Position Behavior\n---\n\nThe `getAnchoredPosition` behavior and `useAnchoredPosition` hook are used to calculate the position of a \"floating\" element that is anchored to another DOM element. This is useful for implementing overlay UI, such as dialogs, popovers, tooltips, toasts, and dropdown-style menus.\n\nAt a high level, the `getAnchoredPosition` algorithm will attempt to find the most suitable position for the floating element based on the passed-in settings, its containing element, and the size and position of the anchor element. Specifically, the calculated position should try to ensure that the floating element, when positioned at the calculated coordinates, does not overflow or underflow the container's bounding box.\n\nSettings for this behavior allow the user to customize several aspects of this calculation. See **PositionSettings** below for a detailed description of these settings.\n\n### Positioning algorithm\n\nWhen calculating the position of the floating element, the algorithm relies on different measurements from three separate elements:\n\n1. The floating element's width and height\n2. The anchor element's x/y position and its width and height\n3. The floating element's clipping container (for x/y position, width and height, and border sizes)\n\nThe public API only asks for the first two elements; the floating element's container is discovered via DOM traversal.\n\n#### Finding the floating element's clipping container\n\nThe returned anchored position calculation is relative to the floating element's closest [_positioned_](https://developer.mozilla.org/en-US/docs/Web/CSS/position#types_of_positioning) ancestor. To find this ancestor, we try to check parents of the floating element until we find one that has a position set to anything other than `static` and use that element's bounding box as the container. If we can't find such an element, we will try to use `document.body`.\n\nOnce we have found the appropriate relative ancestor, we attempt to find the floating element's _clipping container_. The clipping container is an element that: 1) has `overflow` set to something other than `visible`, and 2) is either an ancestor of the relative ancestor, or is itself the relative ancestor. Again, if we cannot locate such an element, we will use `document.body` as the clipping container.\n\nOnce we have the clipping container, its bounding box is used as the viewport for the position calculation (see the next section). If the clipping container ends up being `document.body`, we take one additional step, allowing the clipping rectangle to be at least as tall as the window. This is done because the `body` element doesn't take up the full window size by default, but we still want to allow the entire space to be used as the viewport for the position calculation. It may be a good idea to ensure that this clipping container element _also_ contains the anchor element and is scrollable. This will ensure that if scrolled, the anchor and floating element will move together.\n\n#### Positioning and overflow\n\nWith the positions and sizes of the above DOM elements, the algorithm calculates the (x, y) coordinate for the floating element. Then, it checks to see if, based on the floating element's size, if it would overflow the bounds of the container. If it would, it does one of two things:\n\nA) If the overflow happens in the same direction as the anchor side (e.g. side is `'outside-bottom'` and the overflowing portion of the floating element is the bottom), try to find a different side, recalculate the position, and check for overflow again. If we check all four sides and don't find one that fits, revert to the bottom side, in hopes that a scrollbar might appear.\nB) Otherwise, adjust the alignment offset so that the floating element can stay inside the container's bounds.\n\nFor a more in-depth explanation of the positioning settings, see `PositionSettings` below.\n\n### Demo\n\nDeploy Storybook to see a live demo of `anchoredPosition`.\n\n### Usage\n\n```ts\nconst settings = {\n  side: 'outside-right',\n  align: 'center',\n  alignmentOffset: 10,\n  anchorOffset: -10\n} as Partial<PositionSettings>\nconst float = document.getElementById('floatingElement')\nconst anchor = document.getElementById('anchorElement')\nconst {top, left} = getAnchoredPosition(float, anchor, settings)\nfloat.style.top = `${top}px`\nfloat.style.left = `${left}px`\n```\n\n### API\n\nThe `getAnchoredPosition` function takes the following arguments.\n\n| Name            | Type               | Default | Description                                                                                                                                                                            |\n| :-------------- | :----------------- | :-----: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| floatingElement | `Element`          |         | This is an Element that is currently rendered on the page. `getAnchoredPosition` needs to be able to measure this element's `width` and `height`.                                      |\n| anchorElement   | `Element`          |         | This is an Element that the floating element will be \"anchored\" to. In other words, the calculated position of the floating element will be based on this element's position and size. |\n| settings        | `PositionSettings` |  `{}`   | Settings to customize the positioning algorithm. See below for a description of each setting.                                                                                          |\n\n#### PositionSettings interface\n\n`PositionSettings` is an object with the following interface\n\n| Name             | Type              |      Default       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n| :--------------- | :---------------- | :----------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| side             | `AnchorSide`      | `\"outside-bottom\"` | Sets the side of the anchor element that the floating element should be pinned to. This side is given by a string starting with either `inside` or `outside`, followed by a hyphen, followed by either `top`, `right`, `bottom`, or `left`. Additionally, `\"inside-center\"` is an allowed value.<br /><br />The first part of this string, `inside` or `outside`, determines whether the floating element should be attempted to be placed \"inside\" the anchor element or \"outside\" of it. Using `inside` is useful for making it appear that the anchor _contains_ the floating element, and it can be used for implementing a dialog that is centered on the screen. The `outside` value is more common and can be used for tooltips, popovers, menus, etc.<br /><br />The second part of this string determines the _edge_ on the anchor element that the floating element will be anchored to. If side is `\"inside-center\"`, then the floating element will be centered in the X-direction (while `align` is used to position it in the Y-direction). |\n| align            | `AnchorAlignment` |     `\"start\"`      | Determines how the floating element should align with the anchor element. If set to `\"start\"`, the floating element's first edge (top or left) will align with the anchor element's first edge. If set to `\"center\"`, the floating element will be centered along the axis of the anchor edge. If set to `\"end\"`, the floating element's last edge will align with the anchor element's last edge.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |\n| anchorOffset     | `number`          |       `4`\\*        | The number of pixels between the anchor edge and the floating element. Positive values move the floating element farther from the anchor element (for outside positioning) or further inside the anchor element (for inside positioning). Negative values have the opposite effect.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |\n| alignmentOffset  | `number`          |      `4`\\*\\*       | An additional offset, in pixels, to move the floating element from the aligning edge. Positive values move the floating element in the direction of center-alignment. Negative values move the floating element away from center-alignment. When align is `\"center\"`, positive offsets move the floating element right (top or bottom anchor side) or down (left or right anchor side).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| allowOutOfBounds | `boolean`         |      `false`       | If false, when the above settings result in rendering the floating element wholly or partially off-screen, attempt to adjust the settings to prevent this. Only applies to `outside` positioning.<br /><br />First, attempt to flip to the opposite edge of the anchor if the floating element is getting clipped in that direction. If flipping results in a similar clipping, try moving to the adjacent sides.<br /><br />Once we find a side that does not clip the overlay in its own dimension, check the rest of the sides to see if we need to adjust the alignment offset to fit in other dimensions.<br /><br />If we try all four sides and get clipped each time, settle for overflowing and use the `bottom` side, since the ability to scroll is most likely in this direction.                                                                                                                                                                                                                                                             |\n\n\\* If `side` is set to `\"inside-center\"`, this defaults to `0` instead of `4`.\n\n\\*\\* If using outside positioning, or if `align` is set to `\"center\"`, this defaults to `0` instead of `4`.\n\n#### AnchorSide\n\n`AnchorSide` can be any of the following strings:\n\n`'inside-top'`, `'inside-bottom'`, `'inside-left'`, `'inside-right'`, `'inside-center'`, `'outside-top'`, `'outside-bottom'`, `'outside-left'`, `'outside-right'`\n\n#### AnchorAlignment\n\n`AnchorAlignment` can be any of the following strings:\n\n`'start'`, `'center'`, `'end'`\n\n### Best practices\n\nAs discussed above, the positioning algorithm needs to first measure the size of three different elements. Therefore, all three of these elements (anchor element, floating element, and the floating element's closest positioned container) must be rendered at the time `getAnchoredPosition` is called. To avoid a frame where the floating element is rendered at the `(0, 0)` position, give it a style of `visibility: hidden` until its position is returned at set. This allows the element to be measured without showing up on the page.\n\n### A note on performance\n\nEvery time `getAnchoredPosition` is called, it causes a [reflow](https://developers.google.com/speed/docs/insights/browser-reflow) because it needs to query the rendering engine for the positions of 3 elements: the anchor element, the floating element, and the closest ancestor of the floating element that is [_positioned_](https://developer.mozilla.org/en-US/docs/Web/CSS/position#types_of_positioning). Therefore, this function should not be called until it is needed (e.g. an overlay-style menu is invoked and displayed).\n\n## useAnchoredPosition hook\n\nThe `useAnchoredPosition` hook is used to provide anchored positioning data for React components. The hook returns refs that must be added to the anchor and floating elements, and a `position` object containing `top` and `left`. This position is tracked as state, so the component will re-render whenever it changes. It is the responsibility of the consumer to apply the top and left styles to the floating element in question.\n\n### Using your own refs\n\nThe `useAnchoredPosition` hook will return two refs for the anchor element and the floating element, which must be added to their respective JSX. If you would like to use your own refs, you can pass them into the hook as part of the settings object (see the interface below).\n\n### Recalculating position\n\nLike other hooks such as `useCallback` and `useEffect`, this hook takes a dependencies array. If defined, the position will only be recalculated when one of the dependencies in this array changes. Otherwise, the position will be calculated when the component is first mounted, but never again.\n\n### Usage\n\n```jsx\nexport const AnchoredPositionExample = () => {\n  const {floatingElementRef, anchorElementRef, position} = useAnchoredPosition({side: 'outside-bottom', align: 'center'})\n  return (\n    <div>\n      <Box\n        position=\"absolute\"\n        top={position?.top ?? 0}\n        left={position?.left ?? 0}\n        width={150}\n        height={150}\n        ref={floatingElementRef as React.RefObject<HTMLDivElement>}\n      >\n        Floating element\n      </Box>\n      <Box borderWidth='1px' borderStyle='solid' borderColor='border.default' borderRadius={2} width={400} height={75} ref={anchorElementRef as React.RefObject<HTMLDivElement>}>\n        Anchor Element\n      </Box>\n    </div>\n  )\n}\n```\n\n### useAnchoredPosition hook\n\n| Name         | Type                           |  Default  | Description                                                                                                          |\n| :----------- | :----------------------------- | :-------: | :------------------------------------------------------------------------------------------------------------------- |\n| settings     | `AnchoredPositionHookSettings` | undefined | Optional settings to control how the anchored position is calculated. See below.                                     |\n| dependencies | `React.DependencyList`         | undefined | Dependencies to determine when to re-calculate the position. If undefined or `[]`, only calculate the position once. |\n\n**Return value**\n\n| Name               | Type                          | Description                                        |\n| :----------------- | :---------------------------- | :------------------------------------------------- |\n| floatingElementRef | `React.RefObject<Element>`    | This ref must be added to the floating element JSX |\n| anchorElementRef   | `React.RefObject<Element>`    | This ref must be added to the anchor element JSX   |\n| position           | `{top: number, left: number}` | The calculated position                            |\n\n### AnchoredPositionHookSettings interface\n\n`AnchoredPositionHookSettings` is an object with an interface that extends `PositionSettings` (see above). Additionally, it adds the following properties:\n\n| Name               | Type                           |   Default   | Description                                                                                                                                                                                                                                                                                                                                 |\n| :----------------- | :----------------------------- | :---------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| floatingElementRef | `React.RefObject<HTMLElement>` | `undefined` | If provided, this will be the ref used to access the element that will be used for the floating element. Its size measurements are needed by the underlying `useAnchoredPosition` behavior. Otherwise, this hook will create the ref for you and return it. In both cases, the ref must be provided to the floating element's JSX.          |\n| anchorElementRef   | `React.RefObject<HTMLElement>` | `undefined` | If provided, this will be the ref used to access the element that will be used for the anchor element. Its position and size measurements are needed by the underlying `useAnchoredPosition` behavior. Otherwise, this hook will create the ref for you and return it. In both cases, the ref must be provided to the anchor element's JSX. |\n","parent":{"relativeDirectory":"","name":"anchoredPosition"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/core-concepts.md","frontmatter":{"title":"Core Concepts"},"rawBody":"---\ntitle: Core Concepts\n---\n\nThis document aims to discuss some of the core concepts of building with Primer React.\n\n## Responsive props\n\nIt's really easy to set different values for most of our component props based on screen size! We take advantage of [styled-system](https://github.com/styled-system/styled-system)'s responsive props API in our components.\n\n```\n<Button display={['flex', 'flex', 'none']}/>\n\nor\n\n<Text fontSize={[1,1,1,4]}/>\n```\n\n## Providing your own theme\n\nYou can provide your own theme to Primer React! There are a few ways of doing this to varying degrees, checkout the [theme docs](https://primer.style/components/primer-theme) for more information.\n\n## The `css` prop\n\nWhen push comes to shove and you just _really_ need to add a custom CSS rule, you can do that with the `css` prop. Please don't abuse this :)\n\n```\n<Box css='border-bottom-right-radius: 0px' />\n\n```\n\nPlease note that you will need to have the **[styled-components babel plugin](https://www.styled-components.com/docs/tooling#babel-plugin)** set up in your project in order to use the `css` prop.\n\n## Types of components\n\nWe categorize our components into 3 general types. Building block components, pattern components, and helper components. Understanding how these types of components interact with each other can help you better understand how to get the most out of Primer React.\n\n- Building Blocks\n\nBuilding block components are components that are basic in their functions and can be used together with other components to build just about any UI. Some examples of building block components are `Box`, `Avatar`, `Details`, and `Link`.\n\n- Pattern Components\n\nPattern components are components that are made up of several building block components to represent a commonly used pattern in our UI. Some examples of pattern components are `UnderlineNav` and `FilterList`. We plan on expanding our offering of pattern components in the near future.\n\n- Helper Components\n\nHelper components are components that help the user achieve common CSS patterns while maintaining some control over values used. An example of a helper component is `Box`.\n\n## The `as` prop\n\nThe `as` prop is a feature that all of our components get from [styled-components](https://www.styled-components.com). It allows you to pass a HTML tag or another component to a Primer Component to be rendered as the base tag of that component along with all of it's styles and props.\n\nFor example, say you are using a `Button` component, and you really need to apply `Box` styles to it. You can compose `Box` and `Button` like so:\n\n```.jsx\n<Box display=\"flex\" as={Button} href='https://github.com'>Hello</Box>\n```\n\nThis will allow you to use all of the `Button` props _and_ all of the `Box` props without having to wrap your `Button` component in another `Box` component.\n\n**This pattern does have some limitations.** Usage of the `as` prop can lead to unexpected output. In the example above, if the user had done `<Button as={Box}/>` instead, because the `Box`'s render method is ultimately applied, and `Box` components render `div`'s, you'll see that the rendered component is a `div` when ideally you'd like it to be a `button`. It is also not always clear how the styles in both components will interact and/or override each other.\n\nFor these reasons, **we recommend only using the `as` prop when you cannot achieve the same result by nesting components.** The `Box` / `Button` example could be done like so:\n\n```.jsx\n<Box display=\"flex\">\n  <Button href='https://github.com'>Hi</Button>\n</Box>\n```\n","parent":{"relativeDirectory":"","name":"core-concepts"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/focusTrap.mdx","frontmatter":{"title":"Focus Trap Behavior"},"rawBody":"---\ntitle: Focus Trap Behavior\n---\n\nThe `focusTrap` behavior and `useFocusTrap` hook are used prevent focus from leaving a particular element. This is useful for implementing modal dialogs: only the content within the dialog should be interactive, even though the UI underneath may still be visible.\n\n### Behavior\n\n- Activation: As soon as the focus trap is activated, it will ensure that an element within the container has focus. If it doesn't, it will focus the first focusable element within the container, or, if provided, the element indicated by the `initialFocus` parameter (see API below).\n- External focus changes: If an external cause (e.g. mouse click, scripts, or accessibility software) results in an element outside the container to be focused, focus will immediately be redirected to the last-focused element that is inside the container.\n- Circular tab focus: Using the `TAB` key on the last focusable element within the container will result in the first focusable element within the container receiving focus. Similarly, `Shift+TAB` can be used to focus the last element from the first.\n- Global: Only one focus trap can be _active_ at a time. When a focus trap is enabled, if there is already an active focus trap, it becomes suspended and pushed onto a stack. Once the newly-active focus trap is disabled, the most recently-suspended trap will reactivate. Suspended focus traps can be disabled, causing them to be removed from the stack of suspended traps.\n\n### Demo\n\nTo see a demo, deploy Storybook and find the `useFocusTrap` stories.\n\n### Usage\n\n```ts\nfunction showDialog() {\n  const dialog = document.getElementById('myDialog')\n  if (dialog instanceof HTMLElement) {\n    dialog.style.display = ''\n    return focusTrap(dialog)\n  }\n}\nfunction hideDialog(controller: AbortController) {\n  document.getElementById('myDialog')?.style.display = 'none'\n  controller.abort()\n}\nconst dialogController = showDialog()\n\n// later\nif (dialogController) {\n  hideDialog(controller)\n}\n```\n\n### API\n\nThe `focusTrap` function takes the following arguments.\n\n| Name         | Type           |   Default   | Description                                                                                                                                                  |\n| :----------- | :------------- | :---------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| container    | `HTMLElement`  |             | When active, only elements within this container (along with the container itself) can be focused.                                                           |\n| initialFocus | `HTMLElement`  |             | Specifies the element which will receive focus when the focus trap is activated. Defaults to the first tabbable element inside the container.                |\n| signal       | `AbortSignal?` | `undefined` | Optional abort signal to control the focus trap. If one is not provided, an `AbortController` will be returned, which can be used to disable the focus trap. |\n\n#### Return value\n\nIf the `signal` argument is omitted, `focusTrap()` will return an `AbortController`. This object has an `abort()` method, which can be called to disable the focus trap.\n\n### Best practices\n\n- Focus management is an important consideration for accessible applications. Sometimes poor focus management can make certain tasks impossible to complete for users not using a mouse. To learn more, read the [ARIA guidelines for keyboard focus](https://www.w3.org/TR/wai-aria-practices/#kbd_focus_discernable_predictable).\n- Only activate a focus trap if all UI outside of the trap container should be inert (non-interactive).\n- Avoid situations where multiple focus traps may be active (e.g. dialogs that open more dialogs). This behavior handles those situations, but the pattern may indicate poor UX.\n\n### A note on performance\n\nWhen focus trap is activated, it must perform [reflow](https://developers.google.com/speed/docs/insights/browser-reflow) to discover focusable elements. Use caution not to rapidly enable and disable focus traps.\n\n## useFocusTrap hook\n\nThe `useFocusTrap` hook is used to achieve focus trapping for React components. The hook returns a `ref` that must be applied to the focus trap container. The hook also returns a ref that can be used to indicate the initially-focused element when a focus trap is activated.\n\nThe focus trap can be disabled in two ways:\n\n1. Simply do not render the component. When a component that uses focus trapping is unmounted, its focus trap will be aborted automatically.\n2. Pass `disabled: true` to the settings argument of `useFocusTrap`.\n\nThe `useFocusTrap` hook also has an additional setting, `restoreFocusOnCleanUp`. If this is set to true, when the hook is either disabled (called with `disabled: true` or unmounted), we will attempt to re-focus the element that was focused immediately before the focus trap was enabled.\n\n### Using your own refs\n\nIf you would like to use your own refs, you can pass them into the hook as part of the settings object (see the interface below).\n\n### Usage\n\n```jsx\nexport const FocusTrapExample = () => {\n  const {containerRef} = useFocusTrap()\n  return (\n    <div ref={containerRef as React.RefObject<HTMLDivElement>}>\n      <Button>Apple</Button>\n      <Button>Banana</Button>\n      <Button>Cantaloupe</Button>\n    </div>\n  )\n}\n```\n\n### FocusTrapHookSettings interface\n\n`FocusTrapHookSettings` has the following properties:\n\n| Name                  | Type              |   Default   | Description                                                                                                                                                                                                                                                                  |\n| :-------------------- | :---------------- | :---------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| containerRef          | `React.RefObject` | `undefined` | If provided, this will be the ref used to access the focus trap container. Otherwise, this hook will create the ref for you and return it. In both cases, the ref must be provided to the container element's JSX.                                                           |\n| initialFocusRef       | `React.RefObject` | `undefined` | If provided, this will be the ref used to access the element that should receive initial focus when the focus trap is activated. Otherwise, this hook will create the ref for you and return it. If unused, the first tabbable element inside the container will be focused. |\n| disabled              | `boolean`         |   `false`   | If true, the previously-established focus trap for this container will be aborted.                                                                                                                                                                                           |\n| restoreFocusOnCleanUp | `boolean`         |   `false`   | If true, attempt to restore focus to the previously-focused element when the trap is disabled or unmounted.                                                                                                                                                                  |\n","parent":{"relativeDirectory":"","name":"focusTrap"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/focusZone.mdx","frontmatter":{"title":"Focus Zone Behavior"},"rawBody":"---\ntitle: Focus Zone Behavior\n---\n\nThe `focusZone` behavior and `useFocusZone` hook are used to designate a container where focus can be moved using keys other than `Tab`. This is useful for implementing many of the patterns described in [Section 6](https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard) of the WAI-ARIA Authoring Practices document. The most common use case of this behavior is to allow arrow keys (up and down or left and right) to move focus between related elements, such as items in a menu.\n\nAt a high level, the `focusZone` behavior works by adjusting the `tabindex` attribute on focusable elements and setting up event listeners on the container that respond to the relevant key presses.\n\nSettings for this behavior allow the user to customize several aspects of the focus zone. See **FocusZoneSettings** below for a detailed description of these settings.\n\n### Focusability: which elements participate in the Focus Zone?\n\nWhen the `focusZone` behavior is established, it will discover all _focusable_ elements within the given container and allow them to be focused with the bound keys. _Focusable_ elements are those that either are normally focusable via the Tab key OR have a valid `tabindex` attribute (including `\"-1\"`). The easiest way to ensure an element participates in the focus zone is by applying the attribute `tabindex=\"-1\"`. If you need to prevent a focusable element from participating in the focus zone, you can provide a `focusableElementFilter`.\n\n### Focus order\n\nThe `focusZone` behavior uses the natural DOM ordering of elements to determine focus order. This means that a key that moves focus will either move to a \"next\" element or to a \"previous\" element. For example, the left arrow key and the up arrow key would both move focus to the previous element in the DOM order, while the right arrow key and the down arrow key would both move focus to the next element in the DOM order.\n\nFocus cannot be moved beyond the last element of the container (other than using the Tab key). The `focusOutBehavior` option can be used to allow focus to wrap around from last to first element (or vice-versa).\n\nFor a more customized focus movement behavior, the consumer has the ability to supply a custom callback that identifies the next element to focus.\n\n#### Entering the focus zone\n\nBy default, when focus enters a focus zone, the element that receives focus will be the most recently-focused element within that focus zone. If no element had previously been focused, or if that previously-focused element was removed, focus will revert to the first focusable element within the focus zone, regardless of the direction of focus movement.\n\nUsing the `focusInStrategy` option, you can change this behavior. Setting this option to `\"first\"` will simply cause the first focusable element in the container to be focused whenever focus enters the focus zone. Setting it to `\"closest\"` will cause either the first or last focusable element in the container to be focused depending on the direction of focus movement (for example, a shift+tab that brings focus to the container will cause the last focusable element to be focused, whereas a regular tab would cause the first focusable element to be focused). Otherwise, you may provide a callback to choose a custom element to receive initial focus. One scenario where this would be useful is if you wanted to focus an item that is \"selected\" in a list.\n\nFor more information on choosing the right focus in behavior, see [6.6 Keyboard Navigation Inside Components](https://www.w3.org/TR/wai-aria-practices-1.1/#kbd_general_within) from the ARIA Authoring Practices document.\n\n### Supported keys\n\nThe `focusZone` behavior supports different sets of keys for moving focus around. The `bindKeys` option is used to set which of the following keys can be used to move focus.\n\n| Key(s)          | Notes                                                                                                                                                                                                                   | Use case                                                                                                                                 |\n| :-------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------- |\n| ArrowVertical   | Prevents default behavior of scrolling where applicable                                                                                                                                                                 | Most focus zones with vertically-positioned elements                                                                                     |\n| ArrowHorizontal | Prevents default behavior of scrolling where applicable                                                                                                                                                                 | Most focus zones with horizontally-positioned elements                                                                                   |\n| HomeAndEnd      | Causes focus to jump to the first or last focusable item in the container. Does not move focus if the currently-focused element is a text box.                                                                          | Generally used with arrow keys                                                                                                           |\n| PageUpDown      | Works the same as the Home and End keys. Advisable only when supplying a custom callback that supports paging.                                                                                                          | In a long, scrollable list                                                                                                               |\n| Tab/Shift+Tab   | Unlike other keys, the Tab key will always allow movement outside of the focus zone (use the Focus Trap behavior to prevent this). Tab moves to the next item, Shift+Tab moves to the previous.                         | Bind Tab if you want to continue allowing tab to move focus between elements in your container rather than jumping out of the container. |\n| JK              | J moves focus to the next item, K moves to the previous. Does not move focus if the currently-focused element is a text box. [Originally from](https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys) the vi keybindings | Used in certain lists                                                                                                                    |\n| HL              | H moves focus to the previous item, L moves to the next. Does not move focus if the currently-focused element is a text box. [Originally from](https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys) the vi keybindings | Used in certain lists                                                                                                                    |\n| WS              | W moves focus to the previous item, S moves to the next. Does not move focus if the currently-focused element is a text box.                                                                                            | Any situation where it is more ergonomic for the left hand to perform this action, such as in a gaming context (rare)                    |\n| AD              | A moves focus to the previous item, D moves to the next. Does not move focus if the currently-focused element is a text box.                                                                                            | Any situation where it is more ergonomic for the left hand to perform this action, such as in a gaming context (rare)                    |\n\n### DOM Focus vs. Active Descendant\n\nThe `focusZone` behavior supports two modes of operation: DOM Focus and Active Descendant.\n\n- DOM Focus is the default mode and by far the most commonly needed. When a key is used to move focus, we call `.focus()` directly on the element to receive focus. This results in `document.activeElement` getting set to this new element, and it will receive any necessary styles via `:focus` and `:focus-within`.\n- Active Descendant mode does _not_ move DOM focus. Instead, focus remains on the _control_ element, and its `aria-activedescendant` attribute is set to the ID of the relevant element. Because there are no `:focus` styles applied and no `focus` events fired, you can supply an `onActiveDescendantChanged` callback to handle any necessary styles or other logic as the active descendant changes. For more information on the Active Descendant focus pattern, see [6.6.2 Managing Focus in Composites Using `aria-activedescendant`](https://www.w3.org/TR/wai-aria-practices-1.1/#kbd_focus_activedescendant) from the ARIA Authoring Practices document.\n\n### Demo\n\nDeploy Storybook to see live demos of `focusZone`.\n\n### Usage\n\n```ts\nconst settings = {\n  bindKeys: FocusKeys.ArrowVertical | FocusKeys.HomeAndEnd\n} as FocusZoneSettings\nconst focusZone = document.getElementById('focusZoneContainer')\nfocusZone(focusZone, settings)\n```\n\n### API\n\nThe `focusZone` function takes the following arguments.\n\n| Name      | Type                | Default | Description                                                                        |\n| :-------- | :------------------ | :-----: | :--------------------------------------------------------------------------------- |\n| container | `Element`           |         | The focus zone will apply to this container and all of its focusable descendants.  |\n| settings  | `FocusZoneSettings` |  `{}`   | Settings to customize the focus zone. See below for a description of each setting. |\n\n#### FocusZoneSettings interface\n\n`FocusZoneSettings` is an object with the following interface. All properties are optional and have default behaviors.\n\n| Name                      | Type                                          |                     Default                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| :------------------------ | :-------------------------------------------- | :----------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| bindKeys                  | `FocusKeys` (numeric enum)                    | `FocusKeys.ArrowVertical │ FocusKeys.HomeAndEnd` | Bit flags that identify keys that will move focus around the focus zone. Each available key either moves focus to the \"next\", \"previous\", \"start\", or \"end\" element, so it is best to only bind the keys that make sense to move focus in your UI. Use the `FocusKeys` object to discover supported keys (listed in the \"Supported keys\" section above). <br /><br />Use the bitwise \"OR\" operator (&#124;) to combine key types. For example, `FocusKeys.WASD │ FocusKeys.HJKL` represents all of W, A, S, D, H, J, K, and L.<br /><br />The default for this setting is `FocusKeys.ArrowVertical │ FocusKeys.HomeAndEnd`, unless `getNextFocusable` is provided, in which case `FocusKeys.ArrowAll │ FocusKeys.HomeAndEnd` is used as the default.                                                        |\n| focusOutBehavior          | `\"stop\" │ \"wrap\"`                             |                     `\"stop\"`                     | Choose the behavior applied in cases where focus is currently at either the first or last element of the container. `\"stop\"` - do nothing and keep focus where it was; `\"wrap\"` - wrap focus around to the first element from the last, or the last element from the first                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| focusInStrategy           | `\"first\" │ \"closest\" │ \"previous\" │ Function` |                   `\"previous\"`                   | This option allows customization of the behavior that determines which of the focusable elements should be focused when focus enters the container via the Tab key.<br /><br />When set to `\"first\"`, whenever focus enters the container via Tab, we will focus the first focusable element. When set to `\"previous\"`, the most recently focused element will be focused (fallback to first if there was no previous).<br /><br />The \"closest\" strategy works like \"first\", except either the first or the last element of the container will be focused, depending on the direction from which focus comes.<br /><br />If a function is provided, this function should return the `HTMLElement` intended to receive focus. This is useful if you want to focus the currently \"selected\" item or element. |\n| getNextFocusable          | `Function`                                    |                                                  | This is a callback used to customize the next element to focus when a bound key is pressed. The function takes 3 arguments: `direction` (`\"previous\"`, `\"next\"`, `\"start\"`, or `\"end\"`), `from` (Element or `undefined`), and `event` (KeyboardEvent). The function should return the next element to focus, or `undefined`. If `undefined` is returned, the regular algorithm to select the next element to focus will be used.                                                                                                                                                                                                                                                                                                                                                                            |\n| focusableElementFilter    | `Function`                                    |                                                  | This is a callback used to cull focusable elements from participating in the focus zone.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| abortSignal               | `AbortSignal`                                 |                                                  | If passed, the focus zone will be deactivated and all event listeners removed when this signal is aborted. If not passed, an `AbortSignal` will be returned by the `focusZone` function.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| activeDescendantControl   | `HTMLElement`                                 |                                                  | If `activeDescendantControl` is supplied, do not move focus or alter `tabindex` on any element. Instead, manage `aria-activedescendant` according to the [ARIA best practices guidelines](https://www.w3.org/TR/wai-aria-practices-1.1/#kbd_focus_activedescendant).<br /><br />The given `activeDescendantControl` will be given an `aria-controls` attribute that references the ID of the `container`. Additionally, it will be given an `aria-activedescendant` attribute that references the ID of the currently-active descendant.<br /><br />This element will retain DOM focus as arrow keys are pressed.                                                                                                                                                                                           |\n| onActiveDescendantChanged | `Function`                                    |                                                  | This function is called each time the active descendant changes (only applicable if `activeDescendantControl` is given). The function takes two arguments: `newActiveDescendant` and `previousActiveDescendant`, both `HTMLElement`, either of which can be undefined (e.g. when an element in the container first becomes active, or when the controlling element becomes unfocused).                                                                                                                                                                                                                                                                                                                                                                                                                      |\n\n### Best practices\n\nWe highly recommend reading [Section 6: Developing a Keyboard Interface](https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard) from the WAI-ARIA Authoring Practices document.\n\n## useFocusZone hook\n\nThe `useFocusZone` hook is used to provide focus zone behavior to React components. The hook returns a ref that must be added to the container element.\n\n### Using your own refs\n\nIf you would like to use your own refs, you can pass them into the hook as part of the settings object (see the interface below).\n\n### Hook dependencies\n\nLike other hooks such as `useCallback` and `useEffect`, this hook takes a dependencies array. If defined, the focus zone will be re-applied when a dependency changes (and the old one will be cleaned up).\n\n### Usage\n\n```jsx\nexport const FocusZoneExample = () => {\n  const {containerRef} = useFocusZone({bindKeys: FocusKeys.ArrowVertical | FocusKeys.HomeAndEnd})\n  return (\n    <div ref={containerRef}>\n      <button>First</button>\n      <button>Second</button>\n      <button>Third</button>\n    </div>\n  )\n}\n```\n\n### useFocusZone hook\n\n| Name         | Type                    |  Default  | Description                                                         |\n| :----------- | :---------------------- | :-------: | :------------------------------------------------------------------ |\n| settings     | `FocusZoneHookSettings` | undefined | Optional settings to control how the focus zone behaves. See below. |\n| dependencies | `React.DependencyList`  | undefined | Dependencies to determine when to initialize the focus zone.        |\n\n**Return value**\n\n| Name                       | Type                           | Description                                                                               |\n| :------------------------- | :----------------------------- | :---------------------------------------------------------------------------------------- |\n| containerRef               | `React.RefObject<HTMLElement>` | This ref must be added to the container's JSX.                                            |\n| activeDescendantControlRef | `React.RefObject<HTMLElement>` | If using active descendant focusing, this ref must be added to the control element's JSX. |\n\n### FocusZoneHookSettings interface\n\n`FocusZoneHookSettings` is an object with an interface that extends `FocusZoneSettings` (see above), however, the `activeDescendantControl` prop is omitted (instead see the `activeDescendantFocus` prop below). Additionally, it adds the following properties:\n\n| Name                  | Type                                     |   Default   | Description                                                                                                                                                                                                                                                                                                                                                   |\n| :-------------------- | :--------------------------------------- | :---------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| containerRef          | `React.RefObject`                        | `undefined` | If provided, this will be the ref used to access the element that will become the container of the focus zone. Otherwise, this hook will create the ref for you and return it. In both cases, the ref must be provided to the container's JSX.                                                                                                                |\n| activeDescendantFocus | `boolean │ React.RefObject<HTMLElement>` |   `false`   | If false, the focus zone will apply normal DOM focusing (see **DOM Focus vs. Active Descendant** above). If true, or if a ref is provided, the focus zone will use \"active descendant\" focusing. If a ref is applied, it will be used as the control element for active descendant focus. If `true` is given, a ref will be created and returned by the hook. |\n| disabled              | `boolean`                                |   `false`   | Set to true to disable the focus zone and clean up listeners. Can be re-enabled at any time.                                                                                                                                                                                                                                                                  |\n","parent":{"relativeDirectory":"","name":"focusZone"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/getting-started.md","frontmatter":{"title":"Getting started"},"rawBody":"---\ntitle: Getting started\n---\n\n## Installation\n\nTo get started using Primer React, install the package and its peer dependencies with your package manager of choice:\n\n```bash\n# with npm\nnpm install @primer/react react react-dom styled-components\n\n# with yarn\nyarn add @primer/react react react-dom styled-components\n```\n\nYou can now import Primer React from the main package module:\n\n```javascript\n// using import syntax\nimport {Box} from '@primer/react'\n```\n\n```javascript\n// using require syntax\nconst {Box} = require('@primer/react')\n```\n\n### Polyfills & Browser Support\n\nPrimer React supports the current versions of [Chrome](https://www.google.com/chrome/), [Firefox](http://www.mozilla.org/firefox/), [Safari](http://www.apple.com/safari/), and [Microsoft Edge](https://www.microsoft.com/en-us/windows/microsoft-edge), as well as the [Firefox Extended Support Release](https://www.mozilla.org/en-US/firefox/organizations/). This is in-line with [GitHub's Browser Support](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/supported-browsers).\n\nPrimer React does not transform code to support older ECMAScript versions, such as ES5, and it uses ECMAScript features such as `Object.assign`, as well as syntax features such as native classes and Object destructuring and spreading.\n\nEnvironments that Primer React is used in should have all the necessary polyfills to comply with the latest code standards, as Primer React will not ship with these. Additionally, as Primer React does not transform code to support older versions, it may be necessary for projects to transform this code if support for older browsers (such as Edge 18) is needed.\n\n### Minimizing bundle size\n\nModule bundlers that use ECMAScript modules (ESM) will automatically tree-shake Primer React, ensuring that no unused code is included in your final bundle. However, if you're not using ESM, you may be able to drastically reduce the size of your final bundle by importing components individually from the `lib` subfolder:\n\n```javascript\n// using import syntax\nimport Box from '@primer/react/lib/Box'\n```\n\n```javascript\n// using require syntax\nconst Box = require('@primer/react/lib/Box')\n```\n\nNote that the modules in the `lib` folder are CommonJS-style modules; if you're using ESM and a compatible module bundler, importing files individually from `lib` provides no benefit.\n\n### Peer dependencies\n\nPrimer React ships with a few libraries labeled as peer dependencies. These libraries are separated because they are commonly already installed in the host project and having multiple versions can introduce errors.\n\nPrimer React requires the following libraries to be installed along with it:\n\n- `styled-components` at version 4.0.0 or higher\n- `react` at versions 17.x or higher\n- `react-dom` at versions 17.x or higher\n\n## ThemeProvider\n\nFor Primer React to work correctly and accurately apply color schemes, you must add `ThemeProvider` to the root of your application:\n\n```jsx\nimport {ThemeProvider} from '@primer/react'\n\nfunction App() {\n  return (\n    <ThemeProvider>\n      <div>...</div>\n    </ThemeProvider>\n  )\n}\n```\n\nSee [Theming](/theming) for more details on advanced configuration, color modes, and overriding theme values.\n\n## BaseStyles\n\nIn order to set baseline color, font-family, and line-heights across your project, you will need to establish base Primer styles for your app by wrapping all of your Primer components in `<BaseStyles>` at the root of your app:\n\n```jsx\nimport {BaseStyles, Box, Heading} from '@primer/react'\n\nexport default () => (\n  <BaseStyles>\n    <Box m={4}>\n      <Heading sx={{mb: 2}}>Hello, world!</Heading>\n      <p>This will get Primer text styles.</p>\n    </Box>\n  </BaseStyles>\n)\n```\n\nThis will apply the same `color`, `font-family`, and `line-height` styles to the `<body>` as [Primer CSS's base styles](https://github.com/primer/css/blob/master/src/base/base.scss#L15-L20).\n\n## Static CSS rendering\n\nIf you're rendering React components both server- and client-side, we suggest following [styled-component's server-side rendering instructions](https://www.styled-components.com/docs/advanced#server-side-rendering) to avoid the flash of unstyled content for server-rendered components.\n\n## TypeScript\n\nPrimer React includes TypeScript support and ships with its own typings. You will still need to install type definitions for the peer dependencies if you import those in your own application code.\n\nOnce installed, you can import components and their prop type interfaces from the `@primer/react` package:\n\n```typescript\nimport {BorderBox, BorderBoxProps} from '@primer/react'\n```\n\n### Fixing \"Duplicate identifier 'FormData'\"\n\nEver since `@types/styled-components` version `4.1.19`, it has had a dependency on both `@types/react` and `@types/react-native`. Unfortunately, those declarations clash; for more information, see [issue 33311](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33311) and [issue 33015](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33015) in the DefinitelyTyped repo.\n\nYou may run into this conflict even if you're not importing anything from `react-native` or don't have it installed. This is because some package managers hoist packages to the top-level `node_modules` folder, and the TypeScript compiler automatically includes types from all folders in `node_modules/@types` by default.\n\nThe TypeScript compiler allows you to opt-out of this behavior [using the `typeRoots` and `types` configuration options](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types), and the best solution for this error — for now — seems to be to opt out the automatic inclusion of `node_modules/@types` and instead list the types you want to be included individually.\n\nIn your `tsconfig.json`, set the `types` array under the `compilerOptions` like so:\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\"node\", \"react\", \"styled-components\", \"jest\"]\n  }\n}\n```\n\nOf course, customize the array based on the `@types/` packages you have installed for your project.\n\n## Silencing warnings\n\nLike React, Primer React emits warnings to the JavaScript console under certain conditions, like using deprecated components or props. Similar to React, you can silence these warnings by setting the `NODE_ENV` environment variable to `production` during bundling.\n","parent":{"relativeDirectory":"","name":"getting-started"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/index.md","frontmatter":{"title":"Getting started"},"rawBody":"---\ntitle: Getting started\n---\n\nimport {HeroLayout} from '@primer/gatsby-theme-doctocat'\nexport default HeroLayout\n\n## Primer React\n\nPrimer React is a React implementation of GitHub's [Primer Design System](https://primer.style/) 🎉\n\n## Principles\n\n- Everything is a component.\n- Aim for total style encapsulation; don't rely on inheritance to provide default styles.\n- Build small building blocks with minimal props to keep complexity low.\n- Keep system constrained by only including props needed per component.\n- Favor wrapping or extending components for more complex operations.\n- Maintain design system consistency with utilities as props (for spacing, color, font-size, line-height, widths, and radii).\n\n## Getting started\n\nCheck out [our getting started guide](/getting-started) for everything you need to know about installing and using Primer React.\n\n## Local development\n\nTo run `@primer/react` locally when adding or updating components:\n\n1. Clone this repo: `git clone https://github.com/primer/react`\n2. Install dependencies: `npm install`\n3. Run the dev app: `npm start`\n\n> 👉 See [the contributing docs](https://github.com/primer/react/blob/main/contributor-docs/CONTRIBUTING.md) for more info on code style, testing, and coverage.\n","parent":{"relativeDirectory":"","name":"index"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/linting.md","frontmatter":{"title":"Linting"},"rawBody":"---\ntitle: Linting\ndescription: Primer React offers an ESLint plugin to enforce best practices and fix common problems. \n---\n\n<Note variant=\"warning\">\n\n`eslint-plugin-primer-react` is experimental. Please report issues in the [primer/react](https://github.com/primer/react) repository.\n\n</Note>\n\n## Installation\n\n1. Assuming you already have [ESLint](https://www.npmjs.com/package/eslint) and [Primer React](https://github.com/primer/react) installed, run:\n\n   ```shell\n   npm install --save-dev eslint-plugin-primer-react\n\n   # or\n   \n   yarn add --dev eslint-plugin-primer-react\n   ```\n\n2. In your [ESLint configuration file](https://eslint.org/docs/user-guide/configuring/configuration-files), extend the recommended Primer React ESLint config:\n\n   ```json\n   {\n     \"extends\": [\n       // ...\n       \"plugin:primer-react/recommended\"\n     ]\n   }\n   ```\n\nSee the [eslint-plugin-primer-react](https://github.com/primer/eslint-plugin-primer-react) repository for a list of included lint rules.\n","parent":{"relativeDirectory":"","name":"linting"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/overriding-styles.mdx","frontmatter":{"title":"Overriding styles with the sx prop"},"rawBody":"---\ntitle: Overriding styles with the sx prop\n---\n\nOur goal with Primer React is to hit the sweet spot between providing too little and too much styling flexibility; too little and the design system is too rigid, and too much and it becomes too difficult to maintain a consistent style. Our components are designed to cover common usage patterns, but sometimes a component just isn't _quite_ flexible enough to look the way you need it to look. For those cases, we provide the `sx` prop.\n\nThe `sx` prop allows ad-hoc styling that is still theme-aware. Declare the styles you want to apply in CamelCase object notation, and try to use theme values in appropriate CSS properties when possible. If you've passed a custom theme using `ThemeProvider` or a `theme` prop, the `sx` prop will honor the custom theme. For more information on theming in Primer React, check out [the Primer Theme documentation](/primer-theme).\n\n## When to use the `sx` prop\n\nThe `sx` prop provides a lot of power, which means it is an easy tool to abuse. To best make use of it, we recommend following these guidelines:\n\n- Use the `sx` prop for small stylistic changes to components. For more substantial changes, consider abstracting your style changes into your own wrapper component.\n- Avoid nesting and pseudo-selectors in `sx` prop values when possible.\n\n## Basic example\n\nThis example demonstrates applying a bottom border to `Heading`, a component that does not receive `BORDER` system props. The `borderBottomWidth` value comes from `theme.borderWidths` and `borderBottomColor` comes from `theme.colors`.\n\n```jsx live\n<>\n  <Heading pb={2}>Heading</Heading>\n\n  <Heading\n    pb={2}\n    sx={{\n      borderBottomWidth: 1,\n      borderBottomColor: 'border.default',\n      borderBottomStyle: 'solid'\n    }}\n  >\n    Heading with bottom border\n  </Heading>\n</>\n```\n\n## Responsive values\n\nJust like [values passed to system props](https://styled-system.com/responsive-styles), values in the `sx` prop can be provided as arrays to provide responsive styling.\n\n```jsx live\n<Box\n  borderWidth=\"1px\"\n  borderStyle=\"solid\"\n  borderColor=\"border.default\"\n  borderRadius={2}\n  p={2}\n  sx={{\n    bg: ['neutral.subtle', 'accent.subtle', 'success.subtle', 'attention.subtle', 'danger.subtle']\n  }}\n>\n  Responsive background color\n</Box>\n```\n\n## Nesting, pseudo-classes, and pseudo-elements\n\nThe `sx` prop also allows for declaring styles based on media queries, pseudo-classes, and pseudo-elements. This example, though contrived, demonstrates the ability:\n\n```jsx live\n<Box\n  sx={{\n    '> *': {\n      borderWidth: 1,\n      borderColor: 'border.default',\n      borderStyle: 'solid',\n      borderBottomWidth: 0,\n      padding: 2,\n      ':last-child': {\n        borderBottomWidth: 1\n      },\n      ':hover': {\n        bg: 'neutral.muted'\n      }\n    }\n  }}\n>\n  <Box>First</Box>\n  <Box>Second</Box>\n  <Box>Third</Box>\n</Box>\n```\n","parent":{"relativeDirectory":"","name":"overriding-styles"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/philosophy.md","frontmatter":{"title":"Primer React Philosophy"},"rawBody":"---\ntitle: Primer React Philosophy\n---\n\n## Presentational Components\n\nWe are focusing primarily on presentational components that help standardize common design patterns. Primer React components don't handle fetching and submitting data to/from APIs. If you would like to handle data in a Primer Component, feel free to create a wrapper around the Primer Component to do so.\n\n## Assume that people will break the rules, provide safe ways for them to do so\n\nWhile we aim to standardize design in Primer React, we also provide additional styling flexibility through the [`sx` prop](/overriding-styles). This enables small customizations to color and spacing, using values from the theme. Users also have the option to override the theme with a theme of their own.\n\n## Pattern Components vs Helper Components\n\nOur components can roughly be categorized into two different component types:\n\n- Pattern Components\n\nPattern components help us repeat commonly used UI patterns and interactions in order to maintain our brand and provide a great user experience. Some examples of pattern components are `Button`, `Avatar`, or `Label`.\n\n- Helper Components\n\nHelper components are components that help the user achieve common CSS patterns while maintaining some control over values used. An example of a helper component is `Box`.\n","parent":{"relativeDirectory":"","name":"philosophy"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/primer-theme.md","frontmatter":{"title":"Primer Theme"},"rawBody":"---\ntitle: Primer Theme\n---\n\nimport {theme} from '@primer/react'\n\nPrimer React components come with built-in access to our Primer theme. The [theme file](https://github.com/primer/react/blob/main/src/theme-preval.ts) contains an object which holds values for common variables such as color, fonts, box shadows, and more. Our theme file pulls many of its color and typography values from [primer-primitives](https://github.com/primer/primer-primitives).\n\nMany of our theme keys correspond to system props on our components. For example, if you'd like to set the max width on a `<Box>` set the `maxWidth` prop to `medium`: `<Box maxWidth='medium'>`\n\nIn the background, [styled-system](https://github.com/styled-system/styled-system) does the work of finding the `medium` value from `maxWidth` key in the theme file and applying the corresponding CSS.\n\nOur full theme can be found [here](https://github.com/primer/react/blob/main/src/theme-preval.js).\n\n### Custom Theming\n\nCustom theming is an optional way to override the Primer values that control color, spacing, typography, and other aspects of our components.\n\nThere are two ways to change the theme of Primer components:\n\n1. You can override the entire theme for an entire tree of components using the `<ThemeProvider>` from [styled-components]:\n\n   ```javascript\n   import {Box, Button, Text, theme as primer} from '@primer/react'\n   import {ThemeProvider} from 'styled-components'\n\n   // a theme with custom spacing and font sizes\n   const theme = {\n     ...primer,\n     space: [0, 8, 16, 32, 64],\n     fontSizes: [10, 12, 16, 24, 48]\n   }\n\n   // override\n   theme.colors.bodytext = '#111'\n\n   export default () => (\n     <ThemeProvider theme={theme}>\n       <Box color=\"bodytext\" p={4}>\n         <Text fontSize={4}>Hello, world!</Text>\n       </Box>\n     </ThemeProvider>\n   )\n   ```\n\n   **⚠️ Note: [styled-components]'s `<ThemeProvider>` only allows exactly one child.**\n\n2. You can merge the Primer theme with your custom theme using Object.assign:\n\n   ```javascript\n   import {ThemeProvider} from `styled-components`\n   import {theme} from '@primer/react'\n\n   const customTheme = {} // Theme overrides\n\n   const App = (props) => {\n     return (\n       <div>\n         <ThemeProvider theme={Object.assign({}, theme, customTheme)}> // matching keys in customTheme will override keys in the Primer theme\n           <div>your app here</div>\n         </ThemeProvider>\n       </div>\n     )\n   }\n   ```\n\n3. You can theme individual components by passing the `theme` prop directly:\n\n   ```javascript\n   import {Text} from '@primer/react'\n\n   const theme = {\n     colors: {\n       magenta: '#f0f'\n     }\n   }\n\n   export default () => (\n     <Text theme={theme} color=\"magenta\">\n       Hi, I'm magenta!\n     </Text>\n   )\n   ```\n\n   **☝️ This is an intentionally convoluted example, since you can use `<Text color='#f0f'>` out of the box.**\n\nRead the [styled-system docs](https://styled-system.com/#theming) for more information on theming in styled-system.\n\n[styled-components]: https://styled-components.com/\n","parent":{"relativeDirectory":"","name":"primer-theme"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/ssr.mdx","frontmatter":{"title":"Server-side rendering with Primer React"},"rawBody":"---\ntitle: Server-side rendering with Primer React\n---\n\n## SSR-safe ID generation\n\nSome Primer components generate their own DOM IDs. Those IDs must be isomorphic (so that server-side rendering and client-side rendering yield the same ID, avoiding hydration issues) and unique across the DOM. We use [@react-aria/ssr](https://react-spectrum.adobe.com/react-aria/ssr.html) to generate those IDs. In client-only rendering, this doesn't require any additional work. In SSR contexts, you must wrap your application with at least one `SSRProvider`:\n\n```\nimport {SSRProvider} from '@primer/react';\n\nfunction App() {\n  return (\n    <SSRProvider>\n      <MyApplication />\n    </SSRProvider>\n  )\n}\n```\n\n`SSRProvider` maintains the context necessary to ensure IDs are consistent. In cases where some parts of the react tree are rendered asynchronously, you should wrap an additional `SSRProvider` around the conditionally rendered elements:\n\n```\nfunction MyApplication() {\n  const [dataA] = useAsyncData('a');\n  const [dataB] = useAsyncData('b');\n\n  return (\n    <>\n      <SSRProvider>\n        {dataA && <MyComponentA data={dataA} />}\n      </SSRProvider>\n      <SSRProvider>\n        {dataB && <MyComponentB data={dataB} />}\n      </SSRProvider>\n    </>\n  )\n}\n```\n\nThis will ensure that the IDs are consistent for any sequencing of `dataA` and `dataB` being resolved.\n\nSee also [React Aria's server side rendering documentation](https://react-spectrum.adobe.com/react-aria/ssr.html).\n","parent":{"relativeDirectory":"","name":"ssr"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/status.mdx","frontmatter":{"title":"Component status"},"rawBody":"---\ntitle: Component status\ndescription: Check the current status of Primer React components\n---\n\nimport {ComponentStatuses} from '../src/component-statuses'\n\nSee the [component lifecycle](https://primer.style/contribute/component-lifecycle) for more information about each status.\n\n<ComponentStatuses />\n","parent":{"relativeDirectory":"","name":"status"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/system-props.mdx","frontmatter":{"title":"System Props"},"rawBody":"---\ntitle: System Props\n---\n\nimport {PropsList, COMMON, LAYOUT, BORDER, TYPOGRAPHY} from '../components'\n\n<Note variant=\"warning\">\n\nSystem props are deprecated in all components except [Box](/Box) and [Text](/Text). Please use the [`sx` prop](/overriding-styles) instead.\n\n</Note>\n\nPrimer React components utilize what we call \"system props\" to apply a standard set of props to each component. Using [styled-system](https://github.com/jxnblk/styled-system), groups of props are automatically applied to each component. Most components get the `COMMON` set of props which give the component access to color and space props (margin, padding, color and background color). These groups correspond to the `color` and `space` functions from `styled-system` which can be referenced in the styled system [table of style functions](https://github.com/jxnblk/styled-system/blob/master/docs/table.md#core).\n\nTo check which system props each component includes, check the documentation for that component.\n\n### The `as` prop\n\nAll Primer React components have access to the `as` prop, provided by [styled-components](https://www.styled-components.com/docs/api#as-polymorphic-prop). We use the `as` prop to render a component with the styles of the passed component in `as`, but with the system props of the base component.\n\nFor example, if you wanted to add some flex utilities to the `Text` component, you could do:\n\n```jsx live deprecated\n<Text as={Flex}>Hello!</Text>\n```\n\n### System Prop Categories\n\n| Category     | Included Props                        | styled-system docs                                                                                                                                                                                            |\n| ------------ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `COMMON`     | <PropsList systemProps={COMMON}/>     | [styled-system core docs](https://github.com/jxnblk/styled-system/blob/master/docs/table.md#core)                                                                                                             |\n| `TYPOGRAPHY` | <PropsList systemProps={TYPOGRAPHY}/> | [styled-system typography docs](https://github.com/jxnblk/styled-system/blob/master/docs/table.md#typography)                                                                                                 |\n| `BORDER`     | <PropsList systemProps={BORDER}/>     | [styled-system border docs](https://github.com/jxnblk/styled-system/blob/master/docs/table.md#border)                                                                                                         |\n| `LAYOUT`     | <PropsList systemProps={LAYOUT}/>     | [styled-system layout docs](https://github.com/jxnblk/styled-system/blob/master/docs/table.md#layout) <br/> [styled-system misc docs](https://github.com/jxnblk/styled-system/blob/master/docs/table.md#misc) |\n","parent":{"relativeDirectory":"","name":"system-props"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/theme-reference.md","frontmatter":{"title":"Theme reference"},"rawBody":"---\ntitle: Theme reference\ndescription: The default theme object for Primer React components\n---\n\nimport {theme} from '@primer/react'\n\n<Note>\n\nSee [Theming](/theming) to learn how theming works in Primer React.\n\n</Note>\n\nColors in this theme object are imported from [Primer Primitives](https://primer.style/primitives/colors).\n\n<pre><code class=\"language-json\">{JSON.stringify(theme, null, 2)}</code></pre>\n","parent":{"relativeDirectory":"","name":"theme-reference"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/theming.md","frontmatter":{"title":"Theming"},"rawBody":"---\ntitle: Theming\ndescription: Theming in Primer React is made possible by a theme object that defines your application's colors, spacing, fonts, and more.\n---\n\nimport Code from '@primer/gatsby-theme-doctocat/src/components/code'\n\n## ThemeProvider\n\nTo give components access to the theme object, you must add `ThemeProvider` to the root of your application:\n\n```jsx\nimport {ThemeProvider} from '@primer/react'\n\nfunction App() {\n  return (\n    <ThemeProvider>\n      <div>...</div>\n    </ThemeProvider>\n  )\n}\n```\n\n`ThemeProvider` comes with a [default theme object](/theme-reference) that includes colors, spacing, fonts, etc. for building applications at GitHub.\n\n## Customizing the theme\n\nTo customize the [default theme](/theme-reference), you can pass your custom theme to `ThemeProvider` using the `theme` prop:\n\n```jsx\nimport {ThemeProvider, theme} from '@primer/react'\nimport deepmerge from 'deepmerge'\n\nconst customTheme = deepmerge(theme, {\n  fonts: {\n    mono: 'MonoLisa, monospace'\n  }\n})\n\nfunction App() {\n  return (\n    <ThemeProvider theme={customTheme}>\n      <div>...</div>\n    </ThemeProvider>\n  )\n}\n```\n\nSome components may break if your custom theme does not include all the same keys as the [default theme](/theme-reference). For that reason, we recommend extending the default theme using [deepmerge](https://www.npmjs.com/package/deepmerge).\n\n## Referencing theme values\n\nYou can reference theme values in your application using the [`sx` prop](/overriding-styles), the `themeGet` function, or the `useTheme` hook.\n\n<Note variant=\"warning\">\n\nOnly use `theme` objects accessed via Primer's theme context to ensure your application’s styling draws from the same theme as Primer components’ internal styling. The `sx` prop, styled system props, `themeGet`, and `useTheme` all use the theme from context.\n\n<DoDontContainer>\n  <Do>\n    <Code className=\"language-jsx\">\n      {`<Box textShadow=\"shadow.medium\">`}\n    </Code>\n    <Caption>Use the theme from the same context as Primer.</Caption>\n  </Do>\n  <Dont>\n    <Code className=\"language-jsx\">\n      {`import {theme} from '@primer/react'\\n\\n<Box textShadow={theme.shadows.shadow.medium}>`}\n    </Code>\n    <Caption>Don't style components with any other instance of theme</Caption>\n  </Dont>\n</DoDontContainer>\n\n</Note>\n\n### System props and the `sx` prop\n\nSome [system props](/system-props) and [`sx` prop](/overriding-styles) keys are theme-aware. For example, the `bg` prop maps to the `colors` theme key which means you can use the `bg` prop to reference values in the `colors` object:\n\n```jsx\nconst theme = {\n  colors: {\n    canvas: {\n      default: '#fff'\n    }\n  }\n}\n\nfunction App() {\n  return (\n    <ThemeProvider theme={theme}>\n      <Box bg=\"canvas.default\"></Box>\n      <Box sx={{bg: 'canvas.default'}}></Box>\n    </ThemeProvider>\n  )\n}\n```\n\nSee the [Styled System Reference Table](https://styled-system.com/table) for a complete list of mappings.\n\n### themeGet\n\nThe `themeGet` function is a convenient way to reference theme values in styled-components template literals:\n\n```js\nimport {themeGet} from '@primer/react'\nimport styled from 'styled-components'\n\nconst Example = styled.div`\n  background-color: ${themeGet('colors.canvas.default')};\n`\n```\n\n### useTheme\n\nYou can use the `useTheme` hook to reference theme values from inside any function component nested under the `ThemeProvider`:\n\n```js\nimport {ThemeProvider, useTheme} from '@primer/react'\n\nfunction Example() {\n  const {theme} = useTheme()\n  // theme.colors.canvas.default\n}\n\nfunction App() {\n  return (\n    <ThemeProvider>\n      <Example />\n    </ThemeProvider>\n  )\n}\n```\n\n<Note variant=\"warning\">\n\nOnly use `useTheme` to reference theme values in places where it's not possible to use system props, the `sx` prop, or `themeGet`.\n\n</Note>\n\n## Color modes and color schemes\n\nThe terms \"color mode\" and \"color scheme\" are often used interchangeably. However, in Primer React, they are two separate (but related) concepts.\n\nThe \"color mode\" of an application can be either `day`, `night`, or `auto` (i.e. synced with the operating system).\n\nA \"color scheme\", on the other hand, is a collection of colors that can be associated with a color mode. The [default theme](/theme-reference) includes three color schemes: `light`, `dark`, and `dark_dimmed`. By default, the `light` scheme is displayed when the application is in `day` mode and the `dark` scheme is displayed in `night` mode.\n\n### Setting the color mode\n\nBy default, Primer React is in `day` mode. To change the color mode, use the `colorMode` prop on `ThemeProvider` or the `setColorMode` function from the `useTheme` hook:\n\n#### `colorMode` prop\n\n```jsx\nimport {ThemeProvider} from '@primer/react'\n\nfunction App() {\n  return (\n    // colorMode can be \"day\" (default), \"night\", or \"auto\"\n    <ThemeProvider colorMode=\"auto\">\n      <div>...</div>\n    </ThemeProvider>\n  )\n}\n```\n\n#### `setColorMode` function\n\n```jsx\nimport {useTheme} from '@primer/react'\n\nfunction Example() {\n  const {setColorMode} = useTheme()\n  return <button onClick={() => setColorMode('auto')}>Activate auto mode</button>\n}\n```\n\n#### `preventSSRMismatch` prop\n\nIf you are doing server-side rendering, pass the `preventSSRMismatch` prop to ensure the rendered output from the server and browser match even when they resolve \"auto\" color mode differently.\n\n```jsx\n<ThemeProvider colorMode=\"auto\" preventSSRMismatch>\n  ...\n</ThemeProvider>\n```\n\n### Setting color schemes\n\nTo choose which color schemes will be displayed in `day` and `night` mode, use the `dayScheme` and `nightScheme` props on `ThemeProvider` or the `setDayScheme` and `setNightScheme` functions from the `useTheme` hook:\n\n#### `dayScheme` and `nightScheme` props\n\n```jsx\nimport {ThemeProvider} from '@primer/react'\n\nfunction App() {\n  return (\n    // The default theme includes `light`, `dark`, and `dark_dimmed` schemes\n    <ThemeProvider dayScheme=\"light\" nightScheme=\"dark_dimmed\">\n      <div>...</div>\n    </ThemeProvider>\n  )\n}\n```\n\n#### `setDayScheme` and `setNightScheme` functions\n\n```jsx\nimport {useTheme} from '@primer/react'\n\nfunction Example() {\n  const {setDayScheme, setNightScheme} = useTheme()\n  return <button onClick={() => setNightScheme('auto')}>Activate auto mode</button>\n}\n```\n\n### Customizing or adding color schemes\n\nTo customize or add color schemes, update the `colorSchemes` object in the theme:\n\n```jsx\nimport {ThemeProvider, theme} from '@primer/react'\nimport deepmerge from 'deepmerge'\n\nconst customTheme = deepmerge(theme, {\n  colorSchemes: {\n    // Customize an existing scheme\n    light: {\n      colors: {\n        text: {\n          primary: '#f00'\n        }\n      }\n    },\n    // Add a new scheme\n    my_scheme_name: {\n      colors: {},\n      shadows: {}\n    }\n  }\n})\n\nfunction App() {\n  return (\n    <ThemeProvider theme={customTheme}>\n      <div>...</div>\n    </ThemeProvider>\n  )\n}\n```\n\n### Creating local color scheme variables\n\nIf you need to use a color that is not defined in the theme, avoid hard coding the color value like this:\n\n```jsx\nfunction Example() {\n  return (\n    // BAD: #aaa may not look good in all color schemes\n    <Box bg=\"#aaa\">Hello world</Box>\n  )\n}\n```\n\nInstead, use the `useColorSchemeVar` hook to create a local variable that will update based on the active color scheme:\n\n```jsx\nimport {useColorSchemeVar} from '@primer/react'\nimport {colors} from '@primer/primitives'\n\nfunction Example() {\n  // GOOD: The value of `customBg` changes based on the active color scheme\n  const customBg = useColorSchemeVar({\n    light: colors.light.scale.gray[1],\n    dark: colors.dark.scale.gray[9],\n    dark_dimmed: colors.dark_dimmed.scale.gray[2]\n  })\n  return <Box bg={customBg}>Hello world</Box>\n}\n```\n","parent":{"relativeDirectory":"","name":"theming"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/useOnEscapePress.mdx","frontmatter":{"title":"useOnEscapePress"},"rawBody":"---\ntitle: useOnEscapePress\n---\n\n`useOnEscapePress` is a simple utility Hook that calls a user-provided function when the `Escape` key is pressed. The hook sets up `keydown` event listener on `window.document` and executes the user-provided function if these conditions are met:\n\n1. The Escape key was pressed\n2. The `preventDefault` method has not yet been called on the event object.\n\nFurthermore, unlike the normal behavior for multiple event listeners existing on the same DOM Node, if multiple `useOnEscapePress` hooks are active simultaneously, the callbacks will occur in reverse order. In other words, if a parent component and a child component both call `useOnEscapePress`, when the user presses Escape, the child component's callback will execute, followed by the parent's callback. Each callback has the chance to call `.preventDefault()` on the event to prevent further callbacks.\n\n### Dependencies\n\nSimilar to `useCallback`, `useOnEscapePress` takes a `React.DependencyList` as its second argument. These are the dependencies used to memoize the callback. Failing to provide the correct dependency list can result in degraded performance. If this argument is omitted, we will assume that the callback is already memoized. In the example below, that memoization occurs in `DemoComponent` with a call to `React.useCallback`, so `OverlayDemo` does not need to pass a dependency list.\n\n### Usage\n\n```javascript live noinline\nconst OverlayDemo = ({onEscape, children}) => {\n  useOnEscapePress(onEscape)\n  return (\n    <Box height=\"200px\">\n      {children}\n    </Box>\n  )\n}\n\nfunction DemoComponent() {\n  const [isOpen, setIsOpen] = React.useState(false)\n  const toggleOverlay = React.useCallback(() => {\n    setIsOpen(isOpen => !isOpen)\n  }, [])\n  const closeOverlay = React.useCallback(() => {\n    setIsOpen(false)\n  }, [])\n  return (\n    <>\n      <Button onClick={toggleOverlay}>toggle</Button>\n      {isOpen &&\n        <OverlayDemo onEscape={closeOverlay}>\n          <Button>Button One</Button>\n          <Button>Button Two</Button>\n        </OverlayDemo>}\n    </>\n  )\n}\n\nrender(<DemoComponent/>)\n```\n\n#### useOnEscapePress\n\n| Name | Type | Default | Description |\n| :- | :- | :-: | :- |\n| onEscape | `(event: KeyboardEvent) => void` | | Function to call when user presses the Escape key |\n| callbackDependencies | `React.DependencyList` | | Array of dependencies for memoizing the given callback |\n","parent":{"relativeDirectory":"","name":"useOnEscapePress"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/useOnOutsideClick.mdx","frontmatter":{"title":"useOnOutsideClick"},"rawBody":"---\ntitle: useOnOutsideClick\n---\n\n`useOnOutsideClick` is a utility Hook that calls a user provided callback function when the user clicks outside of the provided container.\n\nYou can also pass an array of `ignoredRefs` to prevent calling the callback function on additional elements on the page. This can be handy for ignoring clicks on trigger buttons that already manage the open/closed state of content.\n\n### Usage\n\n```jsx live\n<State>\n  {([isOpen, setIsOpen]) => {\n    const containerRef = React.useRef(null)\n    const triggerRef = React.useRef(null)\n\n    const closeOverlay = React.useCallback(() => {\n      setIsOpen(false)\n    }, [setIsOpen])\n\n    const toggleOverlay = React.useCallback(() => {\n      setIsOpen(!isOpen)\n    }, [setIsOpen, isOpen])\n\n    useOnOutsideClick({onClickOutside: closeOverlay, containerRef, ignoreClickRefs: [triggerRef]})\n\n    return (\n      <>\n        <Button ref={triggerRef} onClick={toggleOverlay}>\n          toggle\n        </Button>\n        {isOpen && (\n          <Box\n            borderWidth=\"1px\"\n            borderStyle=\"solid\"\n            borderColor=\"border.default\"\n            borderRadius={2}\n            height=\"200px\"\n            bg=\"green.4\"\n            ref={containerRef}\n          >\n            content\n          </Box>\n        )}\n      </>\n    )\n  }}\n</State>\n```\n\n#### useOnOutsideClick settings\n\n| Name           | Type                              | Default | Description                                                                                                                     |\n| :------------- | :-------------------------------- | :-----: | :------------------------------------------------------------------------------------------------------------------------------ |\n| onOutsideClick | `function`                        |         | Function to call when user clicks outside of the container. Usually this manages the state of the visibility of the container. |\n| ignoredRefs    | `React.RefObject<HTMLElement> []` |         | Elements outside of the container to ignore clicks on.                                                                          |\n| containerRef   | `React.RefObject<HTMLElement>`    |         | Required. A ref for the containing element.                                                                                     |\n","parent":{"relativeDirectory":"","name":"useOnOutsideClick"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/useOpenAndCloseFocus.mdx","frontmatter":{"title":"useOpenAndCloseFocus"},"rawBody":"---\ntitle: useOpenAndCloseFocus\n---\n\n`useOpenAndCloseFocus` is a utility Hook that manages focusing an element when a component is first mounted, and returns focus to an element on the page when that component unmounts.\n\nIf no ref is passed to `initialFocusRef` , the hook focuses the first focusable element inside of the container.\n\n\n### Usage\n\n```javascript live noinline\nconst Overlay = ({returnFocusRef, initialFocusRef, children}) => {\n  const containerRef = React.useRef(null)\n  useOpenAndCloseFocus({containerRef, returnFocusRef, initialFocusRef})\n  return (\n    <Box height=\"200px\" ref={containerRef}>\n      {children}\n    </Box>\n  )\n}\n\nfunction Component() {\n  const returnFocusRef = React.useRef(null)\n  const initialFocusRef = React.useRef(null)\n  const [isOpen, setIsOpen] = React.useState(false)\n  return (\n    <Box sx={{'*': { ':focus' : { backgroundColor: 'red.5'}}}}>\n      <Button ref={returnFocusRef} onClick={() => setIsOpen(!isOpen)}>toggle</Button>\n      {isOpen &&\n        <Overlay returnFocusRef={returnFocusRef} initialFocusRef={initialFocusRef}>\n          <Button>Button One</Button>\n          <Button ref={initialFocusRef}>Button Two</Button>\n        </Overlay>}\n    </Box>\n  )\n}\n\nrender(<Component/>)\n```\n\n\n#### useOpenAndCloseFocus settings\n\n| Name | Type | Default | Description |\n| :- | :- | :-: | :- |\n| initialFocusRef | `React.RefObject<HTMLElement>` | | Optional. The element to focus when the container is mounted on the page. |\n| returnFocusRef | `React.RefObject<HTMLElement>` | | Required. The element to focus when the container is unmounted. |\n| containerRef | `React.RefObject<HTMLElement>` | | Required. A ref for the containing element. |\n","parent":{"relativeDirectory":"","name":"useOpenAndCloseFocus"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/useOverlay.mdx","frontmatter":{"title":"useOverlay"},"rawBody":"---\ntitle: useOverlay\n---\n\n`useOverlay` calls all of the relevant behavior Hooks that all `Overlay` components & composite components should have and returns a ref to be passed down to the overlay's container.\n\nThese behaviors include:\n\n- Correctly positioning the component based on the values provided to `positionSettings` and `positionDeps`.\n- Trapping focus\n- Calling a user provided function when the user presses `Escape`\n- Calling a user provided function when the user clicks outside of the container\n- Focusing the either a user provided element, or the first focusable element in the container when it is opened.\n- Returning focus to an element when container is closed\n\n**Note:** `useOverlay` and `Overlay` do not manage the open state of the overlay. We leave control of the open state up to the user. All behaviors are built with the assumption that the overlay will not be rendered on the page & fully unmounted when it is not visible. See the examples for details on how to conditionally render a component in JSX.\n\n### Usage\n\n```javascript live noinline\n\nconst DemoOverlay = ({onClickOutside, initialFocusRef, returnFocusRef, ignoreClickRefs, onEscape, ...rest}) => {\n    const overlayProps = useOverlay({returnFocusRef, onEscape, ignoreClickRefs, onClickOutside, initialFocusRef})\n    return <Box height=\"200px\" bg=\"green.4\" {...overlayProps} {...rest}/>\n}\n\nconst DemoComponent = () => {\n  const returnFocusRef = React.useRef(null)\n  const initialFocusRef = React.useRef(null)\n  const [isOpen, setIsOpen] = React.useState(false)\n  const closeOverlay = () => setIsOpen(false)\n  return (\n    <>\n      <Button ref={returnFocusRef} onClick={() => setIsOpen(!isOpen)}>toggle</Button>\n      {isOpen &&\n        <DemoOverlay\n          returnFocusRef={returnFocusRef}\n          ignoreClickRefs={[returnFocusRef]}\n          initialFocusRef={initialFocusRef}\n          onEscape={closeOverlay}\n          onClickOutside={closeOverlay}\n        >\n          <Button>Button One</Button>\n          <Button ref={initialFocusRef}>Button Two</Button>\n        </DemoOverlay>}\n    </>\n  )\n}\n\nrender(<DemoComponent/>)\n```\n\n\n#### UseOverlaySettings\n\n| Name | Type | Required | Description |\n| :- | :- | :-: | :- |\n| onEscapePress | `function` | required | Function to call when user presses the Escape key |\n| onOutsideClick | `function` | required | Function to call when user clicks outside of the overlay |\n| ignoreClickRefs | `React.RefObject<HTMLElement> []` | optional | Refs to click clicks on in the `onOutsideClick` function, useful for ignoring clicks on elements that trigger the overlay visibility. |\n| initialFocusRef | `React.RefObject<HTMLElement>` | optional | Ref to focus when overlay is mounted. |\n| returnFocusRef | `React.RefObject<HTMLElement>` | required | Ref to focus when overlay is unmounted. Important for accessibility. |","parent":{"relativeDirectory":"","name":"useOverlay"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/useSafeTimeout.mdx","frontmatter":{"title":"useSafeTimeout"},"rawBody":"---\ntitle: useSafeTimeout\n---\n\n`useSafeTimeout` is a utility Hook that allows you to safely call `setTimeout` and `clearTimeout` within a component, ensuring that all timeouts are cleared when the component unmounts.\n\n\n### Usage\n\n```jsx live\n<State>\n  {([]) => {\n    const {safeSetTimeout, safeClearTimeout} = useSafeTimeout()\n    let timeoutId = null\n\n    const handleOnClick = () => {\n      timeoutId = safeSetTimeout(() => window.alert('hello!'), 5000)\n    }\n\n    const cancelTimeout = () => {\n      safeClearTimeout(timeoutId)\n    }\n\n    return (\n      <>\n        <Button onClick={handleOnClick}>Click me</Button>\n        <Button onClick={cancelTimeout}>Cancel timeout</Button>\n      </>\n    )\n  }}\n</State>\n```\n","parent":{"relativeDirectory":"","name":"useSafeTimeout"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/ActionList.mdx","frontmatter":{"title":"ActionList (legacy)"},"rawBody":"---\ntitle: ActionList (legacy)\nstatus: Deprecated\nsource: https://github.com/primer/react/tree/main/src/deprecated/ActionList\n---\n\nAn `ActionList` is a list of items which can be activated or selected. `ActionList` is the base component for many of our menu-type components, including `DropdownMenu` and `ActionMenu`.\n\n## Deprecation\n\nUse [new version of ActionList](/ActionList) with composable API, design updates and accessibility fixes.\n\n**Before**\n\n```jsx\n<ActionList\n  items={[\n    {text: 'New file'},\n    {text: 'Copy link'},\n    {text: 'Edit file'},\n    ActionList.Divider,\n    {text: 'Delete file', variant: 'danger'}\n  ]}\n/>\n```\n\n**After**\n\n```jsx\n<ActionList>\n  <ActionList.Item>New file</ActionList.Item>\n  <ActionList.Item>Copy link</ActionList.Item>\n  <ActionList.Item>Edit file</ActionList.Item>\n  <ActionList.Divider />\n  <ActionList.Item variant=\"danger\">Delete file</ActionList.Item>\n</ActionList>\n```\n\nOr continue using deprecated API:\n\n```js\nimport {ActionList} from '@primer/react/deprecated'\n```\n\n## Minimal example\n\n```jsx live deprecated\n<ActionList\n  items={[\n    {text: 'New file'},\n    ActionList.Divider,\n    {text: 'Copy link'},\n    {text: 'Edit file'},\n    {text: 'Delete file', variant: 'danger'}\n  ]}\n/>\n```\n\n## Example with grouped items\n\n```jsx live deprecated\n<ActionList\n  groupMetadata={[\n    {groupId: '0'},\n    {groupId: '1', header: {title: 'Live query', variant: 'subtle'}},\n    {groupId: '2', header: {title: 'Layout', variant: 'subtle'}},\n    {groupId: '3'},\n    {groupId: '4'}\n  ]}\n  items={[\n    {key: '1', leadingVisual: TypographyIcon, text: 'Rename', groupId: '0', trailingVisual: '⌘R'},\n    {key: '2', leadingVisual: VersionsIcon, text: 'Duplicate', groupId: '0'},\n    {key: '3', leadingVisual: SearchIcon, text: 'repo:github/github', groupId: '1'},\n    {\n      key: '4',\n      leadingVisual: NoteIcon,\n      text: 'Table',\n      description: 'Information-dense table optimized for operations across teams',\n      descriptionVariant: 'block',\n      groupId: '2'\n    },\n    {\n      key: '5',\n      leadingVisual: ProjectIcon,\n      text: 'Board',\n      description: 'Kanban-style board focused on visual states',\n      descriptionVariant: 'block',\n      groupId: '2'\n    },\n    {\n      key: '6',\n      leadingVisual: FilterIcon,\n      text: 'Save sort and filters to current view',\n      disabled: true,\n      groupId: '3'\n    },\n    {key: '7', leadingVisual: FilterIcon, text: 'Save sort and filters to new view', groupId: '3'},\n    {key: '8', leadingVisual: GearIcon, text: 'View settings', groupId: '4', trailingVisual: ArrowRightIcon}\n  ]}\n/>\n```\n\n## Example with custom item renderer\n\n```jsx deprecated\n<ActionList\n  items={[\n    {\n      text: 'Vanilla link',\n      renderItem: props => <ActionList.Item as=\"a\" href=\"/about\" {...props} />\n    },\n    {\n      text: 'React Router link',\n      renderItem: props => <ActionList.Item as={ReactRouterLikeLink} to=\"/about\" {...props} />\n    },\n    {\n      text: 'NextJS style',\n      renderItem: props => (\n        <NextJSLikeLink href=\"/about\">\n          <ActionList.Item as=\"a\" {...props} />\n        </NextJSLikeLink>\n      )\n    }\n  ]}\n/>\n```\n\n## Props\n\n| Name             | Type                                                                                                                                              |      Default      | Description                                                                                                                                             |\n| :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| items            | `(ItemProps & Omit<React.ComponentPropsWithoutRef<'div'>, keyof ItemProps>) \\| ((Partial<ItemProps> & {renderItem: RenderItemFn}) & {key?: Key})` |    `undefined`    | Required. A list of item objects conforming to the `ActionList.Item` props interface.                                                                   |\n| renderItem       | `(props: ItemProps) => JSX.Element`                                                                                                               | `ActionList.Item` | Optional. If defined, each item in `items` will be passed to this function, allowing for `ActionList`-wide custom item rendering.                       |\n| groupMetadata    | `GroupProps[]`                                                                                                                                    |    `undefined`    | Optional. If defined, `ActionList` will group `items` into `ActionList.Group`s separated by `ActionList.Divider` according to their `groupId` property. |\n| showItemDividers | `boolean`                                                                                                                                         |      `false`      | Optional. If `true` dividers will be displayed above each `ActionList.Item` which does not follow an `ActionList.Header` or `ActionList.Divider`        |\n","parent":{"relativeDirectory":"deprecated","name":"ActionList"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/ActionMenu.mdx","frontmatter":{"title":"ActionMenu (legacy)"},"rawBody":"---\ntitle: ActionMenu (legacy)\nstatus: Deprecated\nsource: https://github.com/primer/react/tree/main/src/deprecated/ActionMenu.tsx\n---\n\nAn `ActionMenu` is an ActionList-based component for creating a menu of actions that expands through a trigger button.\n\n## Deprecation\n\nUse [new version of ActionMenu](/ActionMenu) with composable API, design updates and accessibility fixes.\n\n**Before**\n\n```jsx\n<ActionMenu\n  anchorContent=\"Menu\"\n  onAction={fn}\n  items={[\n    {text: 'New file'},\n    {text: 'Copy link'},\n    {text: 'Edit file'},\n    ActionMenu.Divider,\n    {text: 'Delete file', variant: 'danger'}\n  ]}\n  overlayProps={{width: 'small'}}\n/>\n```\n\n**After**\n\n```jsx\n<ActionMenu>\n  <ActionMenu.Button>Menu</ActionMenu.Button>\n  <ActionMenu.Overlay width=\"small\">\n    <ActionList>\n      <ActionList.Item onSelect={fn}>New file</ActionList.Item>\n      <ActionList.Item>Copy link</ActionList.Item>\n      <ActionList.Item>Edit file</ActionList.Item>\n      <ActionList.Divider />\n      <ActionList.Item variant=\"danger\">Delete file</ActionList.Item>\n    </ActionList>\n  </ActionMenu.Overlay>\n</ActionMenu>\n```\n\nOr continue using deprecated API:\n\n```js\nimport {ActionMenu} from '@primer/react/deprecated'\n```\n\n## Default example\n\n```jsx live deprecated\n<ActionMenu\n  anchorContent=\"Menu\"\n  onAction={({text}) => console.log(text)}\n  items={[\n    {text: 'New file', key: 'new-file'},\n    ActionMenu.Divider,\n    {text: 'Copy link', key: 'copy-link'},\n    {text: 'Edit file', key: 'edit-file'},\n    {text: 'Delete file', variant: 'danger', key: 'delete-file'}\n  ]}\n/>\n```\n\n## Example with grouped items\n\n```jsx live deprecated\n<ActionMenu\n  anchorContent=\"Menu\"\n  onAction={({text}) => console.log(text)}\n  groupMetadata={[\n    {groupId: '0'},\n    {groupId: '1', header: {title: 'Live query', variant: 'subtle'}},\n    {groupId: '2', header: {title: 'Layout', variant: 'subtle'}},\n    {groupId: '3'},\n    {groupId: '4'}\n  ]}\n  items={[\n    {key: '1', leadingVisual: TypographyIcon, text: 'Rename', groupId: '0'},\n    {key: '2', leadingVisual: VersionsIcon, text: 'Duplicate', groupId: '0'},\n    {key: '3', leadingVisual: SearchIcon, text: 'repo:github/github', groupId: '1'},\n    {\n      key: '4',\n      leadingVisual: NoteIcon,\n      text: 'Table',\n      description: 'Information-dense table optimized for operations across teams',\n      descriptionVariant: 'block',\n      groupId: '2'\n    },\n    {\n      key: '5',\n      leadingVisual: ProjectIcon,\n      text: 'Board',\n      description: 'Kanban-style board focused on visual states',\n      descriptionVariant: 'block',\n      groupId: '2'\n    },\n    {\n      key: '6',\n      leadingVisual: FilterIcon,\n      text: 'Save sort and filters to current view',\n      disabled: true,\n      groupId: '3'\n    },\n    {key: '7', leadingVisual: FilterIcon, text: 'Save sort and filters to new view', groupId: '3'},\n    {key: '8', leadingVisual: GearIcon, text: 'View settings', groupId: '4'}\n  ]}\n/>\n```\n\n## Component props\n\n| Name          | Type                                  |      Default      | Description                                                                                                                                                                                        |\n| :------------ | :------------------------------------ | :---------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| items         | `ItemProps[]`                         |    `undefined`    | Required. A list of item objects conforming to the `ActionList.Item` props interface.                                                                                                              |\n| renderItem    | `(props: ItemProps) => JSX.Element`   | `ActionList.Item` | Optional. If defined, each item in `items` will be passed to this function, allowing for `ActionList`-wide custom item rendering.                                                                  |\n| groupMetadata | `GroupProps[]`                        |    `undefined`    | Optional. If defined, `ActionList` will group `items` into `ActionList.Group`s separated by `ActionList.Divider` according to their `groupId` property.                                            |\n| renderAnchor  | `(props: ButtonProps) => JSX.Element` |     `Button`      | Optional. If defined, provided component will be used to render the menu anchor. Will receive the selected `Item` text as `children` prop when an item is activated.                               |\n| anchorContent | React.ReactNode                       |    `undefined`    | Optional. If defined, it will be passed to the trigger as the elements child.                                                                                                                      |\n| onAction      | (props: ItemProps) => void            |    `undefined`    | Optional. If defined, this function will be called when a menu item is activated either by a click or a keyboard press.                                                                            |\n| open          | boolean                               |    `undefined`    | Optional. If defined, ActionMenu will use this to control the open/closed state of the Overlay instead of controlling the state internally. Should be used in conjunction with the `setOpen` prop. |\n| setOpen       | (state: boolean) => void              |    `undefined`    | Optional. If defined, ActionMenu will use this to control the open/closed state of the Overlay instead of controlling the state internally. Should be used in conjunction with the `open` prop.    |\n","parent":{"relativeDirectory":"deprecated","name":"ActionMenu"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/BorderBox.md","frontmatter":{"title":"BorderBox"},"rawBody":"---\ntitle: BorderBox\nstatus: Deprecated\n---\n\nBorderBox is a Box component with a border. When no `borderColor` is present, the component defaults to a primary border.\n\n## Deprecation\n\nUse [Box](/Box) instead.\n\n**Before**\n\n```jsx deprecated\n<BorderBox>Item 1</BorderBox>\n```\n\n**After**\n\n```jsx deprecated\n<Box borderWidth=\"1px\" borderStyle=\"solid\" borderColor=\"border.default\" borderRadius={2}>\n  Item 1\n</Box>\n```\n\n## Default example\n\n```jsx live deprecated\n<BorderBox>This is a BorderBox</BorderBox>\n```\n\nNote that `BorderBox` has default props set for `borderWidth`, `borderStyle`, and `borderColor`. This means that you cannot use `border={0} borderBottom={1}` or similar patterns; instead, use individual properties like `borderWidth={0} borderBottomWidth={1}`.\n\n## System props\n\nBorderBox components get `COMMON`, `LAYOUT`, `BORDER`, and `FLEX` system props. Read our [System Props](/system-props) doc page for a full list of available props.\n\n## Component props\n\n| Prop name    | Type             |            Default            | Description                                                   |\n| :----------- | :--------------- | :---------------------------: | :------------------------------------------------------------ |\n| borderWidth  | String           |             '1px'             | Sets the border, use theme values or provide your own.        |\n| borderStyle  | String           |            'solid'            | Sets the border style, use theme values or provide your own.  |\n| borderColor  | String           | 'border.primary' (from theme) | Sets the border color, use theme values or provide your own.  |\n| borderRadius | String or Number |        2 (from theme)         | Sets the border radius, use theme values or provide your own. |\n| boxShadow    | String           |                               | Sets box shadow, use theme values or provide your own.        |\n","parent":{"relativeDirectory":"deprecated","name":"BorderBox"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/Buttons.mdx","frontmatter":{"title":"Button (legacy)"},"rawBody":"---\ntitle: Button (legacy)\nstatus: deprecated\nsource: https://github.com/primer/react/blob/main/src/Button\nstorybook: '/react/storybook?path=/story/composite-components-button--default-button'\n---\n\n## Deprecation\n\nUse [Button](/Button) instead.\n\nFor more info on the changes, have a look at the migration guide.\n[Button migration guide](/migration-guide/Button)\n\n`Button` is used for actions, like in forms, while `Link` is used for destinations, or moving from one page to another.\n\nIn special cases where you'd like to use a `<a>` styled like a Button, use `<Button as='a'>` and provide an `href`.\n\nTo create a button group, wrap `Button` elements in the `ButtonGroup` element. `ButtonGroup` gets the same props as `Box`.\n\n## Examples\n\n### Kitchen sink\n\n```jsx live deprecated\n<>\n  <Button>Button</Button>\n  <ButtonDanger>Button danger</ButtonDanger>\n  <ButtonOutline>Button outline</ButtonOutline>\n  <ButtonPrimary>Button primary</ButtonPrimary>\n  <ButtonInvisible>Button invisible</ButtonInvisible>\n  <ButtonClose onClick={() => window.alert('button clicked')} />\n\n  <ButtonGroup display=\"block\" my={2}>\n    <Button>Button</Button>\n    <Button>Button</Button>\n    <Button>Button</Button>\n  </ButtonGroup>\n\n  <ButtonTableList>Button table list </ButtonTableList>\n</>\n```\n\n## Props\n\nNative `<button>` HTML attributes are forwarded to the underlying React `button` component and are not listed below.\n\n<PropsTable>\n  <PropsTableRow name=\"as\" type=\"String\" defaultValue=\"button\" description=\"Sets the HTML tag for the component\" />\n  <PropsTableRow name=\"sx\" type=\"SystemStyleObject\" defaultValue=\"{}\" description=\"Additional styles\" />\n  <PropsTableRow\n    name=\"variant\"\n    type=\"String\"\n    defaultValue=\"'medium'\"\n    description=\"A value of `small`, `medium`, or `large` results in smaller or larger Button text size; no effect if `fontSize` prop is set\"\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: false,\n    usedInProduction: true,\n    usageExamplesDocumented: false,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: true,\n    hasFigmaComponent: true\n  }}\n/>\n","parent":{"relativeDirectory":"deprecated","name":"Buttons"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/ChoiceFieldset.mdx","frontmatter":{"title":"ChoiceFieldset"},"rawBody":"---\ntitle: ChoiceFieldset\nstatus: Deprecated\nsource: https://github.com/primer/react/blob/main/src/ChoiceFieldset/ChoiceFieldset.tsx\nstorybook: '/react/storybook/?path=/story/forms-choicefieldset--radio-group'\n---\n\nimport {ChoiceFieldset, Box} from '@primer/components'\nimport {CheckIcon, XIcon, AlertIcon} from '@primer/octicons-react'\n\nA `ChoiceFieldset` is a controlled component that is used to render a related set of checkbox or radio inputs.\n\n## Deprecation\n\nUse [CheckboxGroup](/CheckboxGroup) or [RadioGroup](/RadioGroup) instead.\n\n## Examples\n\n### Basic\n\n```jsx live deprecated\n<ChoiceFieldset>\n  <ChoiceFieldset.Legend>Color mode</ChoiceFieldset.Legend>\n  <ChoiceFieldset.List>\n    <ChoiceFieldset.Item value=\"dark\">Dark</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"hc-dark\">High-contrast dark</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"light\">Light</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"hc-light\">High-contrast light</ChoiceFieldset.Item>\n  </ChoiceFieldset.List>\n</ChoiceFieldset>\n```\n\n### Using an onSelect handler\n\n```javascript live noinline deprecated\nconst WithOnSelectHandler = () => {\n  const [selectedChoices, setSelectedChoices] = React.useState([])\n  const choices = [\n    {\n      value: 'figma',\n      displayName: 'Figma library',\n      description: 'The Figma file where we have Figma symbols and light documentation'\n    },\n    {\n      value: 'css',\n      displayName: 'Primer CSS',\n      description: 'The OG. A CSS library with utility styles and component styles'\n    },\n    {\n      value: 'react',\n      displayName: 'Primer React components',\n      description: 'The React component library that these docs belong to'\n    },\n    {\n      value: 'viewcomponents',\n      displayName: 'Primer ViewComponents',\n      description: 'The Rails and Web Components implementation of our components'\n    }\n  ]\n\n  return (\n    <>\n      <ChoiceFieldset\n        onSelect={selectedValues => {\n          setSelectedChoices(selectedValues)\n        }}\n        selected={selectedChoices}\n      >\n        <ChoiceFieldset.Legend>Prefered Primer component interface</ChoiceFieldset.Legend>\n        <ChoiceFieldset.Description>\n          Your choice won't be used for anything, this is just a React example\n        </ChoiceFieldset.Description>\n        <ChoiceFieldset.List>\n          {choices.map(choice => (\n            <ChoiceFieldset.Item value={choice.value} key={choice.value}>\n              <Item.Label>{choice.displayName}</Item.Label>\n              <Item.Caption>{choice.description}</Item.Caption>\n            </ChoiceFieldset.Item>\n          ))}\n        </ChoiceFieldset.List>\n      </ChoiceFieldset>\n      {selectedChoices.length ? (\n        <Box mt={2}>\n          <em>{choices.find(choice => choice.value === selectedChoices[0]).displayName}</em> is your favorite? Ours too.\n        </Box>\n      ) : null}\n    </>\n  )\n}\n\nrender(<WithOnSelectHandler />)\n```\n\n### Checkbox group\n\n```jsx live deprecated\n<ChoiceFieldset>\n  <ChoiceFieldset.Legend>Prefered Primer component interface</ChoiceFieldset.Legend>\n\n  <ChoiceFieldset.List selectionVariant=\"multiple\">\n    <ChoiceFieldset.Item value=\"figma\">Figma library</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"css\">Primer CSS</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"react\">Primer React components</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"viewcomponents\">Primer ViewComponents</ChoiceFieldset.Item>\n  </ChoiceFieldset.List>\n</ChoiceFieldset>\n```\n\n### Disabled\n\n```jsx live deprecated\n<ChoiceFieldset disabled>\n  <ChoiceFieldset.Legend>Color mode</ChoiceFieldset.Legend>\n  <ChoiceFieldset.List>\n    <ChoiceFieldset.Item value=\"dark\">Dark</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"hc-dark\">High-contrast dark</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"light\">Light</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"hc-light\">High-contrast light</ChoiceFieldset.Item>\n  </ChoiceFieldset.List>\n</ChoiceFieldset>\n```\n\n### Required\n\n```jsx live deprecated\n<ChoiceFieldset required>\n  <ChoiceFieldset.Legend>Color mode</ChoiceFieldset.Legend>\n  <ChoiceFieldset.List>\n    <ChoiceFieldset.Item value=\"dark\">Dark</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"hc-dark\">High-contrast dark</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"light\">Light</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"hc-light\">High-contrast light</ChoiceFieldset.Item>\n  </ChoiceFieldset.List>\n</ChoiceFieldset>\n```\n\n### With pre-selected choices\n\n```jsx live deprecated\n<ChoiceFieldset selected={['figma', 'react']}>\n  <ChoiceFieldset.Legend>Prefered Primer component interface</ChoiceFieldset.Legend>\n\n  <ChoiceFieldset.List selectionVariant=\"multiple\">\n    <ChoiceFieldset.Item value=\"figma\">Figma library</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"css\">Primer CSS</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"react\">Primer React components</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"viewcomponents\">Primer ViewComponents</ChoiceFieldset.Item>\n  </ChoiceFieldset.List>\n</ChoiceFieldset>\n```\n\n### With validation\n\n```javascript live noinline deprecated\nconst choices = [\n  {\n    value: 'figma',\n    displayName: 'Figma library',\n    description: 'The Figma file where we have Figma symbols and light documentation'\n  },\n  {\n    value: 'css',\n    displayName: 'Primer CSS',\n    description: 'The OG. A CSS library with utility styles and component styles'\n  },\n  {\n    value: 'react',\n    displayName: 'Primer React components',\n    description: 'The React component library that these docs belong to'\n  },\n  {\n    value: 'viewcomponents',\n    displayName: 'Primer ViewComponents',\n    description: 'The Rails and Web Components implementation of our components'\n  }\n]\n\nconst ChoiceFieldsetWithValidation = () => {\n  const [selectedChoices, setSelectedChoices] = React.useState([])\n  const [validationResult, setValidationResult] = React.useState()\n\n  React.useEffect(() => {\n    if (selectedChoices.length && selectedChoices.length > 2) {\n      setValidationResult('tooManySelections')\n    } else {\n      setValidationResult(undefined)\n    }\n  }, [selectedChoices])\n\n  return (\n    <ChoiceFieldset\n      name=\"radioGroup\"\n      onSelect={selectedValues => {\n        setSelectedChoices(selectedValues)\n      }}\n      validationMap={{tooManySelections: 'error'}}\n      validationResult={validationResult}\n      selected={selectedChoices}\n    >\n      <ChoiceFieldset.Legend>Prefered Primer component interface</ChoiceFieldset.Legend>\n      <ChoiceFieldset.Description>Pick your top two</ChoiceFieldset.Description>\n\n      <ChoiceFieldset.List selectionVariant=\"multiple\">\n        {choices.map(choice => (\n          <ChoiceFieldset.Item value={choice.value}>\n            <Item.Label>{choice.displayName}</Item.Label>\n            <Item.Caption>{choice.description}</Item.Caption>\n          </ChoiceFieldset.Item>\n        ))}\n      </ChoiceFieldset.List>\n\n      <ChoiceFieldset.Validation validationKey=\"tooManySelections\">\n        Only two selections are allowed\n      </ChoiceFieldset.Validation>\n    </ChoiceFieldset>\n  )\n}\n\nrender(<ChoiceFieldsetWithValidation />)\n```\n\n### A visually hidden legend\n\n```jsx live deprecated\n<ChoiceFieldset>\n  <ChoiceFieldset.Legend visuallyHidden>Color mode</ChoiceFieldset.Legend>\n  <ChoiceFieldset.List>\n    <ChoiceFieldset.Item value=\"dark\">Dark</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"hc-dark\">High-contrast dark</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"light\">Light</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"hc-light\">High-contrast light</ChoiceFieldset.Item>\n  </ChoiceFieldset.List>\n</ChoiceFieldset>\n```\n\n### With a ChoiceFieldset.Description\n\n```jsx live deprecated\n<ChoiceFieldset>\n  <ChoiceFieldset.Legend>Notification preferences</ChoiceFieldset.Legend>\n  <ChoiceFieldset.Description>\n    Your selection will affect notifications sent to your email and mobile device\n  </ChoiceFieldset.Description>\n\n  <ChoiceFieldset.List>\n    <ChoiceFieldset.Item value=\"all\">\n      <Item.LeadingVisual>\n        <CheckIcon />\n      </Item.LeadingVisual>\n      <Item.Label>All notifications</Item.Label>\n      <Item.Caption>Every possible notification</Item.Caption>\n    </ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"relevant\">\n      <Item.LeadingVisual>\n        <AlertIcon />\n      </Item.LeadingVisual>\n      <Item.Label>Relevant notifications</Item.Label>\n      <Item.Caption>Only the ones you'll care about</Item.Caption>\n    </ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"none\">\n      <Item.LeadingVisual>\n        <XIcon />\n      </Item.LeadingVisual>\n      <Item.Label>No notifications</Item.Label>\n      <Item.Caption>Notifications won't be sent</Item.Caption>\n    </ChoiceFieldset.Item>\n  </ChoiceFieldset.List>\n</ChoiceFieldset>\n```\n\n### With one disabled item\n\n```jsx live deprecated\n<ChoiceFieldset>\n  <ChoiceFieldset.Legend>Color mode</ChoiceFieldset.Legend>\n  <ChoiceFieldset.List>\n    <ChoiceFieldset.Item disabled value=\"dark\">\n      Dark\n    </ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"hc-dark\">High-contrast dark</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"light\">Light</ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"hc-light\">High-contrast light</ChoiceFieldset.Item>\n  </ChoiceFieldset.List>\n</ChoiceFieldset>\n```\n\n### Items with a caption and a leading visual\n\n```jsx live deprecated\n<ChoiceFieldset>\n  <ChoiceFieldset.Legend>Notification preferences</ChoiceFieldset.Legend>\n\n  <ChoiceFieldset.List>\n    <ChoiceFieldset.Item value=\"all\">\n      <Item.LeadingVisual>\n        <CheckIcon />\n      </Item.LeadingVisual>\n      <Item.Label>All notifications</Item.Label>\n      <Item.Caption>Every possible notification</Item.Caption>\n    </ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"relevant\">\n      <Item.LeadingVisual>\n        <AlertIcon />\n      </Item.LeadingVisual>\n      <Item.Label>Relevant notifications</Item.Label>\n      <Item.Caption>Only the ones you'll care about</Item.Caption>\n    </ChoiceFieldset.Item>\n    <ChoiceFieldset.Item value=\"none\">\n      <Item.LeadingVisual>\n        <XIcon />\n      </Item.LeadingVisual>\n      <Item.Label>No notifications</Item.Label>\n      <Item.Caption>Notifications won't be sent</Item.Caption>\n    </ChoiceFieldset.Item>\n  </ChoiceFieldset.List>\n</ChoiceFieldset>\n```\n\n## Props\n\n### ChoiceFieldset\n\n| Name             | Type                                                                                                      | Default | Description                                                                                                                                                                                                          |\n| :--------------- | :-------------------------------------------------------------------------------------------------------- | :-----: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| children\\*       | `ChoiceFieldset.Legend`, `ChoiceFieldset.Description`, `ChoiceFieldset.List`, `ChoiceFieldset.Validation` |    –    | The list of choices and contextual information                                                                                                                                                                       |\n| disabled         | `boolean`                                                                                                 |    –    | Whether the fieldset is NOT ready for user input                                                                                                                                                                     |\n| id               | `string`                                                                                                  |    –    | The unique identifier for this fieldset. Used to associate the validation text with the fieldset <br /> If an ID is not passed, one will be automatically generated                                                  |\n| name             | `string`                                                                                                  |    –    | The unique identifier used to associate radio inputs with eachother <br /> If a name is not passed and the fieldset renders radio inputs, a name will be automatically generated                                     |\n| onSelect         | `(selectedValues?: string[]) => void`                                                                     |    –    | The callback that is called when a user toggles a choice on or off                                                                                                                                                   |\n| required         | `boolean`                                                                                                 |    –    | Whether this field must have a value for the user to complete their task                                                                                                                                             |\n| selected         | `string[]`                                                                                                |    –    | The selected values                                                                                                                                                                                                  |\n| validationMap    | `Record<string, 'error' \\| 'success'>`                                                                    |    –    | A map of validation statuses and their associated validation keys. When one of the validation keys is passed to the `validationResult` prop, the associated validation message will be rendered in the correct style |\n| validationResult | `keyof validationMap`                                                                                     |    –    | The key of the validation message to show                                                                                                                                                                            |\n\n### ChoiceFieldset.Legend\n\nA title for the set of choices. A `ChoiceFieldset.Legend` must be passed, but it may be visually hidden.\n\n| Name           | Type      | Default | Description                                  |\n| :------------- | :-------- | :-----: | :------------------------------------------- |\n| visuallyHidden | `boolean` |    –    | Whether to visually hide the fieldset legend |\n\n### ChoiceFieldset.List\n\nThe list choices are rendered in.\n\n| Name             | Type                   | Default | Description                                             |\n| :--------------- | :--------------------- | :-----: | :------------------------------------------------------ |\n| children\\*       | `ChoiceFieldset.Item`  |    –    | The choices that render as a checkbox or radio field    |\n| selectionVariant | `'single'\\|'multiple'` |    –    | Whether multiple items or a single item can be selected |\n\n### ChoiceFieldset.Item\n\nRenders a choice to the list as a checkbox or radio field.\n\n| Name       | Type                                                                                                | Default | Description                                                                                                                                                                                                  |\n| :--------- | :-------------------------------------------------------------------------------------------------- | :-----: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| children\\* | `ChoiceFieldset.Caption`, `ChoiceFieldset.Label`, `ChoiceFieldset.LeadingVisual`, `React.ReactNode` |    –    | The parts that make up the checkbox or radio field used to select the choice. <br /> If you **only** need a label, it's fine to pass in a string or JSX instead of wrapping it in the `Item.Label` component |\n| value\\*    | `string`                                                                                            |    –    | The value that is being selected                                                                                                                                                                             |\n| disabled   | `boolean`                                                                                           |    –    | Whether the field is ready for user input                                                                                                                                                                    |\n| id         | `string`                                                                                            |    –    | The unique identifier for this field. Used to associate the label, validation text, and caption text. <br /> If an ID is not provided, one will be automatically generated.                                  |\n\n### ChoiceFieldset.Description\n\nA `ChoiceFieldset.Description` may be used to render hint text if this list needs additional context to guide a user to make their selection\n\n| Name       | Type              | Default | Description             |\n| :--------- | :---------------- | :-----: | :---------------------- |\n| children\\* | `React.ReactNode` |    –    | The description content |\n\n### ChoiceFieldset.Validation\n\nIf the user's selection has been flagged during validation, `ChoiceFieldset.Validation` may be used to render contextual validation information to help the user complete their task\n\n| Name            | Type              | Default | Description                                                                                                                        |\n| :-------------- | :---------------- | :-----: | :--------------------------------------------------------------------------------------------------------------------------------- |\n| children\\*      | `React.ReactNode` |    –    | The validation message                                                                                                             |\n| validationKey\\* | `string`          |    –    | When this matches the `validationResult` prop on the parent `ChoiceFieldset` component, this validation component will be rendered |\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    hasStorybookStories: true,\n    designReviewed: false,\n    a11yReviewed: true,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n\n## Related components\n\n- [ChoiceInputField](/ChoiceInputField)\n- [Checkbox](/Checkbox)\n- [Radio](/Radio)\n","parent":{"relativeDirectory":"deprecated","name":"ChoiceFieldset"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/ChoiceInputField.mdx","frontmatter":{"title":"ChoiceInputField"},"rawBody":"---\ntitle: ChoiceInputField\nstatus: Deprecated\ndescription: The ChoiceInputField component is used to render a labelled checkbox or radio inputs with optional  hint text.\nsource: https://github.com/primer/react/blob/main/src/ChoiceInputField.tsx\nstorybook: '/react/storybook?path=/story/forms-choiceinputfield--checkbox-input-field'\n---\n\nimport {Checkbox, Radio} from '@primer/react'\nimport {MarkGithubIcon} from '@primer/octicons-react'\n\n## Deprecation\n\nUse [FormControl](/FormControl) instead.\n\n## Examples\n\n### Checkbox\n\n```jsx live deprecated\n<ChoiceInputField>\n  <ChoiceInputField.Label>Option one</ChoiceInputField.Label>\n  <Checkbox />\n</ChoiceInputField>\n```\n\n### Radio\n\n```jsx live deprecated\n<fieldset style={{margin: 0, padding: 0, border: 0}}>\n  <ChoiceInputField>\n    <ChoiceInputField.Label>Option one</ChoiceInputField.Label>\n    <Radio name=\"radioExample\" value=\"one\" />\n  </ChoiceInputField>\n  <ChoiceInputField>\n    <ChoiceInputField.Label>Option two</ChoiceInputField.Label>\n    <Radio name=\"radioExample\" value=\"two\" />\n  </ChoiceInputField>\n</fieldset>\n```\n\n### Disabled field\n\n```jsx live deprecated\n<ChoiceInputField disabled>\n  <ChoiceInputField.Label>Option one</ChoiceInputField.Label>\n  <Checkbox />\n</ChoiceInputField>\n```\n\n### With a caption\n\n```jsx live deprecated\n<ChoiceInputField>\n  <ChoiceInputField.Label>Option One</ChoiceInputField.Label>\n  <Checkbox />\n  <ChoiceInputField.Caption>Hint: the first and only option</ChoiceInputField.Caption>\n</ChoiceInputField>\n```\n\n### With a LeadingVisual\n\n```jsx live deprecated\n<>\n  <ChoiceInputField>\n    <ChoiceInputField.Label>Option one</ChoiceInputField.Label>\n    <ChoiceInputField.LeadingVisual>\n      <MarkGithubIcon />\n    </ChoiceInputField.LeadingVisual>\n    <Checkbox />\n  </ChoiceInputField>\n\n  <ChoiceInputField>\n    <ChoiceInputField.Label>Option two</ChoiceInputField.Label>\n    <ChoiceInputField.LeadingVisual>\n      <MarkGithubIcon />\n    </ChoiceInputField.LeadingVisual>\n    <Checkbox />\n    <ChoiceInputField.Caption>This one has a caption</ChoiceInputField.Caption>\n  </ChoiceInputField>\n</>\n```\n\n## Props\n\n### ChoiceInputField\n\nThe container that handles the layout and passes the relevant IDs and ARIA attributes it's children.\n\n`ChoiceInputField.Label` and `ChoiceInputField.Input` are required children.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    type=\"ChoiceInputField.Label | ChoiceInputField.Caption | ChoiceInputField.LeadingVisual | Checkbox | Radio\"\n    required\n  />\n  <PropsTableRow\n    name=\"disabled\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Whether the field is ready for user input\"\n  />\n  <PropsTableRow\n    name=\"id\"\n    type=\"string\"\n    defaultValue=\"a generated string\"\n    description=\"The unique identifier for this field. Used to associate the label, validation text, and caption text\"\n  />\n</PropsTable>\n\n### ChoiceInputField.Label\n\nA `ChoiceInputField.Label` must be passed, but it may be visually hidden.\n\n<PropsTable>\n  <PropsTableRow name=\"children\" type=\"React.ReactNode\" description=\"The title that describes the choice input\" />\n</PropsTable>\n\n### ChoiceInputField.Caption\n\nIf this field needs additional context, a `ChoiceInputField.Caption` may be used to render hint text.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    type=\"React.ReactNode\"\n    description=\"The content (usually just text) that is rendered to give contextual info about the field\"\n  />\n</PropsTable>\n\n### ChoiceInputField.LeadingVisual\n\nIf the selectable option would be easier to understand with a visual, the `ChoiceInputField.LeadingVisual` component may be used.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    type=\"React.ReactNode\"\n    description=\"The visual to render before the choice input's label\"\n  />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: true,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"deprecated","name":"ChoiceInputField"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/Dropdown.md","frontmatter":{"title":"Dropdown"},"rawBody":"---\ntitle: Dropdown\nstatus: Deprecated\n---\n\n## Deprecation\n\nUse [ActionMenu](/ActionMenu) instead.\n\n---\n\nThe Dropdown component is a lightweight context menu for housing navigation and actions.\n\nUse `Dropdown.Button` as the trigger for the dropdown, or use a custom `summary` element if you would like. **You must use a `summary` tag in order for the dropdown to behave properly!**. You should also add `aria-haspopup=\"true\"` to custom dropdown triggers for accessibility purposes. You can use the `Dropdown.Caret` component to add a caret to a custom dropdown trigger.\n\nDropdown.Menu wraps your menu content. Be sure to pass a `direction` prop to this component to position the menu in relation to the Dropdown.Button.\n\n## Default example\n\n```jsx live deprecated\n<Dropdown>\n  <Dropdown.Button>Dropdown</Dropdown.Button>\n  <Dropdown.Menu direction=\"sw\">\n    <Dropdown.Item>Item 1</Dropdown.Item>\n    <Dropdown.Item>Item 2</Dropdown.Item>\n    <Dropdown.Item>Item 3</Dropdown.Item>\n  </Dropdown.Menu>\n</Dropdown>\n```\n\n## With custom button\n\n```jsx live deprecated\n<Dropdown>\n  <summary>\n    Dropdown\n    <Dropdown.Caret />\n  </summary>\n  <Dropdown.Menu direction=\"sw\">\n    <Dropdown.Item>Item 1</Dropdown.Item>\n    <Dropdown.Item>Item 2</Dropdown.Item>\n    <Dropdown.Item>Item 3</Dropdown.Item>\n  </Dropdown.Menu>\n</Dropdown>\n```\n\n## Component props\n\nThe Dropdown component is extended from the [`Details`](/Details) component and gets all props that the [`Details`](/Details) component gets.\n\n#### Dropdown.Menu\n\n| Name      | Type              | Default | Description                                                                           |\n| :-------- | :---------------- | :-----: | :------------------------------------------------------------------------------------ |\n| direction | String            |  'sw'   | Sets the direction of the dropdown menu. Pick from 'ne', 'e', 'se', 's', 'sw', or 'w' |\n| sx        | SystemStyleObject |   {}    | Style to be applied to the component                                                  |\n\n#### Dropdown.Button\n\nSee https://primer.style/react/Buttons#component-props\n\n#### Dropdown.Caret\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n\n#### Dropdown.Item\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n","parent":{"relativeDirectory":"deprecated","name":"Dropdown"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/DropdownMenu.mdx","frontmatter":{"title":"DropdownMenu"},"rawBody":"---\ntitle: DropdownMenu\nstatus: Deprecated\n---\n\nA `DropdownMenu` provides an anchor (button by default) that will open a floating menu of selectable items. The menu can be opened and navigated using keyboard or mouse. When an item is selected, the menu will close and the `onChange` callback will be called. If the default anchor button is used, the anchor contents will be updated with the selection.\n\n## Deprecation\n\nUse [new version of ActionMenu](/ActionMenu#with-selection) with composable API, design updates and accessibility fixes.\n\n**Before**\n\n```jsx\nconst fieldTypes = [\n  {key: 0, text: 'Text'},\n  {key: 1, text: 'Number'},\n  {key: 3, text: 'Date'},\n  {key: 4, text: 'Single select'},\n  {key: 5, text: 'Iteration'}\n]\n\nconst Example = () => {\n  const [selectedType, setSelectedType] = React.useState()\n\n  return (\n    <DropdownMenu\n      renderAnchor={({children, ...anchorProps}) => (\n        <ButtonInvisible {...anchorProps}>\n          {children} <GearIcon />\n        </ButtonInvisible>\n      )}\n      placeholder=\"Field type\"\n      items={fieldTypes}\n      selectedItem={selectedType}\n      onChange={setSelectedType}\n    />\n  )\n}\n```\n\n**After**\n\nInstead of `DropdownMenu`, you can use the `ActionMenu` with `ActionList selectionVariant=single`, this will give menu items the correct semantics:\n\n```jsx\nconst fieldTypes = [\n  {id: 0, text: 'Text'},\n  {id: 1, text: 'Number'},\n  {id: 3, text: 'Date'},\n  {id: 4, text: 'Single select'},\n  {id: 5, text: 'Iteration'}\n]\n\nconst Example = () => {\n  const [selectedType, setSelectedType] = React.useState()\n\n  render(\n    <ActionMenu>\n      <ActionMenu.Button aria-label=\"Select field type\">{selectedType.name || 'Field type'}</ActionMenu.Button>\n      <ActionMenu.Overlay>\n        <ActionList selectionVariant=\"single\">\n          {fieldTypes.map(type => (\n            <ActionList.Item\n              key={type.id}\n              selected={type.id === selectedType.id}\n              onSelect={() => setSelectedType(type)}\n            >\n              {type.name}\n            </ActionList.Item>\n          ))}\n        </ActionList>\n      </ActionMenu.Overlay>\n    </ActionMenu>\n  )\n}\n```\n\nOr continue using deprecated API:\n\n```js\nimport {DropdownMenu} from '@primer/react/deprecated'\n```\n\n## Example\n\n```javascript live noinline deprecated\nfunction DemoComponent() {\n  const items = React.useMemo(\n    () => [\n      {text: '🔵 Cyan', id: 5, key: 'cyan'},\n      {text: '🔴 Magenta', key: 'magenta'},\n      {text: '🟡 Yellow', key: 'yellow'}\n    ],\n    []\n  )\n  const [selectedItem, setSelectedItem] = React.useState()\n\n  return (\n    <DropdownMenu\n      renderAnchor={({children, 'aria-labelledby': ariaLabelledBy, ...anchorProps}) => (\n        <DropdownButton aria-labelledby={`favorite-color-label ${ariaLabelledBy}`} {...anchorProps}>\n          {children}\n        </DropdownButton>\n      )}\n      placeholder=\"🎨\"\n      items={items}\n      selectedItem={selectedItem}\n      onChange={setSelectedItem}\n    />\n  )\n}\n\nrender(<DemoComponent />)\n```\n\n## Component props\n\n| Name          | Type                                          |      Default      | Description                                                                                                                                                                                    |\n| :------------ | :-------------------------------------------- | :---------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| items         | `ItemProps[]`                                 |    `undefined`    | Required. A list of item objects to display in the menu                                                                                                                                        |\n| selectedItem  | `ItemInput`                                   |    `undefined`    | An `ItemProps` item from the list of `items` which is currently selected. This item will receive a checkmark next to it in the menu.                                                           |\n| onChange?     | (item?: ItemInput) => unknown                 |    `undefined`    | A callback which receives the selected item or `undefined` when an item is activated in the menu. If the activated item is the same as the current `selectedItem`, `undefined` will be passed. |\n| placeholder   | `string`                                      |    `undefined`    | Optional. A placeholder value to display when there is no current selection.                                                                                                                   |\n| renderAnchor  | `(props: DropdownButtonProps) => JSX.Element` | `DropdownButton`  | Optional. If defined, provided component will be used to render the menu anchor. Will receive the selected `Item` text as `children` prop when an item is activated.                           |\n| renderItem    | `(props: ItemProps) => JSX.Element`           | `ActionList.Item` | Optional. If defined, each item in `items` will be passed to this function, allowing for custom item rendering.                                                                                |\n| groupMetadata | `GroupProps[]`                                |    `undefined`    | Optional. If defined, `DropdownMenu` will group `items` into `ActionList.Group`s separated by `ActionList.Divider` according to their `groupId` property.                                      |\n","parent":{"relativeDirectory":"deprecated","name":"DropdownMenu"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/Flex.md","frontmatter":{"title":"Flex"},"rawBody":"---\ntitle: Flex\nstatus: Deprecated\n---\n\nThe `Flex` component behaves the same as the `Box` component except that it has `display: flex` set by default.\n\n## Deprecation\n\nUse [Box](/Box) instead.\n\n**Before**\n\n```jsx deprecated\n<Flex flexWrap=\"nowrap\">\n  <Box p={3} color=\"fg.onEmphasis\" bg=\"accent.emphasis\">\n    Item 1\n  </Box>\n</Flex>\n```\n\n**After**\n\n```jsx deprecated\n<Box display=\"flex\" flexWrap=\"nowrap\">\n  <Box p={3} color=\"fg.onEmphasis\" bg=\"accent.emphasis\">\n    Item 1\n  </Box>\n</Box>\n```\n\n## Default example\n\n```jsx deprecated live\n<Box borderWidth=\"1px\" borderStyle=\"solid\" borderColor=\"border.default\" width={300} height={300} borderRadius={0}>\n  <Flex flexWrap=\"nowrap\">\n    <Box p={3} color=\"fg.onEmphasis\" bg=\"accent.emphasis\">\n      Item 1\n    </Box>\n    <Box p={3} color=\"fg.onEmphasis\" bg=\"attention.emphasis\">\n      Item 2\n    </Box>\n    <Box p={3} color=\"fg.onEmphasis\" bg=\"danger.emphasis\">\n      Item 3\n    </Box>\n  </Flex>\n</Box>\n```\n\n## System props\n\nFlex components get `FLEX`, `COMMON`, and `LAYOUT` system props.\n\nRead our [System Props](/system-props) doc page for a full list of available props.\n\n## Component props\n\n`Flex` does not get any additional props other than the system props mentioned above.\n","parent":{"relativeDirectory":"deprecated","name":"Flex"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/FormGroup.md","frontmatter":{"title":"FormGroup"},"rawBody":"---\ntitle: FormGroup\nstatus: Deprecated\n---\n\nAdds styles for multiple form elements used together.\n\n## Deprecation\n\nUse [FormControl](/FormControl) instead.\n\n## Default example\n\n```jsx live deprecated\n<>\n  <FormGroup>\n    <FormGroup.Label htmlFor=\"example-text\">Example text</FormGroup.Label>\n    <TextInput id=\"example-text\" value=\"Example Value\" />\n  </FormGroup>\n\n  <FormGroup>\n    <FormGroup.Label htmlFor=\"example-text-b\">Example text</FormGroup.Label>\n    <TextInput id=\"example-text-b\" value=\"Example Value\" />\n  </FormGroup>\n</>\n```\n\n## Component props\n\n### FormGroup\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| as   | String            |  `div`  | Sets the HTML tag for the component  |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n\n### FormGroup.Label\n\n| Name    | Type              | Default | Description                                                                    |\n| :------ | :---------------- | :-----: | :----------------------------------------------------------------------------- |\n| as      | String            | `label` | Sets the HTML tag for the component                                            |\n| htmlFor | String            |         | The value of `htmlFor` needs to be the same as the `id` of the input it labels |\n| sx      | SystemStyleObject |   {}    | Style to be applied to the component                                           |\n","parent":{"relativeDirectory":"deprecated","name":"FormGroup"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/Grid.md","frontmatter":{"title":"Grid"},"rawBody":"---\ntitle: Grid\nstatus: Deprecated\n---\n\nGrid is a component that exposes grid system props. See the [CSS Tricks Complete Guide to Grid](https://css-tricks.com/snippets/css/complete-guide-grid/) to learn more about Grid Layout.\n\n## Deprecation\n\nUse [Box](/Box) instead.\n\n**Before**\n\n```jsx deprecated\n<Grid gridTemplateColumns=\"repeat(2, auto)\" gridGap={3}>\n  <Box p={3} color=\"fg.onEmphasis\" bg=\"accent.emphasis\">\n    1\n  </Box>\n  <Box p={3} color=\"fg.onEmphasis\" bg=\"attention.emphasis\">\n    2\n  </Box>\n</Grid>\n```\n\n**After**\n\n```jsx deprecated\n<Box display=\"grid\" gridTemplateColumns=\"repeat(2, auto)\" gridGap={3}>\n  <Box p={3} color=\"fg.onEmphasis\" bg=\"accent.emphasis\">\n    1\n  </Box>\n  <Box p={3} color=\"fg.onEmphasis\" bg=\"attention.emphasis\">\n    2\n  </Box>\n</Box>\n```\n\n## Default example\n\n```jsx deprecated live\n<Grid gridTemplateColumns=\"repeat(2, auto)\" gridGap={3}>\n  <Box p={3} color=\"fg.onEmphasis\" bg=\"accent.emphasis\">\n    1\n  </Box>\n  <Box p={3} color=\"fg.onEmphasis\" bg=\"attention.emphasis\">\n    2\n  </Box>\n</Grid>\n```\n\n## System props\n\nGrid components get `GRID`, `COMMON`, and `LAYOUT` system props.\n\nRead our [System Props](/system-props) doc page for a full list of available props.\n\n## Component props\n\n`Grid` does not get any additional props other than the system props mentioned above.\n","parent":{"relativeDirectory":"deprecated","name":"Grid"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/InputField.mdx","frontmatter":{"title":"InputField"},"rawBody":"---\ntitle: InputField\nstatus: Deprecated\ndescription: The InputField component is used to render a labelled text input and, optionally, associated validation text and hint text.\nsource: https://github.com/primer/react/blob/main/src/InputField/InputField.tsx\nstorybook: '/react/storybook?path=/story/forms-inputfield--text-input-field'\n---\n\nimport {TextInputWithTokens, Autocomplete, Select} from '@primer/react'\n\n## Deprecation\n\nUse [FormControl](/FormControl) instead.\n\n## Examples\n\n### Basic\n\n```jsx live deprecated\n<InputField>\n  <InputField.Label>Name</InputField.Label>\n  <TextInput />\n</InputField>\n```\n\n### Required\n\n```jsx live deprecated\n<InputField required>\n  <InputField.Label>Name</InputField.Label>\n  <TextInput />\n</InputField>\n```\n\n### Disabled\n\n```jsx live deprecated\n<InputField disabled>\n  <InputField.Label>Name</InputField.Label>\n  <TextInput />\n</InputField>\n```\n\n### Using different input components\n\n```javascript live noinline deprecated\nconst TextInputWithTokensExample = () => {\n  const [tokens, setTokens] = React.useState([\n    {text: 'zero', id: 0},\n    {text: 'one', id: 1},\n    {text: 'two', id: 2}\n  ])\n  const onTokenRemove = tokenId => {\n    setTokens(tokens.filter(token => token.id !== tokenId))\n  }\n\n  return (\n    <Box\n      display=\"flex\"\n      flexDirection=\"column\"\n      sx={{\n        '> * + *': {\n          marginTop: 4\n        }\n      }}\n    >\n      <InputField>\n        <InputField.Label>TextInputWithTokens</InputField.Label>\n        <TextInputWithTokens onTokenRemove={onTokenRemove} tokens={tokens} />\n      </InputField>\n      <InputField>\n        <InputField.Label>Autocomplete</InputField.Label>\n        <Autocomplete>\n          <Autocomplete.Input block />\n          <Autocomplete.Overlay>\n            <Autocomplete.Menu\n              items={[\n                {text: 'css', id: 0},\n                {text: 'css-in-js', id: 1},\n                {text: 'styled-system', id: 2},\n                {text: 'javascript', id: 3},\n                {text: 'typescript', id: 4},\n                {text: 'react', id: 5},\n                {text: 'design-systems', id: 6}\n              ]}\n              selectedItemIds={[]}\n            />\n          </Autocomplete.Overlay>\n        </Autocomplete>\n      </InputField>\n      <InputField>\n        <InputField.Label>Select</InputField.Label>\n        <Select>\n          <Select.Option value=\"figma\">Figma</Select.Option>\n          <Select.Option value=\"css\">Primer CSS</Select.Option>\n          <Select.Option value=\"prc\">Primer React components</Select.Option>\n          <Select.Option value=\"pvc\">Primer ViewComponents</Select.Option>\n        </Select>\n      </InputField>\n    </Box>\n  )\n}\n\nrender(TextInputWithTokensExample)\n```\n\n### With a visually hidden label\n\n<Note>\n\nEvery input must have a corresponding label to be accessible to assistive technology. That's why you'd use `InputField` instead of using [`TextInput`](/TextInput) directly.\n\n`InputField` also provides an interface for showing a hint text caption and a validation message, and associating those with the input for assistive technology.\n\n</Note>\n\n```jsx live deprecated\n<InputField>\n  <InputField.Label visuallyHidden>Name</InputField.Label>\n  <TextInput />\n</InputField>\n```\n\n### With a caption\n\n```jsx live deprecated\n<InputField>\n  <InputField.Label>Name</InputField.Label>\n  <TextInput />\n  <InputField.Caption>Hint: your first name</InputField.Caption>\n</InputField>\n```\n\n### With validation\n\n```javascript live noinline deprecated\nconst ValidationExample = () => {\n  const [value, setValue] = React.useState('mona lisa')\n  const [validationResult, setValidationResult] = React.useState()\n  const doesValueContainSpaces = inputValue => /\\s/g.test(inputValue)\n  const handleInputChange = e => {\n    setValue(e.currentTarget.value)\n  }\n\n  React.useEffect(() => {\n    if (doesValueContainSpaces(value)) {\n      setValidationResult('noSpaces')\n    } else if (value) {\n      setValidationResult('validName')\n    }\n  }, [value])\n\n  return (\n    <InputField\n      validationMap={{\n        noSpaces: 'error',\n        validName: 'success'\n      }}\n      validationResult={validationResult}\n    >\n      <InputField.Label>GitHub handle</InputField.Label>\n      <TextInput block value={value} onChange={handleInputChange} />\n      <InputField.Validation validationKey=\"noSpaces\">GitHub handles cannot contain spaces</InputField.Validation>\n      <InputField.Validation validationKey=\"validName\">Valid name</InputField.Validation>\n      <InputField.Caption>With or without \"@\". For example \"monalisa\" or \"@monalisa\"</InputField.Caption>\n    </InputField>\n  )\n}\n\nrender(ValidationExample)\n```\n\n## Props\n\n### InputField\n\nThe container that handles the layout and passes the relevant IDs and ARIA attributes it's children.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    type=\"InputField.Label | InputField.Caption | InputField.Validation | Autocomplete | TextInput | TextInputWithTokens | Select\"\n    required\n  />\n  <PropsTableRow\n    name=\"disabled\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Whether the field is ready for user input\"\n  />\n  <PropsTableRow\n    name=\"id\"\n    type=\"string\"\n    defaultValue=\"a generated string\"\n    description=\"The unique identifier for this field. Used to associate the label, validation text, and caption text\"\n  />\n  <PropsTableRow\n    name=\"required\"\n    type=\"boolean\"\n    defaultValue=\"false\"\n    description=\"Whether the field is ready for user input\"\n  />\n  <PropsTableRow\n    name=\"validationMap\"\n    type=\"Record<string, 'error'|'success'>\"\n    description=\"A map of validation statuses and their associated validation keys. When one of the validation keys is passed to the `validationResult` prop, the associated validation message will be rendered in the correct style\"\n  />\n  <PropsTableRow name=\"validationResult\" type=\"string\" description=\"The key of the validation message to show \" />\n</PropsTable>\n\n### InputField.Label\n\nA `InputField.Label` must be passed for the field to be accessible to assistive technology, but it may be visually hidden.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"boolean\"\n    type=\"InputField.Label | InputField.Caption | InputField.Validation | Autocomplete | TextInput | TextInputWithTokens\"\n    defaultValue=\"false\"\n    description=\"Whether the label should be visually hidden\"\n  />\n</PropsTable>\n\n### InputField.Caption\n\n`InputField.Caption` may be used to render hint text for fields that require additional context.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    type=\"React.ReactNode\"\n    description=\"The content (usually just text) that is rendered to give contextual info about the field\"\n  />\n</PropsTable>\n\n### InputField.Validation\n\n`InputField.Validation` may be used to render contextual validation information if the field was flagged during validation.\n\n<PropsTable>\n  <PropsTableRow\n    name=\"children\"\n    type=\"React.ReactNode\"\n    description=\"The content (usually just text) that is rendered to give contextual info about the validation result for the field\"\n  />\n  <PropsTableRow\n    name=\"validationKey\"\n    type=\"string\"\n    description=\"The key of the property from `InputField` that corresponds to this validation message. When `InputField`'s `validationResult` prop matches `InputField.Validation`'s `validationKey` prop, this message is shown.\"\n  />\n</PropsTable>\n\n## Component status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: true,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: true,\n    fullTestCoverage: true,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: true,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n\n## Related components\n\n- [ChoiceInputField](/ChoiceInputField)\n- [TextInput](/TextInput)\n","parent":{"relativeDirectory":"deprecated","name":"InputField"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/Label.mdx","frontmatter":{"title":"Label (legacy)"},"rawBody":"---\ntitle: Label (legacy)\ndescription: Use Label components to add contextual metadata to a design.\nstatus: Deprecated\nsource: https://github.com/primer/react/blob/main/src/Label.tsx\ncomponentId: legacy_label\n---\n\n## Deprecation\n\nUse the new [Label](/Label) instead.\n\n## Example\n\n```jsx live deprecated\n<>\n  <Label variant=\"small\" outline sx={{borderColor: 'danger.emphasis', mr: 2, color: 'danger.fg'}}>\n    small\n  </Label>\n  <Label variant=\"medium\" sx={{mr: 2}}>\n    medium (default)\n  </Label>\n  <Label variant=\"large\" sx={{mr: 2}}>\n    large\n  </Label>\n  <Label variant=\"xl\">xl label</Label>\n\n  <Box mt={4} />\n  <Label variant=\"medium\" sx={{bg: '#A575FF', m: 1}}>\n    good first issue\n  </Label>\n  <Label variant=\"medium\" sx={{bg: '#FF75C8', m: 1}}>\n    🚂 deploy: train\n  </Label>\n  <Label variant=\"medium\" sx={{bg: '#1C90FA', m: 1}}>\n    css\n  </Label>\n  <Label variant=\"medium\" sx={{bg: '#FFF06C', color: '#24292E', m: 1}}>\n    documentation\n  </Label>\n  <Label variant=\"medium\" sx={{bg: '#656BFE', m: 1}}>\n    primer\n  </Label>\n</>\n```\n\n## Props\n\n<PropsTable>\n  <PropsTableRow name=\"outline\" type=\"boolean\" defaultValue=\"false\" description=\"Creates an outline style label\" />\n  <PropsTableRow name=\"variant\" type=\"'small' | 'medium' | 'large' | 'xl'\" defaultValue=\"'medium'\" />\n  <PropsTableRow name=\"dropshadow\" type=\"boolean\" defaultValue=\"false\" description=\"Adds a dropshadow to the label\" />\n  <PropsTableSxRow />\n</PropsTable>\n\n## Status\n\n<ComponentChecklist\n  items={{\n    propsDocumented: true,\n    noUnnecessaryDeps: false,\n    adaptsToThemes: true,\n    adaptsToScreenSizes: false,\n    fullTestCoverage: false,\n    usedInProduction: false,\n    usageExamplesDocumented: true,\n    designReviewed: false,\n    a11yReviewed: false,\n    stableApi: false,\n    addressedApiFeedback: false,\n    hasDesignGuidelines: false,\n    hasFigmaComponent: false\n  }}\n/>\n","parent":{"relativeDirectory":"deprecated","name":"Label"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/Position.md","frontmatter":{"title":"Position"},"rawBody":"---\ntitle: Position\nstatus: Deprecated\n---\n\nThe Position component is a wrapper component that gives the containing component css positioning abilities.\n\n## Deprecation\n\nUse [Box](/Box) instead.\n\n**Before**\n\n```jsx deprecated\n<>\n  <Position position=\"absolute\">...</Position>\n  <Absolute>...</Absolute>\n  <Relative>...</Relative>\n  <Fixed>...</Fixed>\n  <Sticky>...</Sticky>\n</>\n```\n\n**After**\n\n```jsx deprecated\n<>\n  <Box position=\"absolute\">...</Box>\n  <Box position=\"absolute\">...</Box>\n  <Box position=\"relative\">...</Box>\n  <Box position=\"fixed\">...</Box>\n  <Box position=\"sticky\">...</Box>\n</>\n```\n\n## Default examples\n\n```jsx deprecated live\n<Box p={2} mb={200}>\n  <Heading mb={2}>Relative + Absolute</Heading>\n  <Relative size={128} mx={128} my={6}>\n    <Box borderWidth=\"1px\" borderStyle=\"solid\" borderColor=\"border.default\" borderRadius={2} size=\"100%\">\n      <Absolute left=\"100%\" top={0} color=\"fg.onEmphasis\" bg=\"success.emphasis\" p={1}>\n        rt\n      </Absolute>\n      <Absolute right=\"100%\" top={0} color=\"fg.onEmphasis\" bg=\"success.emphasis\" p={1}>\n        lt\n      </Absolute>\n      <Absolute left=\"100%\" bottom={0} color=\"fg.onEmphasis\" bg=\"success.emphasis\" p={1}>\n        rb\n      </Absolute>\n      <Absolute right=\"100%\" bottom={0} color=\"fg.onEmphasis\" bg=\"success.emphasis\" p={1}>\n        lb\n      </Absolute>\n      <Absolute left={0} top=\"100%\" color=\"fg.onEmphasis\" bg=\"success.emphasis\" p={1}>\n        bl\n      </Absolute>\n      <Absolute right={0} top=\"100%\" color=\"fg.onEmphasis\" bg=\"success.emphasis\" p={1}>\n        br\n      </Absolute>\n      <Absolute left={0} bottom=\"100%\" color=\"fg.onEmphasis\" bg=\"success.emphasis\" p={1}>\n        tl\n      </Absolute>\n      <Absolute right={0} bottom=\"100%\" color=\"fg.onEmphasis\" bg=\"success.emphasis\" p={1}>\n        tr\n      </Absolute>\n    </Box>\n  </Relative>\n\n  <Heading my={2}>Sticky</Heading>\n\n  <Box borderWidth=\"1px\" borderStyle=\"solid\" borderColor=\"success.emphasis\" borderRadius={2} border={1} height={500}>\n    <Sticky top={0} bg=\"success.subtle\" p={6}>\n      I'm sticky!\n    </Sticky>\n  </Box>\n\n  <Heading my={2}>Fixed</Heading>\n  <p>(see the bottom right of the screen)</p>\n\n  <Fixed bottom={0} right={0} color=\"fg.onEmphasis\" bg=\"danger.emphasis\" p={2}>\n    I'm fixed to the bottom right.\n  </Fixed>\n</Box>\n```\n\n## System props\n\nPosition components get `POSITION`, `LAYOUT`, `FLEX`, and `COMMON` system props. Read our [System Props](/system-props) doc page for a full list of available props.\n\n## Component props\n\nPosition does not get any additional props other than the system props mentioned above.\n","parent":{"relativeDirectory":"deprecated","name":"Position"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/deprecated/SelectMenu.md","frontmatter":{"title":"SelectMenu"},"rawBody":"---\ntitle: SelectMenu\nstatus: Deprecated\n---\n\n## Deprecation\n\nUse [ActionMenu](/ActionMenu) instead.\n\n---\n\nThe `SelectMenu` components are a suite of components which can be combined together to make several different variations of our GitHub select menu. At it's most basic form, a select menu is comprised of a `SelectMenu` wrapper, which contains a `summary` component of your choice and a `Select.Modal` which contains the select menu content. Use `SelectMenu.List` to wrap items in the select menu, and `SelectMenu.Item` to wrap each item.\n\nSeveral additional components exist to provide even more functionality: `SelectMenu.Header`, `SelectMenu.Filter`, `SelectMenu.Tabs`, `SelectMenu.TabPanel` `SelectMenu.Footer` and `SelectMenu.Divider`.\n\n## Basic Example\n\n```jsx deprecated live\n<SelectMenu>\n  <Button as=\"summary\">Projects</Button>\n  <SelectMenu.Modal>\n    <SelectMenu.Header>Projects</SelectMenu.Header>\n    <SelectMenu.List>\n      <SelectMenu.Item href=\"#\">Primer React bugs</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Primer React roadmap</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\"> Project 3</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Project 4</SelectMenu.Item>\n    </SelectMenu.List>\n  </SelectMenu.Modal>\n</SelectMenu>\n```\n\n## SelectMenu\n\nMain wrapper component for select menu.\n\n```jsx deprecated\n<SelectMenu>{/* all other sub components are wrapped here*/}</SelectMenu>\n```\n\n### Component Props\n\n| Name       | Type              | Default | Description                                                                                                                              |\n| :--------- | :---------------- | :-----: | :--------------------------------------------------------------------------------------------------------------------------------------- |\n| initialTab | String            |         | If using the `SelectMenu.Tabs` component, you can use this prop to change the tab shown on open. By default, the first tab will be used. |\n| ref        | React ref         |         | ref to pass down to SelectMenu component                                                                                                 |\n| sx         | SystemStyleObject |   {}    | Style to be applied to the component                                                                                                     |\n\n## SelectMenu.MenuContext\n\nSelectMenu.MenuContext is a [context object](https://reactjs.org/docs/context.html#reactcreatecontext) that exposes some helpful state values to be used via [`React.useContext`](https://reactjs.org/docs/hooks-reference.html#usecontext) in consuming applications. SelectMenu.MenuContext can only be used in components that are already wrapped in a `SelectMenu` as `SelectMenu` contains the [context provider](https://reactjs.org/docs/context.html#contextprovider).\n\n### Values available on MenuContext\n\n| Name           | Type     | Description                                                                                                                                     |\n| :------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------- |\n| selectedTab    | string   | The currently selected tab                                                                                                                      |\n| setSelectedTab | function | Used to update the currently selected tab state                                                                                                 |\n| open           | boolean  | State for open/closed status of the menu modal                                                                                                  |\n| setOpen        | function | Used to update the `open` state                                                                                                                 |\n| initialTab     | string   | Mostly used internally to pass down which tab should be set to open by default. To change this value use the `initialTab` prop on `SelectMenu`. |\n\n### Example Usage\n\n```jsx deprecated\nimport {SelectMenu, Button} from `@primer/react`\nimport React, {useContext} from 'react'\n\nconst MyMenu = () => {\n  <SelectMenu>\n    <MyButton />\n    <SelectMenu.Modal>\n      content\n    </SelectMenu.Modal>\n  </SelectMenu>\n}\n\n// note that we can only use the context in components that are already wrapped by SelectMenu (and thus the Context.Provider)\nconst MyButton = () => {\n  const menuContext = useContext(SelectMenu.MenuContext);\n\n  return (\n    <Button as=\"summary\">{menuContext.open ? 'Open' : 'Closed'}</Button>\n  )\n}\n```\n\n## SelectMenu.Modal\n\nUsed to wrap the content in a `SelectMenu`.\n\n```jsx deprecated\n<SelectMenu.Modal>{/* all menu content is wrapped in the modal*/}</SelectMenu.Modal>\n```\n\n### Right-aligned modal\n\nUse the `align='right'` prop to align the modal to the right. Note that this only modifies alignment for the modal, and not the SelectMenu itself. You will need to wrap the SelectMenu in a relatively positioned element for this to work properly.\n\n```jsx deprecated live\n<Box position=\"relative\" display=\"flex\" justifyContent=\"flex-end\">\n  <SelectMenu>\n    <Button as=\"summary\">Projects</Button>\n    <SelectMenu.Modal align=\"right\">\n      <SelectMenu.Header>Projects</SelectMenu.Header>\n      <SelectMenu.List>\n        <SelectMenu.Item href=\"#\">Primer React bugs</SelectMenu.Item>\n        <SelectMenu.Item href=\"#\">Primer React roadmap</SelectMenu.Item>\n        <SelectMenu.Item href=\"#\"> Project 3</SelectMenu.Item>\n        <SelectMenu.Item href=\"#\">Project 4</SelectMenu.Item>\n      </SelectMenu.List>\n    </SelectMenu.Modal>\n  </SelectMenu>\n</Box>\n```\n\n### Component Props\n\n| Prop name | Type              | Default | Description                                       |\n| :-------- | :---------------- | :------ | ------------------------------------------------- |\n| align     | String            | 'left'  | Use `right` to align the select menu to the right |\n| width     | String or Number  | 300px   | Sets the modal width                              |\n| sx        | SystemStyleObject | {}      | Style to be applied to the component              |\n\n## SelectMenu.List\n\nUsed to wrap the select menu list content. All menu items **must** be wrapped in a SelectMenu.List in order for the accessibility keyboard handling to function properly. If you are using the `SelectMenu.TabPanel` you do not need to provide a `SelectMenu.List` as that component renders a `SelectMenu.List` as a wrapper.\n\n```jsx deprecated\n<SelectMenu.List>{/* all menu  list items are wrapped in the list*/}</SelectMenu.List>\n```\n\n### Component Props\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n\n## SelectMenu.Item\n\nIndividual items in a select menu. SelectMenu.Item renders an anchor tag by default, you'll need to make sure to provide the appropriate `href`.\n\nYou can use a `button` tag instead by utilizing the [`as` prop](/core-concepts#the-as-prop). Be sure to consider [which HTML element is the right choice](https://marcysutton.com/links-vs-buttons-in-modern-web-applications) for your usage of the component.\n\n```jsx deprecated\n<SelectMenu.Item href=\"/link/to/thing\" selected={true}>\n  {/* wraps an individual list item*/}\n</SelectMenu.Item>\n```\n\n### Component Props\n\n| Name     | Type              | Default | Description                                                                                                                                                                                    |\n| :------- | :---------------- | :-----: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| selected | boolean           |         | Used to apply styles to the selected items in the list.                                                                                                                                        |\n| onClick  | function          |         | Function called when item is clicked. By default we also close the menu when items are clicked. If you would like the menu to stay open, pass an `e.preventDefault()` to your onClick handler. |\n| sx       | SystemStyleObject |   {}    | Style to be applied to the component                                                                                                                                                           |\n\n## SelectMenu.Filter\n\nUse a `SelectMenu.Filter` to add a filter UI to your select menu. Users are expected to implement their own filtering and manage the state of the `value` prop on the input. This gives users more flexibility over the type of filtering and type of content passed into each select menu item.\n\n```jsx deprecated live\n<SelectMenu>\n  <Button as=\"summary\">Projects</Button>\n  <SelectMenu.Modal>\n    <SelectMenu.Header>Filter by Project</SelectMenu.Header>\n    <SelectMenu.Filter placeholder=\"Filter projects\" value=\"\" aria-label=\"Filter Projects\" />\n    <SelectMenu.List>\n      <SelectMenu.Item href=\"#\">Primer React bugs</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Primer React roadmap</SelectMenu.Item>\n      <SelectMenu.Divider>More Options</SelectMenu.Divider>\n      <SelectMenu.Item href=\"#\"> Project 3</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Project 4</SelectMenu.Item>\n    </SelectMenu.List>\n  </SelectMenu.Modal>\n</SelectMenu>\n```\n\n### Component Props\n\nSelectMenu.Filter components receive all the props that the [TextInput](/TextInput) component gets.\n\n| Name  | Type              | Default | Description                                                                                                    |\n| :---- | :---------------- | :-----: | :------------------------------------------------------------------------------------------------------------- |\n| value | String            |         | Users of this component must provide a value for the filter input that is managed in the consuming application |\n| sx    | SystemStyleObject |   {}    | Style to be applied to the component                                                                           |\n\n## SelectMenu.Tabs\n\nUse `SelectMenu.Tabs` to wrap the tab navigation and `SelectMenu.Tab` for each tab in the navigation.\n\n`SelectMenu.TabPanel` should wrap each corresponding panel for each of the tabs. The `tabName` prop for each `SelectMenu.TabPanel` must match the name provided in the `tabName` prop on `SelectMenu.Tab`.\n\nTo set one of the tabs to be open by default, use `initialTab` on the main `SelectMenu` component. Otherwise, the first tab will be shown by default.\n\nEach `Select.Menu` tab will need to have an `index` prop. The first tab should be at index `0`, the second at index `1` and so forth. The `index` prop is used to show the first tab by default.\n\nIf you need access to the selected tab state, you can find it in the MenuContext object exported from `SelectMenu` as `MenuContext.selectedTab`.\n\n```jsx deprecated live\n<SelectMenu>\n  <Button as=\"summary\">Projects</Button>\n  <SelectMenu.Modal>\n    <SelectMenu.Header>Projects</SelectMenu.Header>\n    <SelectMenu.Tabs>\n      <SelectMenu.Tab index={0} tabName=\"Repository\" />\n      <SelectMenu.Tab index={1} tabName=\"Organization\" />\n    </SelectMenu.Tabs>\n    <SelectMenu.TabPanel tabName=\"Repository\">\n      <SelectMenu.Item href=\"#\">Primer React bugs</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Primer React roadmap</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\"> Project 3</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Project 4</SelectMenu.Item>\n    </SelectMenu.TabPanel>\n    <SelectMenu.TabPanel tabName=\"Organization\">\n      <SelectMenu.Item href=\"#\"> Project 2</SelectMenu.Item>\n    </SelectMenu.TabPanel>\n    <SelectMenu.Footer>Showing 3 of 3</SelectMenu.Footer>\n  </SelectMenu.Modal>\n</SelectMenu>\n```\n\n### Component Props\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n\n## SelectMenu.Tab\n\nUsed for each individual tab inside of a `SelectMenu.Tabs`. Be sure to set the `index` prop to correspond to the order the tab is in. The `tabName` prop should correspond to the `tabName` set on the `SelectMenu.TabPanel`.\n\nThe `onClick` prop is optional and can be used for any events or data fetching you might need to trigger on tab clicks.\n\n```jsx deprecated\n<>\n  <SelectMenu.Tab index={0} tabName=\"Repository\" />\n  <SelectMenu.Tab index={1} tabName=\"Organization\" />\n</>\n```\n\n### Component Props\n\n| Name    | Type              | Default | Description                                                                                                                |\n| :------ | :---------------- | :-----: | :------------------------------------------------------------------------------------------------------------------------- |\n| tabName | String            |         | Used to identify the corresponding tab. Must match the string used in the `tabs` array in the `SelectMenu.Tabs` component. |\n| index   | Number            |         | The index at which the tab is in the list of tabs                                                                          |\n| onClick | Function          |         | Function to be called when the tab is clicked. Optional.                                                                   |\n| sx      | SystemStyleObject |   {}    | Style to be applied to the component                                                                                       |\n\n## SelectMenu.TabPanel\n\nWraps the content for each tab. Make sure to use the `tabName` prop to identify each tab panel with the correct tab in the tab navigation.\n\n**Note**: SelectMenu.TabPanel wraps content in a SelectMenu.List, so adding a SelectMenu.List manually is not necessary.\n\n```jsx deprecated\n<SelectMenu.TabPanel tabName=\"Repository\">{/* Wraps content for each tab */}</SelectMenu.TabPanel>\n```\n\n### Component Props\n\n| Name    | Type              | Default | Description                                                                                                                |\n| :------ | :---------------- | :-----: | :------------------------------------------------------------------------------------------------------------------------- |\n| tabName | String            |         | Used to identify the corresponding tab. Must match the string used in the `tabs` array in the `SelectMenu.Tabs` component. |\n| sx      | SystemStyleObject |   {}    | Style to be applied to the component                                                                                       |\n\n## SelectMenu.Divider\n\nUse a `SelectMenu.Divider` to add information between items in a `SelectMenu.List`.\n\n```jsx deprecated live\n<SelectMenu>\n  <Button as=\"summary\">Projects</Button>\n  <SelectMenu.Modal>\n    <SelectMenu.Header>Projects</SelectMenu.Header>\n    <SelectMenu.List>\n      <SelectMenu.Item href=\"#\">Primer React bugs</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Primer React roadmap</SelectMenu.Item>\n      <SelectMenu.Divider>More Options</SelectMenu.Divider>\n      <SelectMenu.Item href=\"#\"> Project 3</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Project 4</SelectMenu.Item>\n    </SelectMenu.List>\n  </SelectMenu.Modal>\n</SelectMenu>\n```\n\n### Component Props\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n\n## SelectMenu.Footer\n\nUse a `SelectMenu.Footer` to add content to the bottom of the select menu.\n\n```jsx deprecated live\n<SelectMenu>\n  <Button as=\"summary\">Projects</Button>\n  <SelectMenu.Modal>\n    <SelectMenu.Header>Projects</SelectMenu.Header>\n    <SelectMenu.List>\n      <SelectMenu.Item href=\"#\">Primer React bugs</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Primer React roadmap</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\"> Project 3</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Project 4</SelectMenu.Item>\n      <SelectMenu.Footer>Use ⌥ + click/return to exclude labels.</SelectMenu.Footer>\n    </SelectMenu.List>\n  </SelectMenu.Modal>\n</SelectMenu>\n```\n\n### Component Props\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n\n## SelectMenu.Header\n\nUse a `SelectMenu.Header` to add a header to the top of the select menu content.\n\n```jsx deprecated live\n<SelectMenu>\n  <Button as=\"summary\">Projects</Button>\n  <SelectMenu.Modal>\n    <SelectMenu.Header>Projects</SelectMenu.Header>\n    <SelectMenu.List>\n      <SelectMenu.Item href=\"#\">Primer React bugs</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Primer React roadmap</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\"> Project 3</SelectMenu.Item>\n      <SelectMenu.Item href=\"#\">Project 4</SelectMenu.Item>\n      <SelectMenu.Footer>Use ⌥ + click/return to exclude labels.</SelectMenu.Footer>\n    </SelectMenu.List>\n  </SelectMenu.Modal>\n</SelectMenu>\n```\n\n### Component Props\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n\n## SelectMenu.LoadingAnimation\n\nUse a `SelectMenu.LoadingAnimation` to add a loading animation inside of the SelectMenu.\n\n**Note**: You will need to handle showing/hiding the appropriate modal content for your application during the loading state. We recommend always showing the `SelectMenu.Filter` and `SelectMenu.Header` (if used) and hiding the rest of the modal content during the loading state.\n\n```jsx deprecated live\n<SelectMenu>\n  <Button as=\"summary\">Projects</Button>\n  <SelectMenu.Modal>\n    <SelectMenu.Header>Projects</SelectMenu.Header>\n    <SelectMenu.Filter placeholder=\"Filter projects\" value=\"\" aria-label=\"Filter Projects\" />\n    {true ? (\n      <SelectMenu.LoadingAnimation />\n    ) : (\n      <SelectMenu.List>\n        <SelectMenu.Item href=\"#\">Primer React bugs</SelectMenu.Item>\n        <SelectMenu.Item href=\"#\">Primer React roadmap</SelectMenu.Item>\n        <SelectMenu.Item href=\"#\"> Project 3</SelectMenu.Item>\n        <SelectMenu.Item href=\"#\">Project 4</SelectMenu.Item>\n        <SelectMenu.Footer>Use ⌥ + click/return to exclude labels.</SelectMenu.Footer>\n      </SelectMenu.List>\n    )}\n  </SelectMenu.Modal>\n</SelectMenu>\n```\n\n### Component Props\n\n| Name | Type              | Default | Description                          |\n| :--- | :---------------- | :-----: | :----------------------------------- |\n| sx   | SystemStyleObject |   {}    | Style to be applied to the component |\n","parent":{"relativeDirectory":"deprecated","name":"SelectMenu"}},{"fileAbsolutePath":"/home/runner/work/react/react/docs/content/drafts/Dialog.mdx","frontmatter":{"title":"Dialog v2"},"rawBody":"---\ntitle: Dialog v2\ncomponentId: dialog\nstatus: Draft\n---\n\n```js\nimport {Dialog} from '@primer/react/drafts'\n```\n\nimport State from '../../components/State'\n\nThe dialog component the Primer implementation of the ARIA design pattern [Dialog](https://www.w3.org/TR/wai-aria-practices-1.1/#dialog_modal). A dialog is a type of overlay that can be used for confirming actions, asking for disambiguation, and presenting small forms. They generally allow the user to focus on a quick task without having to navigate to a different page.\n\n**Dialogs appear in the page after a direct user interaction**. Don't show dialogs on page load or as system alerts.\n\n**Dialogs appear centered in the page**, with a visible backdrop that dims the rest of the window for focus.\n\n**All dialogs should have a title and a close button**. Use the `title` prop to set the title. The close button is created automatically, but must be handled with an `onClose` prop.\n\n**Dialogs are modal**. Dialogs can be dismissed by clicking on the close button, or by interacting with another button in the overlay. To avoid losing information and missing important messages, clicking outside of the dialog will not close it.\n\n**(Coming soon) Make sure larger dialogs remain mobile-friendly**. Even large dialogs need to be responsive. A dialog's width and height will be readjusted depending on the screen size and should never exceed the available space. Use responsive solutions to adjust the UI so they behave well on smaller screens.\n\n**(Coming soon) Simple and small dialogs can remain as-is on mobile**. As more elements are added to it, mobile-specific style variations such as **Bottom sheet** and **Full-screen** should be considered.\n\n### State\n\nThe dialog component is completely stateless. The parent component must conditionally render a dialog based on the necessary criteria. The parent component can be notified by a gesture to close the dialog (e.g. by clicking the \"X\" button or by pressing the Escape key) by passing in the `onClose` prop.\n\n### Accessibility\n\nThe dialog component is fully accessible out-of-the-box. The dialog's title is used for `aria-labelledby`, and the dialog's description is used for `aria-describedby`. The `aria-modal=\"true\"` attribute is used to inform screen readers that the rest of the content on the page is inert.\n\n#### Keyboard\n\nThe default keyboard API for a dialog employs three mechanisms:\n\n1. The Escape key can be pressed to close the dialog.\n2. Focus is trapped within the top-most dialog. When a dialog is opened, the close button receives initial focus by default, or on a button defined with `autoFocus: true`.\n3. If there are buttons in the dialog footer, focus can be moved between them with left and right arrow keys or tab/shift+tab.\n4. When a dialog is closed, it can optionally handle returning focus to the element that was focused immediately before the dialog was opened. Otherwise, it is the consumer's responsibility to move focus to a suitable element.\n\n### Custom rendering\n\n**Note: using custom rendering allows breaking out of the defined design, UX, and accessibility patterns of the dialog. Use only as a last resort.**\n\nBy default, the Dialog component implements the design and interactions defined by the Primer design system. If necessary, you can provide custom renderers for the header, body, or footer using the `renderHeader`, `renderBody`, and `renderFooter` props, respectively. The JSX produced by these render props will render full-bleed into their respective areas of the dialog. If you are using the custom renderers, you should use the provided sub-components `Dialog.Header`, `Dialog.Title`, `Dialog.Subtitle`, `Dialog.CloseButton`, `Dialog.Body`, `Dialog.Footer`, and `Dialog.Buttons` to the extent possible.\n\n### Example\n\n```jsx live drafts\n<State default={false}>\n  {([isOpen, setIsOpen]) => {\n    const openDialog = React.useCallback(() => setIsOpen(true), [setIsOpen])\n    const closeDialog = React.useCallback(() => setIsOpen(false), [setIsOpen])\n    return (\n      <>\n        <Button onClick={openDialog}>Open</Button>\n        {isOpen && (\n          <Dialog\n            title=\"Dialog example\"\n            subtitle={\n              <>\n                This is a <b>description</b> of the dialog.\n              </>\n            }\n            footerButtons={[{content: 'Ok', onClick: closeDialog}]}\n            onClose={closeDialog}\n          >\n            <Text fontFamily=\"sans-serif\">Some content</Text>\n          </Dialog>\n        )}\n      </>\n    )\n  }}\n</State>\n```\n\n## Component props\n\n### DialogProps\n\n| Prop name     | Type                                           | Default    | Description                                                                                                                                                                                                                                                             |\n| :------------ | :--------------------------------------------- | :--------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| title         | `React.ReactNode`                              | `\"Dialog\"` | Sets the title of the dialog, which by default is also used as the `aria-labelledby` attribute.                                                                                                                                                                         |\n| subtitle      | `React.ReactNode`                              |            | Optional. Sets the subtitle of the dialog, which by default is also used as the `aria-describedby` attribute.                                                                                                                                                           |\n| renderHeader  | `(props: DialogHeaderProps) => JSX.Element`    |            | Optional. Custom render the dialog header. See \"Custom rendering\" above for more info.                                                                                                                                                                                  |\n| renderBody    | `(props: DialogProps) => JSX.Element`          |            | Optional. Custom render the dialog body. See \"Custom rendering\" above for more info.                                                                                                                                                                                    |\n| renderFooter  | `(props: DialogProps) => JSX.Element`          |            | Optional. Custom render the dialog footer. See \"Custom rendering\" above for more info.                                                                                                                                                                                  |\n| footerButtons | `DialogButtonProps[]`                          |            | Optional. Specify buttons that will be rendered in the footer of the dialog.                                                                                                                                                                                            |\n| onClose       | `(gesture: 'close-button' │ 'escape') => void` |            | Required. This method is invoked when a gesture to close the dialog is used (either an Escape key press or clicking the \"X\" in the top-right corner). The gesture argument indicates the gesture that was used to close the dialog (either 'close-button' or 'escape'). |\n| role          | `\"dialog\" │ \"alertdialog\"`                     | `\"dialog\"` | The ARIA role given to the dialog element. More info: [dialog](https://www.w3.org/TR/wai-aria-practices-1.1/#dialog_modal), [alertdialog](https://www.w3.org/TR/wai-aria-practices-1.1/#alertdialog)                                                                    |\n| width         | `\"small\" │ \"medium\" │ \"large\" │ \"xlarge\"`      | `\"xlarge\"` | The fixed width of the dialog.                                                                                                                                                                                                                                          |\n| height        | `\"small\" │ \"large\" │ \"auto\"`                   | `\"auto\"`   | The fixed height of the dialog, or, auto to adjust the height based on its contents.                                                                                                                                                                                    |\n| sx            | `SystemStyleObject`                            | {}         | Style to be applied to the component                                                                                                                                                                                                                                    |\n\n### DialogHeaderProps\n\nThe `DialogHeaderProps` interface extends `DialogProps` and adds these additional properties:\n\n| Prop name           | Type     | Description                                                                                                                                                     |\n| :------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| dialogLabelId       | `string` | ID of the element that will be used as the `aria-labelledby` attribute on the dialog. This ID should be set to the element that renders the dialog's title.     |\n| dialogDescriptionId | `string` | ID of the element that will be used as the `aria-describedby` attribute on the dialog. This ID should be set to the element that renders the dialog's subtitle. |\n\n### DialogButtonProps\n\nThe `DialogButtonProps` interface extends `ButtonProps` (see Button) and adds these additional properties:\n\n| Prop name  | Type                              | Default  | Description                                                                                                                                                        |\n| :--------- | :-------------------------------- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| buttonType | `\"normal\" │ \"primary\" │ \"danger\"` | `Button` | The type of button to render                                                                                                                                       |\n| content    | `React.ReactNode`                 |          | Required. The button's inner content.                                                                                                                              |\n| autoFocus  | `boolean`                         | false    | If true, this button will be automatically focused when the dialog is first rendered. If `autoFocus` is true on subsequent button definitions, it will be ignored. |\n\n## ConfirmationDialog\n\nA `ConfirmationDialog` is a special kind of dialog with more rigid behavior. It is used to confirm a user action. `ConfirmationDialog`s always have exactly two buttons: one to cancel the action and one to confirm it. No custom rendering capabilities are provided for ConfirmationDialog.\n\n### useConfirm hook\n\nAn alternate way to use `ConfirmationDialog` is with the `useConfirm()` hook. It takes no parameters and returns an `async` function, `confirm`. When `confirm` is called (see ConfirmOptions below for its argument), it shows the confirmation dialog. When the dialog is dismissed, a promise is resolved with `true` or `false` depending on whether or not the confirm button was used.\n\n### Example (with `useConfirm` hook)\n\n```javascript live noinline\nfunction ShorthandExample2() {\n  const confirm = useConfirm()\n  const buttonClick = React.useCallback(\n    async function (e) {\n      if (await confirm({title: 'Are you sure?', content: 'You must confirm this action to continue.'})) {\n        e.target.textContent = 'Confirmed!'\n      }\n    },\n    [confirm]\n  )\n  return (\n    <>\n      <Button onClick={buttonClick}>Confirmable action</Button>\n    </>\n  )\n}\nrender(<ShorthandExample2 />)\n```\n\n### Example (using the full `ConfirmationDialog` component)\n\n```jsx live\n<State default={false}>\n  {([isOpen, setIsOpen]) => {\n    const openDialog = React.useCallback(() => setIsOpen(true), [setIsOpen])\n    const closeDialog = React.useCallback(() => setIsOpen(false), [setIsOpen])\n    return (\n      <>\n        <Button onClick={openDialog}>Open</Button>\n        {isOpen && (\n          <ConfirmationDialog title=\"Confirm action?\" onClose={closeDialog}>\n            Are you sure you want to confirm this action?\n          </ConfirmationDialog>\n        )}\n      </>\n    )\n  }}\n</State>\n```\n\n### ConfirmationDialogProps\n\n| Prop name            | Type                                                                  | Default    | Description                                                                                                                   |\n| :------------------- | :-------------------------------------------------------------------- | :--------- | :---------------------------------------------------------------------------------------------------------------------------- |\n| title                | `React.ReactNode`                                                     |            | Required. Sets the title of the dialog, which by default is also used as the `aria-labelledby` attribute.                     |\n| onClose              | `(gesture: 'confirm' │ 'cancel' │ 'close-button' │ 'escape') => void` |            | Required. This callback is invoked when a gesture to close the dialog is performed. The first argument indicates the gesture. |\n| cancelButtonContent  | `React.ReactNode`                                                     | `\"Cancel\"` | The content to use for the cancel button.                                                                                     |\n| confirmButtonContent | `React.ReactNode`                                                     | `\"OK\"`     | The content to use for the confirm button.                                                                                    |\n| confirmButtonType    | `\"normal\" │ \"primary\" │ \"danger\"`                                     | `Button`   | The type of button to use for the confirm button.                                                                             |\n\n### ConfirmOptions\n\n| Prop name            | Type                              | Default    | Description                                                                                               |\n| :------------------- | :-------------------------------- | :--------- | :-------------------------------------------------------------------------------------------------------- |\n| title                | `React.ReactNode`                 |            | Required. Sets the title of the dialog, which by default is also used as the `aria-labelledby` attribute. |\n| content              | `React.ReactNode`                 |            | Required. Used as the body of the ConfirmationDialog that is displayed.                                   |\n| cancelButtonContent  | `React.ReactNode`                 | `\"Cancel\"` | The content to use for the cancel button.                                                                 |\n| confirmButtonContent | `React.ReactNode`                 | `\"OK\"`     | The content to use for the confirm button.                                                                |\n| confirmButtonType    | `\"normal\" │ \"primary\" │ \"danger\"` | `Button`   | The type of button to use for the confirm button.                                                         |\n","parent":{"relativeDirectory":"drafts","name":"Dialog"}}]}}}