Overview
The tab component allows users to navigate to different sections of content within a single page.
Tabs helps group different content together in a limited space and helps divide dense content into individually accessible sections to make it easier for the user to read.
When to use
- To have lots of content that is related in a limited amount of space
- To let the user compare easily related products (i.e. pricing plans)
When not to use
- To present FAQ - use Accordion
- To present Steps in a process - use Stepper
Anatomy
- TabList
- Tab
- Tab active
- Tab icon
- Tab Panel
Variants & States
Variant
There are two main variants for this component. Underlined and pilled. The default variant is underlined and should be used in most cases. The pilled variant should only be used to communicate more of a choice, like in a pricing page comparing plans.
Icon
Tabs can have optional icons included in them to support the text visually.
States
The tab component makes use of two main states: default & hover. Only one tab at a time can be active
TabPaddingBottom
The tabPaddingBottom property of the TabList component adjusts the space between the tabs and the content that follows. Two options are available: lg and md, with lg as the default value.
Internationalization
For RTL (right-to-left) languages, there are no custom adjustments made.
Writing Guidelines
Minimal effort for the minimalistic component — our goal is to make the copy convey as much sense as possible while being really short.
Properties
| Name | Type | Values | Description |
|---|---|---|---|
| variant | String | underlinedpilled |
|
| isActive | Boolean | truefalse |
|
| disabled | Boolean | truefalse |
|
| text | String |
Usage Guidelines
Content Guidelines
We use tabs to organize related content into helpful categories that are at the same level of hierarchy. Tabs help reduce cognitive load.
Voice and tone
We succinctly describe the content within the tab, using plain and neutral language.
Labels
- We are specific and avoid generic or vague labels.
- We order the tabs logically, placing the most important or most used first.
- We keep labels short, ideally one or two words.
- We do not truncate labels.
- We allow space for labels in various languages
- We keep the structure consistent across all tabs.
- We keep labels on one row for scannability.
- We do not use end punctuation.
- We avoid ALL CAPS because it is harder to read.
Accessibility
- When available, we provide a descriptive tab group name to give context.
- Screen readers announce the tab label and its selected state. Position in the set may also be announced.