About this set
Three equal-width tabs, Shipping, Returns and Warranty, above a bordered panel on wide screens, which turn into a stacked accordion below 560 pixels. On desktop the selected tab fills with amber; on a phone each section gets its own full-width header, the open one amber with square bottom corners so it joins its panel. Use it for product detail pages, FAQs and policy sections that need tabs on a laptop but would be cramped as a tab row on a phone. Both the tabs and the accordion headers drive the same three panels, so there is no duplicated content and the selection carries over when the window is resized. The script keeps aria-selected on the tabs and aria-expanded on the headers in step, and it swaps each panel’s role between tabpanel and region, labelled by whichever control is on screen, when the breakpoint changes. The Bootstrap version runs the tabs with the Tab plugin and has the accordion headers call bootstrap.Tab, and the Tailwind version uses a custom narrow variant for the breakpoint.
What’s included
- Tabs on wide screens, accordion under 560px
- One set of panels shared by both modes
- Panel roles and labels follow the visible control
- aria-expanded on accordion headers
- Muted tab text darkened to meet 4.5:1
Accessibility
On wide screens the tabs follow the WAI-ARIA tabs pattern: only the selected tab is in the Tab order; Left and Right (or Up and Down) move between tabs and select them, and Home and End jump to the first and last tab. Under 560px the tablist is hidden and each header is a button with aria-expanded, and its panel becomes a region labelled by that header. Tabs, headers and panels show a 2px amber outline on keyboard focus, and transitions are removed under prefers-reduced-motion.
Customise it
Set --at-accent, --at-line, --at-muted and --at-text on .atabs in plain CSS and Bootstrap, and change the 560px breakpoint in the media query and in the script's matchMedia together. In Tailwind edit the --color-at-* theme colours and the narrow custom variant.

















