Tabbed interfaces are a way of navigating between multiple panels, reducing clutter and fitting more into a smaller space.
Component
Tabs
Other names: Tabbed interface
88 examples
Tabs
A11Y Style Guide
- jQuery
- Code examples
- Usage guidelines
- Accessibility
- Unmaintained
- Open source
Tabs
Ant Design
Ant Financial
- React
- Code examples
- Accessibility issues
- Open source
Tabs
Atlassian Design System
- React
- Code examples
- Usage guidelines
- Tone of voice
- Accessibility
Tabs
Base Web
Uber
- React
- CSS-in-JS
- Code examples
- Usage guidelines
- Open source
Tabs (Motion)
Base Web
Uber
- React
- CSS-in-JS
- Code examples
- Usage guidelines
- Open source
Tabs
BBC Global Experience Language
- Accessibility
- Usage guidelines
- Unmaintained
Tabs
Bolt Design System
Pegasystems
- Sass
- Twig
- Web Components
- Code examples
- Tone of voice
- Open source
Tabs
Bulma
- Sass
- Code examples
- Accessibility issues
- Open source
Tabs
Carbon Design System
IBM
- React
- Vanilla JS
- Angular
- Vue
- Svelte
- Web Components
- Code examples
- Usage guidelines
- Open source
Tabs
Cauldron
Deque
- React
- CSS
- Code examples
- Usage guidelines
- Accessibility
- Open source
Tabs
Cedar
Recreational Equipment, Inc.
- Vue
- Sass
- CSS Modules
- Usage guidelines
- Code examples
- Open source
Tabs
Chakra UI
- React
- CSS-in-JS
- Code examples
- Open source
Tabs
Clarity Design System
VMware
- CSS
- Angular
- Web Components
- Code examples
- Usage guidelines
- Open source
Tabs
Coral
Talend
- React
- Code examples
- Tone of voice
- Open source
Tab
Crayons
Freshworks
- Web Components
- Code examples
- Open source
Tabs
Decathlon Design System
- CSS
- React
- Svelte
- Vue
- Web Components
- Usage guidelines
- Code examples
- Accessibility
- Open source
Tabs
Dell Design System
- Vanilla JS
- Code examples
- Usage guidelines
Tab
Duet Design System
LocalTapiola
- Angular
- Vue
- React
- Code examples
Tab Group
Duet Design System
LocalTapiola
- Angular
- Vue
- React
- Code examples
Tabs
eBay MIND Patterns
- Accessibility
- Usage guidelines
- Open source
Tab
eBay Playbook
- HTML
- React
- Code examples
Tab
Evergreen
Segment
- React
- Open source
Tabs
Flowbite
- Tailwind CSS
- Open source
- Code examples
Pivot
Fluent UI
Microsoft
- React
- Web Components
- Mobile
- Usage guidelines
- Code examples
- Accessibility
- Open source
Tabs
Forma 36
Contentful
- React
- CSS-in-JS
- Code examples
- Open source
Tabs
FutureLearn design system
FutureLearn
- React
- Usage guidelines
- Tone of voice
Tabs
Geist Design System
Vercel
- React
- Code examples
Tabs
generic-components
- Web Components
- Code examples
- Accessibility
- Open source
Tabs
Gestalt
Pinterest
- React
- CSS
- Code examples
- Open source
- Usage guidelines
Tabs
GOV.UK Design System
- Nunjucks
- Code examples
- Usage guidelines
- Research
- Open source
Tabs
Grommet
- React
- Code examples
- Open source
Tabs
Headless UI
Tailwind Labs
- React
- Vue
- Code examples
- Accessibility
- Open source
Tabs
Helios
Hashicorp
- Ember
- Sass
- Code examples
- Usage guidelines
- Accessibility
- Open source
Tabs
Helsinki Design System
City of Helsinki
- React
- CSS
- Code examples
- Usage guidelines
- Accessibility
- Open source
Tabs
Inclusive Components
- Code examples
- Accessibility
- Unmaintained
Tabs
Instructure-UI
Instructure
- React
- CSS-in-JS
- Code examples
- Accessibility
- Open source
Tabs
Jøkul Designsystem
Fremtind Forsikring
- React
- Sass
- Code examples
- Usage guidelines
- Open source
Scoped Tabs
Lightning Design System
Salesforce
- React
- Code examples
- Usage guidelines
- Tone of voice
- Open source
Tabs
Lightning Design System
Salesforce
- React
- Code examples
- Usage guidelines
- Tone of voice
- Open source
Vertical Tabs
Lightning Design System
Salesforce
- React
- Code examples
- Usage guidelines
- Tone of voice
- Open source
Tabs
Luna
Sainsbury’s
- React
- Sass
- Usage guidelines
- Code examples
- Tone of voice
Tabs
Material Design
Google
- Mobile
- Web Components
- Sass
- Usage guidelines
- Open source
- Accessibility
Tabs
Momentum Design
Cisco
- React
- Sass
- Code examples
- Usage guidelines
- Open source
Tabs
Morningstar Design System
- Vue
- Usage guidelines
Tabs
Nessie
Nederlandse Spoorwegen
- Web Components
- Tailwind CSS
- Usage guidelines
- Code examples
Tabs
NewsKit
News Corp
- React
- Code examples
- Usage guidelines
- Open source
Tab group
Nord Design System
Nordhealth
- Web Components
- Code examples
- Usage guidelines
Tabs
Nucleus Design System
British Gas
- Web Components
- Usage guidelines
Tabs
ONS Design System
Office for National Statistics
- HTML
- Nunjucks
- Sass
- Code examples
- Usage guidelines
- Accessibility
- Open source
Tabs
Orbit
Kiwi.com
- React
- CSS-in-JS
- Usage guidelines
- Open source
- Code examples
- Tone of voice
Tabs
Oxygen
Repsol
- HTML
- Code examples
- Usage guidelines
Tabs
Pajamas
GitLab
- Vue
- Usage guidelines
- Code examples
- Open source
Tabs
Paste
Twilio
- React
- CSS-in-JS
- Usage guidelines
- Code examples
- Tone of voice
- Accessibility
- Open source
Tabs
PatternFly
Red Hat
- React
- Sass
- Tone of voice
- Open source
- Usage guidelines
Tabs
Pharos
JSTOR
- Web Components
- Sass
- Usage guidelines
- Open source
- Code examples
- Accessibility
- Tone of voice
Tabs
Polaris
Shopify
- React
- Code examples
- Usage guidelines
- Accessibility
- Tone of voice
- Open source
Tabs
Porsche Design System
- Web Components
- Angular
- React
- Vue
- Code examples
- Open source
Tabs Bar
Porsche Design System
- Web Components
- Angular
- React
- Vue
- Code examples
- Open source
Tab panels
Primer
GitHub
- React
- Code examples
- Open source
Tab nav
Primer
GitHub
- React
- Code examples
- Open source
Tabs
Purple3
Heroku
- CSS
- Code examples
- Unmaintained
Tabs
Quasar Framework
- Vue
- Accessibility issues
- Code examples
- Open source
Tabs
Radix Primitives
WorkOS
- React
- Code examples
- Open source
Tabs
Reach UI
- React
- Accessibility
- Code examples
- Open source
Tab
Reakit
- React
- Code examples
- Open source
- Accessibility
Tabs
Ruter Components
- React
- Code examples
- Unmaintained
Tab
SEB Design Library
Skandinaviska Enskilda Banken
- Sass
- React
- Angular
- Code examples
- Usage guidelines
Tabs
Seeds
Sprout Social
- React
- Code examples
- Usage guidelines
- Tone of voice
Tabs
shadcn/ui
- React
- Tailwind CSS
- Code examples
- Open source
Tab group
Shoelace
- Web Components
- Code examples
- Open source
Tab
Shoelace
- Web Components
- Code examples
- Open source
Tab panel
Shoelace
- Web Components
- Code examples
- Open source
Tabs
Source
The Guardian
- React
- Code examples
- Usage guidelines
- Open source
Tabs
Spark Design System
Quicken Loans
- React
- Angular
- Code examples
- Usage guidelines
- Open source
- Unmaintained
Tabs
Spectrum
Adobe
- CSS
- Web Components
- React
- Code examples
- Usage guidelines
- Tone of voice
- Open source
Tabs
uStyle
uSwitch
- Sass
- Tone of voice
- Code examples
- Usage guidelines
- Open source
- Unmaintained
Tab bar
Vattenfall Design System
- HTML
- jQuery
- Sass
- Code examples
- Open source
Tab
Wanda
Wonderflow
- React
- CSS Modules
- Code examples
- Open source
Tabs
Wise Design
- Mobile
- Usage guidelines
- Tone of voice
Tabs
Workday Canvas Design System
- React
- Usage guidelines
- Accessibility
- Tone of voice
- Open source
Description
A tabbed interface consists of two key parts:
- the tab list containing the tab elements, along the top or side of…
- the tab panels which contain the content.
Each tab panel has an associated tab in the tab list, that when activated, displays the panel. Only one panel of content is shown at any one time.
Tabs are an example of an interface metaphor, named after the tabs attached to the top of folders used inside filing cabinets. Each tab is given a label based on the documents inside its corresponding folder. Like their real-world namesake tabbed interfaces allow a user to see the outline of a larger set of data at a glance and quickly navigate to the desired section.
Markup
Here is example markup based on the W3C recommended accessible markup for tabs. It describes a set of two tabs, with the first one selected:
<!-- Tabs -->
<div role="tablist" aria-orientation="horizontal">
<button
role="tab"
aria-selected="true"
id="tab-1"
aria-controls="tab-panel-1"
>
Tab 1
</button>
<button
role="tab"
aria-selected="false"
id="tab-2"
aria-controls="tab-panel-2"
>
Tab 2
</button>
</div>
<!-- Tab panels -->
<div id="tab-panel-1" role="tabpanel" aria-labelledby="tab-1">
<h2>Tab panel 1 content</h2>
</div>
<div
id="tab-panel-2"
role="tabpanel"
aria-labelledby="tab-2"
style="display: none;"
>
<h2>Tab panel 2 content</h2>
</div>
To communicate the semantic meaning and current state of each element to assistive technology, it makes extensive use of aria attributes:
- Use
role="tab"
on each tab element androle="tablist"
on the tab list. - Give each tab panel
role="tabpanel"
. - If the tabs are vertically oriented (stacked one on top of the other), give the tab list the attribute
aria-orientation="vertical"
(If your tabs are oriented horizontally, you can leave this attribute out as horizontal is the default). - If the tab list has a visible label, link it to the label with
aria-labelledby="{labelId}"
. Alternatively, the tab list should be labelled using thearia-label
attribute. - Each tab should have the attribute
aria-controls="{tabPanelId}"
linking it to the associated tab panel. - The active tab should have
aria-selected
set to true and all other tabs should have it set to false. - Each tab panel should have
aria-labelledby="{tabId}"
to link it with its associated tab element.
Styling
When styling your tabs, you can make use of the aria-selected
attribute to style the active tab differently. e.g.
.tab[aria-selected='true'] {
background-color: var(--active-tab-bg-color);
color: var(--active-tab-text-color);
font-weight: bold;
}
Ensure each tab also has a visible :focus
state.
To show/hide the tab panels you will need to toggle the CSS display property between display: none;
and a visible value such as display: block;
.
Interactivity
In addition to aria attributes on your HTML elements, to make a tabbed interface keyboard-accessible, you’ll also need to add some custom keybindings1:
- Tab: When tabbing into the tab list, place focus on the active tab element. When focus is on a tab inside the tab list, pressing tab should move focus to the next focusable element in the page outside the tab list.
- Space or Enter should activate the currently focused tab if it wasn't activated automatically on focus.
- ← and → to cycle between tabs when
aria-orientation="vertical"
. - ↑ and ↓ to cycle between tabs when
aria-orientation="horizontal"
.
Caveat: although this is a widely used method for making tabbed interfaces keyboard accessible, some users may not be familiar it; a component that is simpler to interact with (such as an accordion) may be more suited to your specific use case.
Usage guidelines
The main benefit of tabs is that they allow a large amount of information to be displayed in a limited space.
Be conscious that when you’re using tabs, you’re hiding content. This not only makes it less discoverable for sighted users, but also for users of assistive technology like screen readers.
If you're laying out your tabs horizontally, think about how they will appear at narrower screen widths — will they need to stack vertically or will you be better off swapping out the tabs for a different component (e.g. an accordion)?