Tab Group Web Component

A fully accessible tab group component with keyboard navigation and ARIA support.

Basic Example

A simple tab group with default styling.

First Tab Second Tab Third Tab

First Tab Content

This is the content for the first tab.

Tab panels can contain any HTML content.

Second Tab Content

This is the content for the second tab.

You can include images, lists, or other components here.

  • Item 1
  • Item 2
  • Item 3

Third Tab Content

This is the content for the third tab.

Each tab panel is only shown when its corresponding tab is active.

Themed Examples

The tab group component can be easily themed using CSS variables.

Features Usage Styling

Key Features

  • Fully accessible with ARIA support
  • Keyboard navigation
  • Customizable with CSS variables
  • Lightweight and dependency-free
  • Easy to integrate into any project

Usage

Import the component and use it in your HTML:

<tab-group>
  <tab-list>
    <tab-button>Tab 1</tab-button>
    <tab-button>Tab 2</tab-button>
  </tab-list>
  <tab-panel>Panel 1 content</tab-panel>
  <tab-panel>Panel 2 content</tab-panel>
</tab-group>

Styling

Customize using CSS variables:

tab-group {
  --color-primary: #9f7aea;
  --border-radius: 1rem;
  --color-background: #f8f8f8;
}

Keyboard Navigation

The tab group component supports complete keyboard navigation for accessibility.

Keyboard Controls

  • Tab to focus the active tab
  • to move to the previous tab
  • to move to the next tab
  • Home to move to the first tab
  • End to move to the last tab
Documentation Examples API Support

Documentation

Comprehensive documentation about how to use the tab group component.

Try using the keyboard to navigate between tabs.

Examples

Various examples and use cases for the tab group component.

These examples showcase different configurations and themes.

API

Technical API documentation for developers.

Includes methods, properties, and events available on the component.

Support

Get help and support for using the tab group component.

Contact information and resources for troubleshooting.