Loading homepage
Build a reusable accordion that combines the relationships from Accordion II with keyboard focus navigation. Each group starts closed and can show at most one panel. Clicking an open header closes it again.
Arrow Up, Arrow Down, Home, and End move focus between headers without changing the open panel. These navigation keys are added conventions for this challenge. Keep native Enter and Space activation and normal Tab traversal through all headers and the visible panel's practice link.
Input: Initial render Output: All panels are mounted and hidden. Primary has HTML, CSS, and JavaScript headers; secondary has React and Vue; single has Angular; empty has no headers or panels.
Input: Click HTML, then CSS in the primary group Output: Only primary CSS is expanded. Its panel shows CSS styles the page. and the Practice CSS link.
Input: With CSS open, focus HTML and press ArrowUp Output: Focus wraps to JavaScript. CSS stays open and its header remains aria-expanded true.
Input: Press End, then Home in a populated group Output: Focus moves to the last header, then the first header. The open panel does not change.
Input: Activate an open header with Enter or Space Output: Native button activation closes that panel. The rest of the group stays closed.
Input: Press Tab from an open header Output: The browser moves to its Practice link, then continues through the next focusable elements. Hidden-panel links are skipped.
Expansion and keyboard focus are separate. Each group begins closed and can reveal one panel; all headers remain in the normal page Tab sequence.