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
asenumdivNot required
defaultValuestringNo default valueNot required
valuestringNo default valueNot required
onValueChangefunctionNo default valueNot required
orientationenum"horizontal"Not required
activationModeenum"automatic"Not required

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

PropTypeDefaultRequired
asenumdivNot required
loopbooleantrueNot required

The button that activates its associated panel.

PropTypeDefaultRequired
asenumdivNot required
valuestringNo default valueRequired
disabledbooleanfalseNot required

Contains the content associated with each tab.

PropTypeDefaultRequired
asenumdivNot required
valuestringNo default valueRequired

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.