Tabs: Guidelines
Tabs organize content across different screens and views
Usage
Tabs organize groups of related content that are at the same level of hierarchy.

There are two variants of tabs:
- Primary tabs
- Secondary tabs
Primary tabs are placed at the top of the content pane under an app bar. They display the main content destinations.
Secondary tabs are used within a content area to further separate related content and establish hierarchy.

- Primary tabs
- Secondary tabs
Related content
Use tabs to group related content, not sequential content.


Anatomy

- Container
- Icon (optional)
- Badge (optional)
- Label
- Divider
- Active indicator
Container
The container holds multiple tabs. Its contents can be fixed or scrollable.
The container should always extend the full width of the window and be divided into equal sections, one for each tab.
The container is defined by a divider on the bottom edge to separate it from the content below. Content may scroll under the container.

Icon (optional)
Icons communicate the kind of content within a tab. Icons should be simple and recognizable.

Icons alone aren't as effective as text labels at communicating complex content.
Use caution when representing tab content with icons alone, as an icon's meaning may not be clear.


Label
Text labels should clearly and succinctly describe the content within the tab.
Tab labels appear in a single row. Labels can use a second line if needed, with truncated text. Alternatively, scrollable tabs can allow room for longer titles.

When using scrollable tabs, the first visible tab should be offset by 52dp from the left side of the device for both web and mobile. The width of each tab is defined by the length of its text label.
Avoid using inconsistent padding on each tab.


Badges (optional)
Badges can be used on primary or secondary tabs to show notifications or updates related to a specific tab. Limit badge content to four characters, including a "+".
Once the user views the relevant content in the tab, the badge value should update or the badge should disappear entirely.
Small and large badges can both be used with tabs. Read the badge guidance for more details.

Active indicator
To differentiate an active tab from an inactive tab, apply an underline and color change to the active tab's text and icon.
Choosing the tab variant
Primary tabs should be used when just one set of tabs are needed.
Secondary tabs are necessary when a screen requires more than one level of tabs. These tabs use a simpler style of indicator, but their function is identical to primary tabs.

Placement
Tabs are displayed in a single row, with each tab connected to the content it represents. As a set, all tabs are unified by a shared topic.
Secondary tabs should always be placed below primary tabs.

Responsive layout
For fixed tabs, the maximum width for each tab should be determined by the width of the widest tab. The group of tabs should use a fluid margin and align to the center or leading edge of the body region.
Avoid using more than four tabs at once. At five or more tabs, the container becomes cramped.

Behavior
States
By default, tabs inherit enabled states with one active state. The inactive and active states of a tab can inherit a hover, focus, and pressed states.

Fixed tabs
Fixed tabs display all tabs in a set simultaneously. They are best for switching between related content quickly, such as between transportation methods in a map. To navigate between fixed tabs, tap an individual tab, or swipe left or right in the content area.
Tap a tab
Navigate to a tab by tapping on it.
Swipe within the content area
To navigate between tabs, users can swipe left or right within the content area.
Use caution when placing other swipeable content (such as interactive maps or list items) in the content area.
Scrollable tabs
When a set of tabs cannot fit on screen, use scrollable tabs. Scrollable tabs can use longer text labels and a larger number of tabs. They are best used for browsing on touch interfaces.
Scrolling content
When a screen scrolls up and down through content, tabs can either be fixed to the top of the screen, or scroll off the screen. If they scroll off the screen, they will return when the user scrolls upward.