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.