Loading homepage
Build a reusable tabs component with the ARIA roles, selection state, and relationships that describe a tabbed interface. A click selects one tab and reveals its associated panel while the other panels stay mounted and hidden.
The demo provides two populated groups and an empty group. Complete the supplied markup starters and keep every group's selection independent. This stage focuses on semantics and click interaction; custom keyboard navigation is introduced in Tabs III.
Input: Initial render Output: Primary selects HTML and shows its panel. Secondary selects CSS and shows its panel. Each group retains two hidden panels.
Input: Click JavaScript in the primary group Output: Primary selects JavaScript and shows primary-panel-javascript. Its HTML and CSS panels are hidden; secondary stays on CSS.
Input: An item with value css in group primary Output: Tab ID: primary-tab-css. aria-controls: primary-panel-css. The panel has that ID and aria-labelledby: primary-tab-css.
Input: Empty items Output: The group root contains no tablist, buttons, or panels.
The two populated groups each expose one selected tab and one visible panel, with all three panels mounted. Their accessible tab list names come from the label prop.