Web component / esm

<tabbed-interface>

This page loads the component class from esm.sh and registers it manually.

See the README for installation and API documentation.

Class-only import

Importing the class does not register it. Register once to enhance the original sections.

import { TabbedInterfaceElement } from
  'https://esm.sh/@aarongustafson/tabbed-interface@3.0.4/tabbed-interface.js?bundle&target=es2022';
customElements.define('tabbed-interface', TabbedInterfaceElement);

<tabbed-interface>
  <h2>Overview</h2>
  <p>Related content.</p>
  <h2>Details</h2>
  <p>More content.</p>
  <h2>Usage</h2>
  <p>Wrap headings and their content.</p>
</tabbed-interface>

Overview

Tabbed interfaces help organize related content into panels that users can switch between.

Details

Each tab controls visibility for its associated panel and supports keyboard navigation and ARIA attributes.

Usage

Wrap headings and their related content inside <tabbed-interface> to enhance the layout.

Without JavaScript or if the module cannot load, all authored sections remain readable. Narrow layouts also show every section without tab controls.