Loading homepage
Build a reusable horizontal tabs component with complete ARIA relationships and keyboard navigation. These panels contain local text that is already available, so use automatic activation: a tab becomes selected as soon as it receives focus.
The supplied page has two populated groups and an empty group. Complete the component in your chosen framework while preserving the sample content and separate styles. A keyboard user should enter each group at its selected tab, navigate with the arrow keys, and continue to its visible panel using the normal Tab sequence.
Input: Initial render Output: Primary selects HTML; secondary selects CSS. Each selected tab has tabindex 0 and exposes its matching text panel.
Input: Focus primary HTML, then press ArrowRight Output: Focus moves to CSS, CSS becomes selected, and the primary CSS panel becomes visible. The secondary group stays on CSS.
Input: Focus primary HTML, then press ArrowLeft Output: Focus wraps to JavaScript and its panel becomes visible.
Input: Press End, then Home in a populated group Output: End focuses and activates the last tab; Home focuses and activates the first.
Input: Press Tab while a tab is focused Output: Normal browser traversal moves to the visible text panel, then continues through the rest of the page.
Input: Empty items Output: The empty root contains no tablist, tabs, or panels.
Selection follows focus in each horizontal group. Exactly one tab and its text panel participate in that group’s normal Tab sequence.