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.
One
Two
Three
Tab one content
Tab two content
Tab three content
Contains all the tabs component parts.
Prop | Type | Default | Required |
---|---|---|---|
as | enum | div | |
defaultValue | string | ||
value | string | ||
onValueChange | function | ||
orientation | enum | "horizontal" | |
activationMode | enum | "automatic" |
Contains the tabs aligned along the edge of the active panel.
Prop | Type | Default | Required |
---|---|---|---|
as | enum | div | |
loop | boolean | true |
The button that activates its associated panel.
Prop | Type | Default | Required |
---|---|---|---|
as | enum | div | |
value | string | ||
disabled | boolean | false |
Contains the content associated with each tab.
Prop | Type | Default | Required |
---|---|---|---|
as | enum | div | |
value | string |
You can create a vertical tab by using the orientation
prop.
One
Two
Three
Tab one content
Tab two content
Tab three content
Adheres to the Tabs WAI-ARIA design pattern.
Key | Description |
---|---|
Tab | When focus moves onto the tabs, focuses the active tab. When a tab contains focus, moves focus to the active panel. |
ArrowDown | Moves focus to the next tab depending on orientation and activates its associated panel. |
ArrowRight | Moves focus to the next tab depending on orientation and activates its associated panel. |
ArrowUp | Moves focus to the previous tab depending on orientation and activates its associated panel. |
ArrowLeft | Moves focus to the previous tab depending on orientation and activates its associated panel. |
Home | Moves focus to the first tab and activates its associated panel. |
End | Moves focus to the last tab and activates its associated panel. |