Tabs
Tabs organize content into multiple sections and allow users to navigate between them. The content under the set of tabs should be related and form a coherent unit.


Anatomy#


Options#
Table of options: tab item#
From the design point of view, each component has a number of options. These options and their names are platform agnostic, and each implementation should adapt these to fit into their framework.
Keyboard activation#
There are two possible behaviors for interacting with tabs using a keyboard: manual (default) or automatic activation. Typically, manual activation of tabs is only necessary when content cannot be displayed instantly (i.e., not all the panel content is present in the Document Object Model.) For additional guidance, view
Table of options: tabs#
From the design point of view, each component has a number of options. These options and their names are platform agnostic, and each implementation should adapt these to fit into their framework.
This overides density and is only applicable to horizontal tabs.
Behaviors#

Animation#
When the user selects a tab item, the selection indicator slides along the base of the tabs to the newly selected tab item. The text and icon colors of both tab items fade during this transition. At the time of selection, the tab views change immediately.

Tab overflow#
When there are too many tabs to fit horizontally across the viewport, the tabs component can be displayed as a quiet picker.
When appropriate, you can use alternative methods of overflowing tabs such as horizontal scrolling.

Text overflow#
When the tab item text is too long for the available horizontal space, it truncates at the end. This should only happen when the rest of the tab items have already been grouped into a picker. The full text should be revealed with a tooltip on hover and in the picker menu.
Usage guidelines#
Too many tabs#
When there are too many tabs to fit horizontally across the viewport, you can either allow horizontal scrolling or place all tab items in a quiet picker. Do not truncate multiple tab items just to make them fit horizontally.




Don't use tabs for varying levels of importance#
Use tabs to organize sections of equal importance. Groups of content under each tab item should not be of different natures. Don't use tabs to replace a flow; use pagination components instead.


Nested tabs#
Avoid having multiple levels of tabs. Instead, consider using other forms of organization such as side navigation, accordions, or collapsible panels. Nesting tabs is acceptable when there is a high degree of separation between the two tab experiences, or when different orientations are used. Do not compromise having a clear hierarchy by using the same variations or orientations of tabs.




Use icons consistently#
Don’t mix the use of icons in tabs. Navigation controls require a clear spacial relationship to one another, and mixing the use of icons can dramatically impact the visual balance and presence for each tab item.


Use tooltips for icon-only tabs#
It can often be hard to identify the meaning of icon-only tabs. An icon-only tab should always show a tooltip displaying the label on hover.


On-page navigation#
Vertical tabs can be used as an anchor link experience when displaying shortcuts to sections of content on a single page. Rather than exposing a new tab view, the tab items can link to an on-page anchor. List your tab items in the order they appear within the content. Do not use horizontal tabs for this adaptation.


Internationalization#
Keyboard interactions#
There are two possible behaviors for manipulating tabs with the keyboard: manual or automatic activation. Typically, manual activation of tabs is only necessary when content cannot be displayed instantly (i.e., not all the panel content is present in the DOM.) For additional guidance, see
Option 1: Manual activation
Option 2: Automatic activation
Changelog#
- Migrated to latest token system
- Updated all colors to 6.0.0
- Added size option
- Added density option (regular/compact)
- Added emphasis option (emphasized/not emphasized)
- Added alignment option (start/center)
- Added fluid height option for horizontal tabs
- Added text overflow behavior
- Updated text to use sentence case
- This component is now individually versioned (individual versions of existing components start at 5.0.0)
Design checklist#

All interactive states
Includes all interactive states that are applicable (hover, down, focus, keyboard focus, disabled).

All color themes
Works properly across all four color themes (lightest, light, dark, darkest).

All platform scales
Includes a desktop scale (UWP, macOS, web desktop) and a mobile scale (iOS, Android, web mobile).

Accessible use of color
Color is not used as the only visual means of conveying information (WCAG 2.0 1.4.1).

Accessible contrast for text
Text has a contrast ratio of at least 4.5:1 for small text and at least 3:1 for large text (WCAG 2.0 1.4.3).

Accessible contrast for UI components
Visual information required to identify components and states (except inactive components) has a contrast ratio of at least 3:1 (WCAG 2.1 1.4.11).

Content design
UI language and information design considerations have been incorporated into component design.

Defined options
Includes relevant options (variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.)

Defined behaviors
Includes guidelines for keyboard focus, layout (wrapping, truncation, overflow), animation, interactions, etc.

Usage guidelines
Includes a list of dos and don'ts that highlight best practices and common mistakes.

Writing guidelines
Includes content standards or usage guidelines for how to write or format in-product content for the component.

Internationalization guidelines
Works properly across various locales and includes guidelines for bi-directionality (RTL).

Keyboard interactions
Follows WCAG 2.0 standards for keyboard accessibility guidelines and includes a description of the keyboard interactions.

Design tokens
All design attributes (color, typography, layout, animation, etc.) are available as design tokens.

UI kit
Includes a downloadable XD file that shows multiple options, states, color themes, and platform scales.

Generated UI kit
Includes a downloadable XD file, generated by code using design tokens defined in Spectrum DNA, and shows multiple options, states, color themes, and platform scales.

In Spectrum for Adobe XD plugin
Component is included in the Spectrum for Adobe XD plugin.