Purpose
Stimulus controller to enable a tabbed view of a page.
Target | Purpose | Default |
---|
link | The tab headings/buttons that will be used to open the tabs | - |
content | The content panels for each tab. | - |
Class | Purpose | Default |
---|
active (Optional) | The class that is applied to the current active panel and link | is-active |
hide (Optional) | The class used to hide all inactive content panels | hide |
Value | Type | Description | Default |
---|
currentTab | Number | The currently selected tab (zero indexed). Setting the initial value/Changing this at any time will change which panel is shown. | 0 |
equalize | Boolean | Whether or not to make all content panels as big as the largest panel in the set. | false |
Events
Event | When | Dispatched on | event.detail |
---|
- | - | - | - |
Side Effects
The controller will add an event listener for click
to all link
targets.
The controller will add aria-selected
to the currently active link
target.
How to Use