About this set
Three tabs, HTML, CSS and Zero JS, in a pale teal segmented bar above a text panel, built without any JavaScript. Hidden radio inputs hold the state, a label for each radio acts as the tab, and general sibling selectors such as #t2:checked ~ .tabs label[for=t2] style the selected label and #t2:checked ~ .p2 show the matching panel. The selected label fills with dark teal and a soft shadow. Use it where scripts are unwelcome or unavailable: documentation, static site generators, content management systems that strip scripts, and progressive enhancement baselines. Because these are real radio buttons rather than ARIA tabs, a screen reader announces them as a group of three radio buttons called Topic, and the panels follow in reading order. Tab moves to the checked radio, the arrow keys move between radios and select them, and focus is drawn on the visible label. The Bootstrap version uses .btn-check radios and .btn labels restyled through –bs-btn-* variables, and the Tailwind version uses named peers for the panels and group-has for the labels.
What’s included
- No JavaScript: radio inputs hold the state
- Grouped in a fieldset with a visually hidden legend
- Focus ring drawn on the visible label
- Bootstrap version uses .btn-check and .btn
- Tailwind version uses peer-checked and group-has variants
Accessibility
This set uses radio buttons rather than the ARIA tabs pattern: the radios are grouped in a fieldset whose visually hidden legend reads Topic, and each is named by its label. Tab reaches the checked radio and the arrow keys move and select, as radios always do, but Home and End are not supported. The focused radio's label gets a 2px teal outline, and the label transition is removed under prefers-reduced-motion.
Customise it
Change --rt-accent, --rt-muted, --rt-text, --rt-soft and --rt-line on .rtabs (plain CSS and Bootstrap); Bootstrap label sizing comes from --bs-btn-padding-x, --bs-btn-padding-y and --bs-btn-font-size. In Tailwind edit the --color-rt-* theme colours. Add a tab by adding a radio, a label and a panel, plus one selector for each.

















