Tabs

Tabs is a component for switching between different display areas.

クリリンのことか……クリリンのことかーーーっ!!!!!

Usage

import { Tabs } from "@yamada-ui/react"
<Tabs.Root>
  <Tabs.List>
    <Tabs.Tab />
  </Tabs.List>
  <Tabs.Panels>
    <Tabs.Panel />
  </Tabs.Panels>
</Tabs.Root>

Use items

クリリンのことか……クリリンのことかーーーっ!!!!!

Change Variants

クリリンのことか……クリリンのことかーーーっ!!!!!
クリリンのことか……クリリンのことかーーーっ!!!!!
クリリンのことか……クリリンのことかーーーっ!!!!!
クリリンのことか……クリリンのことかーーーっ!!!!!

Change Size

クリリンのことか……クリリンのことかーーーっ!!!!!
クリリンのことか……クリリンのことかーーーっ!!!!!
クリリンのことか……クリリンのことかーーーっ!!!!!

Select a Default Item

へっ!きたねぇ花火だ

Change Orientation

クリリンのことか……クリリンのことかーーーっ!!!!!
クリリンのことか……クリリンのことかーーーっ!!!!!

Change Alignment

クリリンのことか……クリリンのことかーーーっ!!!!!
クリリンのことか……クリリンのことかーーーっ!!!!!
クリリンのことか……クリリンのことかーーーっ!!!!!

Stretch to Container Width

クリリンのことか……クリリンのことかーーーっ!!!!!

Disable

クリリンのことか……クリリンのことかーーーっ!!!!!

Manual Activation

By default, the focused tab is automatically activated. If you want to activate the tab at a specific time (when Enter or Space is pressed), set manual to true.

クリリンのことか……クリリンのことかーーーっ!!!!!
クリリンのことか……クリリンのことかーーーっ!!!!!

Lazy Rendering

クリリンのことか……クリリンのことかーーーっ!!!!!
クリリンのことか……クリリンのことかーーーっ!!!!!

Dynamic Tabs

Tab Content baaa54c1-3182-44da-01bd-db0d3845aef1

index: 0

id: baaa54c1-3182-44da-01bd-db0d3845aef1

Customize Tabs

クリリンのことか……クリリンのことかーーーっ!!!!!

Control

クリリンのことか……クリリンのことかーーーっ!!!!!

Props

Accessibility

Tabs follows the WAI-ARIA - Tabs Pattern for accessibility.

Keyboard Navigation

KeyDescriptionState
TabFocuses the active tab when focus moves to the tab list. Moves focus to the tab panel if already within the tab list.-
ArrowLeftFocuses the previous tab that is not disabled. If it's the first tab, focuses the last tab that is not disabled.orientation="horizontal"
ArrowRightFocuses the next tab that is not disabled. If it's the last tab, focuses the first tab that is not disabled.orientation="horizontal"
ArrowUpFocuses the previous tab that is not disabled. If it's the first tab, focuses the last tab that is not disabled.orientation="vertical"
ArrowDownFocuses the next tab that is not disabled. If it's the last tab, focuses the first tab that is not disabled.orientation="vertical"
Space, EnterActivates the focused tab.manual={true}
HomeFocuses the first tab that is not disabled.-
EndFocuses the last tab that is not disabled.-

ARIA Roles and Attributes

ComponentRoles and AttributesUsage
Tabs.Listrole="tablist"Indicates that this is a tab list.
aria-orientationSets to "horizontal" or "vertical" based on orientation. The default is "horizontal".
Tabs.Tabrole="tab"Indicates that this is a tab.
aria-selectedSets to "true" when the tab is selected, "false" when not selected.
aria-controlsSets the id of the associated Tabs.Panel.
Tabs.Panelrole="tabpanel"Indicates that this is a tab panel.
aria-labelledbySets the id of the associated Tabs.Tab.