Tabs

A set of layered sections of content—known as tab panels—that display one panel of content at a time.

Features

  • Can be controlled or uncontrolled.
  • Supports horizontal/vertical orientation.
  • Supports automatic/manual activation.
  • Full keyboard navigation.

Install the component from your command line.

Import the components and piece the parts together.

Create your styled tabs component from the primitive parts.

Tab one content

Contains all the tabs component parts.

PropTypeDefaultRequired
asenumdiv
defaultValuestring
valuestring
onValueChangefunction
orientationenum"horizontal"
activationModeenum"automatic"

Contains the tabs aligned along the edge of the active panel.

PropTypeDefaultRequired
asenumdiv
loopbooleantrue

The button that activates its associated panel.

PropTypeDefaultRequired
asenumdiv
valuestring
disabledbooleanfalse

Contains the content associated with each tab.

PropTypeDefaultRequired
asenumdiv
valuestring

You can create a vertical tab by using the orientation prop.

Tab one content

Adheres to the Tabs WAI-ARIA design pattern.

KeyDescription
TabWhen focus moves onto the tabs, focuses the active tab. When a tab contains focus, moves focus to the active panel.
ArrowDownMoves focus to the next tab depending on orientation and activates its associated panel.
ArrowRightMoves focus to the next tab depending on orientation and activates its associated panel.
ArrowUpMoves focus to the previous tab depending on orientation and activates its associated panel.
ArrowLeftMoves focus to the previous tab depending on orientation and activates its associated panel.
HomeMoves focus to the first tab and activates its associated panel.
EndMoves focus to the last tab and activates its associated panel.