Web component / unpkg

<tabbed-interface>

This page loads the guarded definition helper from unpkg and registers the element when supported.

See the README for installation and API documentation.

Guarded registration

Importing the helper registers the default element when supported. Calling it again is safe.

import { defineTabbedInterface } from
  'https://unpkg.com/@aarongustafson/tabbed-interface@latest/define.js?module';
defineTabbedInterface();

<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.