Tabs

Tabs allow the user to interact across the sections to switch from one set of content to another, making the transition easily from one peer to the other.

Min / Max width

48px height fixed tabs design specifications
48px height fixed tabs design specifications

Fixed tabs

48px height fixed tabs design specifications
48px height fixed tabs design specifications
72px height fixed tabs design specifications
72px height fixed tabs design specifications

Scrollable tabs

Tabs are horizontally scrollable when they are wider that screen, by using the scroll indicator.

Scrollable tabs
Scrollable tabs

Notification tabs

Notification badges are always positioned aligned with label or icon in 48px tab container and at top right of the 72px tab container.

Notification tabs
Notification tabs

States

Tabs can get different states based on user interaction. These states are: inactive, enabled, hover, pressed, focus and disabled.

Tab states
Tab states

Anatomy

Tabs anatomy
  1. 1.
    Container
  2. 2.
    Active icon (Optional if there's a label)
  3. 3.
    Active text label (Optional if there's an icon)
  4. 4.
    Active tab indicator
  5. 5.
    Inactive icon (Optional if there's a label)
  6. 6.
    Inactive text label (Optional if there's an icon)
  7. 7.
    Tab item
  8. 8.
    Divider

Design tokens

Color

Component tokenElementCore tokenValue
selectedBackgroundColorTab itemcolor-white#ffffff
unselectedBackgroundColorTab item:enabledcolor-white#ffffff
hoverBackgroundColorTab item:hovercolor-purple-100#f2eafa
pressedBackgroundColorTab item:activecolor-purple-200#e5d5f6
selectedFontColorLabelcolor-purple-700#5f249f
unselectedFontColorLabelcolor-grey-700#666666
disabledFontColorLabel:disabledcolor-grey-500#999999
selectedIconColorIconcolor-purple-700#5f249f
unselectedIconColorIconcolor-grey-700#666666
disabledIconColorIcon:disabledcolor-grey-500#999999
focusOutlineTab item outlinecolor-purple-700#5f249f
selectedUnderlineColorTab item border bottoncolor-purple-700#5f249f
dividerColorSeparatorcolor-grey-400#bfbfbf
badgeBackgroundColorBadge containercolor-red-700#d0011b
badgeFontColorLabelcolor-white#ffffff

Typography

Component tokenElementCore tokenValue
fontFamilyTitlefont-family-sans'Open Sans', sans-serif;
fontSizeTitlefont-scale-031rem / 16px
fontStyleTitlefont-style-normalnormal
fontWeightTitlefont-weight-semibold600

Accessibility

Each tab must have a unique title that clearly describes tab panel content. This is particularly helpful for users of assistive technologies so they have the necessary information to efficiently navigate the content.

Content authors need to ensure the content that is added to the tab panel is accessible. For example, if you add an image to the panel you need to include alternative text to pass accessibility testing.

W3C WAI-ARIA Tab Design Pattern covers the usage of ARIA names.

Keyboard interactions

keyDescription
Enter or SpaceActivates the tab if it was not activated automatically on focus.
TabWhen focus moves into the tab list, places focus on the active tab element. When the tab list contains the focus, moves focus to the next element in the page tab sequence outside the tablist, which is typically either the first focusable element inside the tab panel or the tab panel itself.
Left-arrowMoves focus to the previous tab. If focus is on the first tab, moves focus to the last tab. Optionally, activates the newly focused tab.
Right-arrowMoves focus to the next tab. If focus is on the last tab element, moves focus to the first tab. Optionally, activates the newly focused tab.