---
url: /components/tabs/guidelines.md
description: >-
  Tabs organize content across different screens, data sets, and other
  interactions.
---

# Tabs

Tabs organize content across different screens, data sets, and other interactions.

[Overview](overview.md) · [Specs](specs.md) · **Guidelines** · [Accessibility](accessibility.md)

## Usage

Tabs organize groups of related content that are at the same level of hierarchy.

![Mobile screen with 3 tabs: video, photos and audio. Each tab has an an icon and text.](/assets/5ecf373b-m2k0hhto-1.B4wr1PhM.webp)

Tab labels can include icons and text. Text labels should be short.

There are two variants of tabs:

1. Primary tabs
2. Secondary tabs

Primary tabs are placed at the top of the content [pane](../../foundations/layout/layout-overview/parts-of-layout.md#667b32c0-56e2-4fc2-a618-4066c79a894e "Panes are layout containers that house other components and elements within a single app. A pane can be: fixed, flexible, floating, or semi permanent.") under an [app bar](../app-bars/overview.md "App bars display information and actions at the top of a screen."). They display the main content destinations.<br><br>Secondary tabs are used within a content area to further separate related content and establish hierarchy.

![3 primary tabs above 3 secondary tabs.](/assets/7c917dbf-m2neyv4z-2.BAv27YiQ.webp)

1. Primary tabs
2. Secondary tabs

### Related content<br>

Use tabs to group related content, not *sequential* content.

::: tip Do
![Scrolling up and down through content, then swiping left through tabs.](/assets/d5d75524-m2k0jkg6-3.BAZT9BGD.webp)

Utilize tabs to categorize related groups of content into clearly defined sets
:::

::: danger Don't
![Mobile screen with scrollable tabs of sequential content: Chapter 1, Chapter 2, Chapter 3 and Chapter 4.](/assets/803cb7b0-m2k0jyu3-4.Dtn1WnO9.webp)

Don’t use tabs to move through sequential content that needs to be read in a particular order. Instead, create hierarchy within the content using techniques like typography style and open space.
:::

## Anatomy

![Six components of tabs.](/assets/f2aec759-m2k0lum1-5.Dp-SvhLg.webp)

1. Container
2. Icon (optional)
3. Badge (optional)
4. Label
5. Divider
6. Active indicator

### Container

The container holds multiple tabs. Its contents can be fixed or scrollable.<br><br>The container should always extend the full width of the window and be divided into equal sections, one for each tab.<br><br>The container is defined by a [divider](../divider/overview.md "Dividers are thin lines that group content in lists or other containers.") on the bottom edge to separate it from the content below. Content may scroll under the container.

![Mobile screen with fixed tabs with a dotted border to illustrate the container area.](/assets/f7083137-m2k0mdfv-6.AFEYYNHi.webp)

The container is the area that contains the tabs directly under the title above

### Icon (optional)

Icons communicate the kind of content within a tab. Icons should be simple and recognizable.

![Mobile screen with tabs that use both icons and labels.](/assets/62f023e0-m2k0o3dw-7.C9nmDx5b.webp)

Tabs can use a combination of labels and icons

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

::: tip Do
![Mobile screen with tabs represented by icons for “wishlist” and “location”.](/assets/37771e0e-m2k0sbsy-8.B5Nn5kXa.webp)

Use icons that are globally recognized when using icons alone
:::

::: danger Don't
![Mobile screen where "purchases” tab has text only and “wishlist” tab has text and icon.](/assets/c7e4d90e-m2k0t3i6-9.DPC8bIP8.webp)

Don’t use tabs with both icons and text labels on only some tabs, but not others
:::

### Label

Text labels should clearly and succinctly describe the content within the tab.<br><br>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.

![Mobile screen with scrollable tabs in a single row.](/assets/5a0f5c66-m2k1942z-10.BKYr8ELD.webp)

Tab labels should be short and succinct. There should be a clear relationship to the title above.

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.

::: tip Do
![Screen with scrollable tabs offset from the leading edge by 52dp.](/assets/3bf0a27f-m2k19jjz-11.BSGVSY1a.webp)

Offset the first scrollable tab 52dp from the leading edge so it's clear that more content is available
:::

::: danger Don't
![Screen with scrollable tabs, 2 of which are truncated to “Australian” showing how truncation can confuse users.](/assets/f363c29c-m2k1a0sc-12.Bu7NWKFj.webp)

Don’t truncate labels unless required, as truncated text can impede comprehension
:::

### Badges (optional) 

[Badges](../badges/overview.md "Badges show notifications, counts, or status information on navigation items and icons.") 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](../badges/overview.md) for more details.

![Mobile screen with tabs that use both icons and labels.](/assets/9daaa8d7-m2k1yl6w-13.hCthxoTk.webp)

Badges are used to highlight notifications related to tab specific content

### 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.

<video controls src="https://firebasestorage.googleapis.com/v0/b/design-spec/o/projects%2Fm3%2Fimages%2Fm60drx93-GM3-Components-Tabs-Guidelines-1-v01.mp4?alt=media" aria-label="Selecting a tab creates an underline below the  icon and text, both which have changed color to show the tab is active."></video>

An underline and color change differentiate an active tab from the inactive ones

## 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.

![Mobile screen with primary tabs near the top of the screen.](/assets/eeb55cca-m2k20o4c-15.BU-UPjk4.webp)

Tabs can be joined with components like app bars, embedded in a specific UI region, or nested within components like cards and sheets. Tabs control the UI region displayed below them.

## 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.<br><br>Secondary tabs should always be placed below primary tabs.

![Mobile screen with secondary tabs below the primary tabs.](/assets/1b7810de-m2k217y6-16.DHvm4XC7.webp)

Secondary tabs are found within other content to assist users with greater detail

## 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](../../foundations/layout/layout-overview/overview.md#38a538d7-991f-4c39-8449-195d32caf397 "Margins are the spaces between the edge of a nested element and its parent element, such as the space between a button's label text and the edge of its container.") 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.

![Four fixed tabs spaced to match one another.](/assets/6972aaa0-m6fa9q27-17.BNAMu2nw.webp)

Tabs can grow in width in relation to the number of items contained within

## Behavior

### States

By default, tabs inherit [enabled](../../foundations/interaction/states/applying-states.md#39b2fc90-01db-41b5-b6f8-47be61ed1479 "An enabled state communicates an interactive component or element.") [states](../../foundations/interaction/states/overview.md "States show the interaction status of a component or UI element.") with one active state.The inactive and active states of a tab can inherit a [hover](../../foundations/interaction/states/applying-states.md#71c347c2-dd75-485b-892e-04d2900bd844 "A hover state communicates when a user has placed a cursor above an interactive element."), [focus](../../foundations/interaction/states/applying-states.md#bc6d6853-48ef-490e-8076-448e89e69f0f "A focused state communicates when a user has highlighted an element, using an input method such as a keyboard or voice."), and [pressed](../../foundations/interaction/states/applying-states.md#c3690714-b741-492d-97b0-5fc1960e43e6 "A pressed state communicates a user tap.") states.

![Four states of a tab.](/assets/d4bcdf42-m2k2312r-18.CzAw5l_E.webp)

Active, hover, focused, 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.

<video controls src="https://firebasestorage.googleapis.com/v0/b/design-spec/o/projects%2Fm3%2Fimages%2Fm60dtw9m-GM3-Components-Tabs-Guidelines-2-v01.mp4?alt=media" aria-label="Mobile screen with fixed tabs, text only."></video>

Fixed tabs allow users to see all possible kinds of content available

#### Tap a tab

Navigate to a tab by tapping on it.

<video controls src="https://firebasestorage.googleapis.com/v0/b/design-spec/o/projects%2Fm3%2Fimages%2Fm60duq4j-GM3-Components-Tabs-Guidelines-3-v01.mp4?alt=media" aria-label="Tapping a tab selects it."></video>

Tapping on a tab directly

#### Swipe within the content area

To navigate between tabs, users can swipe left or right within the content area.

<br>

<video controls src="https://firebasestorage.googleapis.com/v0/b/design-spec/o/projects%2Fm3%2Fimages%2Fm60dvuo4-GM3-Components-Tabs-Guidelines-4-v01.mp4?alt=media" aria-label="Swiping left or right on the content area moves the focus between fixed tabs."></video>

Users can swipe between fixed tabs to see related content quickly

Use caution when placing other swipeable content (such as interactive maps or [list](../lists/overview.md "Lists are continuous, vertical indexes of text and images.") items) in the content area.

::: tip Do
<video controls src="https://firebasestorage.googleapis.com/v0/b/design-spec/o/projects%2Fm3%2Fimages%2Fm60dwpex-GM3-Components-Tabs-Guidelines-5.1-v01.mp4?alt=media" aria-label="Scrolling up and down through content, then swiping left through tabs."></video>

Use different gesture directions when using tabs
:::

::: danger Don't
<video controls src="https://firebasestorage.googleapis.com/v0/b/design-spec/o/projects%2Fm3%2Fimages%2Fm60dxhwe-GM3-Components-Tabs-Guidelines-5.2-v01.mp4?alt=media" aria-label="Swiping to change tabs accidentally swipes to delete a list item in the UI instead."></video>

Avoid placing swipeable items in the content area of a UI that has tabs, as the user may mistakenly swipe the wrong component
:::

### 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.

<video controls src="https://firebasestorage.googleapis.com/v0/b/design-spec/o/projects%2Fm3%2Fimages%2Fm60dygta-GM3-Components-Tabs-Guidelines-6-v01.mp4?alt=media" aria-label="Scrolling left and right on scrollable tabs."></video>

Padding should remain the same when using scrolllable tabs and long labels

### 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.

<video controls src="https://firebasestorage.googleapis.com/v0/b/design-spec/o/projects%2Fm3%2Fimages%2Fm60dz0ae-GM3-Components-Tabs-Guidelines-7-v01.mp4?alt=media" aria-label="Scrolling through content with fixed tabs  at top of the screen."></video>

Tabs can be use to create elevation

::: tip Do
<video controls src="https://firebasestorage.googleapis.com/v0/b/design-spec/o/projects%2Fm3%2Fimages%2Fm60dztv7-GM3-Components-Tabs-Guidelines-8.1.mp4?alt=media" aria-label="When scrolling up through content, tabs scroll off screen, then reappear when scrolling back down."></video>

Tabs can scroll offscreen on scroll, and reappear when the page is scrolled up
:::

::: danger Don't
<video controls src="https://firebasestorage.googleapis.com/v0/b/design-spec/o/projects%2Fm3%2Fimages%2Fm60e0d2q-GM3-Components-Tabs-Guidelines-8.2.mp4?alt=media" aria-label="When scrolling up through content, tabs scroll behind the app bar then reappear when scrolling back down."></video>

Don’t scroll tabs behind an app bar. When tabs are attached to a component, they should appear and move as a single unit.
:::
