Leave Yamada UI a star

Star
Yamada UIYamada UIv1.5.4

Tabs

Tabs is a component for switching between different display areas.

Source@yamada-ui/tabs

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

When using only icons in Tab, set aria-label for the Tab.

<Tabs>
<Tab>フリーザ</Tab>
<Tab aria-label="Send an email to Freeza">
<Mail />
</Tab>
<TabPanel>
私の戦闘力は530000です。ですがもちろんフルパワーであなたと戦う気はありませんからご心配なく……
</TabPanel>
<TabPanel>フリーザ様にメールを送る</TabPanel>
</Tabs>
Copied!

Setting aria-label on TabList will make it readable by screen readers.

<Tabs tabListProps={{ "aria-label": "DRAGON BALL characters" }}>
<Tab>孫悟空</Tab>
<Tab>ベジータ</Tab>
<Tab>フリーザ</Tab>
<TabPanel>クリリンのことか……クリリンのことかーーーっ!!!!!</TabPanel>
<TabPanel>へっ!きたねぇ花火だ</TabPanel>
<TabPanel>
私の戦闘力は530000です。ですがもちろんフルパワーであなたと戦う気はありませんからご心配なく……
</TabPanel>
</Tabs>
Copied!

Or,

<Tabs>
<TabList aria-label="DRAGON BALL characters">
<Tab>孫悟空</Tab>
<Tab>ベジータ</Tab>
<Tab>フリーザ</Tab>
</TabList>
<TabPanel>クリリンのことか……クリリンのことかーーーっ!!!!!</TabPanel>
<TabPanel>へっ!きたねぇ花火だ</TabPanel>
<TabPanel>
私の戦闘力は530000です。ですがもちろんフルパワーであなたと戦う気はありませんからご心配なく……
</TabPanel>
</Tabs>
Copied!

Keyboard Navigation

KeyDescriptionState
TabWhen focus moves to the tab list, it focuses the active tab.-
ArrowLeftFocuses and activates the previous tab that is not disabled.orientation="horizontal"
ArrowRightFocuses and activates the next tab that is not disabled.orientation="horizontal"
ArrowUpFocuses and activates the previous tab that is not disabled.orientation="vertical"
ArrowDownFocuses and activates the next tab that is not disabled.orientation="vertical"
Space, EnterActivates the tab that is in focus.isManual={true}
HomeFocuses and activates the first tab that is not disabled.-
EndFocuses and activates the last tab that is not disabled.-

ARIA Roles and Attributes

ComponentRoles and AttributesUsage
TabListrole="tablist"Indicates that it is a tab list.
aria-orientationSets to "horizontal" or "vertical" based on the value of orientation.
Tabrole="tab"Indicates that it is a tab.
idThe id used to associate with role="tabpanel".
aria-controlsSets the id of the associated role="tabpanel".
aria-selectedSets to true if the tab is active, and sets to false for all other tabs.
TabPanelrole="tabpanel"Indicates that it is a tab panel.
idThe id used to associate with role="tab".
aria-labelledbySets the id of the associated role="tab".

Edit this page on GitHub

PreviousAccordionNextTree