Skip to content

Tabs

Stable

A row of tabs that switch between views, with arrow-key movement and optional panels.

Also known as tab bar, tab list, tab view

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Underline with counts

The default look. A count sits after the name. A disabled tab is skipped by the arrow keys.

When to use it

Switches between views that belong together on one page, such as Inbox, Sent and Drafts. The active tab is marked by more than colour, and keyboard users get one tab stop and arrow keys.

Made of: Tab list · Tab · Count · Panel

Use it for

  • Views of the same kind of content, like folders or report sections.
  • Tabs with a count, such as unread items.
  • Showing only one panel at a time to keep a page short.

Not for

  • Choosing a setting with two or three short options: use SegmentedControl.
  • Content that readers should open and close in place: use Collapsible.
  • A list of actions: use Menu.

Do and avoid

3 new invoices

Do. Views that belong together, one click apart.

Pick your dates

Avoid. Steps shown as tabs let people jump ahead and miss one.

Do

  • Keep the labels short, ideally one or two words.
  • Use manual activation when showing a panel is slow or has a cost.
  • Show a count only when it helps people choose, and keep it a plain number.
  • Keep the same tab order every time the page loads.

Avoid

  • Do not nest tabs inside tabs.
  • Do not use tabs to move through steps in order. Show the steps as a list.
  • Do not disable a tab without explaining why elsewhere on the page.
  • Do not put actions in the tab list. Use a Menu or Buttons.

On a phone

  • The row of tabs scrolls sideways when it is too wide, with no scrollbar, and the selected tab is scrolled into view.
  • The row fades at an edge where more tabs are hidden.
  • Each tab is 44px tall on touch screens and never wraps its label.
  • The gap between underline tabs is smaller on a phone and grows from the sm breakpoint.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started