Skip to main

Design System

  • Welcome
  • Colors
  • Typography
  • Spacing

CSS

  • Utilities
  • Compositions

Component Library

  • Aside
  • Audio Player
  • Authors
  • Banners
  • Block quotes
  • Brand
  • Breadcrumbs
  • Browser compatibility table
  • Button
  • Callout
  • Cards
  • Carousel
  • Code blocks
  • Compare
  • Counter
  • Details
  • Ellipsis
  • Eyebrow
  • Floating Action Button
  • Feature Card
  • Figure
  • Fixed width Image
  • Form Fields
  • Headline
  • Hero
  • Hero Image
  • Icon Button
  • Indicator
  • Labels
  • Lists
  • Numbered headers
  • Page Header
  • Pagination
  • Pill
  • Preview Pagination
  • Prose
  • Spinner
  • Stack Nav
  • Stats
  • Status List
  • Tables
  • Tabs
  • Generated table of contents
  • Toggle Switch
  • Tooltips

Tabs - Component

View full screen
Code

Source (Nunjucks)

<web-tabs>
{% for item in data.items %}
<div class="flow pad-block-size-1" data-label="{{ item }}">
<h2>{{ item }}</h2>
<p>Accumsan egestas suscipit quam hendrerit molestie ultrices vehicula bibendum nunc.</p>
</div>
{% endfor %}
</web-tabs>

Output

<web-tabs>
<div class="flow pad-block-size-1" data-label="Sodales curabitur pretium">
<h2>Sodales curabitur pretium</h2>
<p>
Accumsan egestas suscipit quam hendrerit molestie ultrices vehicula
bibendum nunc.
</p>
</div>
<div class="flow pad-block-size-1" data-label="Ultricies interdum">
<h2>Ultricies interdum</h2>
<p>
Accumsan egestas suscipit quam hendrerit molestie ultrices vehicula
bibendum nunc.
</p>
</div>
<div class="flow pad-block-size-1" data-label="Senectus aliquet">
<h2>Senectus aliquet</h2>
<p>
Accumsan egestas suscipit quam hendrerit molestie ultrices vehicula
bibendum nunc.
</p>
</div>
</web-tabs>

Information

To change the active color, set a Custom Property value for --tabs-active-color and it will override the default, which is the primary color.

It’s also recommended that panels passed into <web-tabs> have padding— using pad-inline-size-1, for example—to make them render nicely where JavaScript isn’t available and also, prevents us having to add unnecessary spacing in the _web-tab.scss component styles.

Key links

  • Sass File

We want to help you build beautiful, accessible, fast, and secure websites that work cross-browser, and for all of your users. This site is our home for content to help you on that journey, written by members of the Chrome team, and external experts.

Contribute

  • File a bug
  • View source

Related content

  • developer.chrome.com
  • Chrome updates
  • Case studies
  • Podcasts
  • Shows

Connect

  • Twitter
  • YouTube
  • Google Developers
  • Chrome
  • Firebase
  • Google Cloud Platform
  • All products
  • Terms & Privacy
  • Community Guidelines

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies.