About this set
Two image viewers that switch the main photo from a row of thumbnails without any JavaScript. Thumbnails under the photo shows five architecture photographs in a 16:10 frame with a caption card, and a strip of five thumbnails below; the selected one is at full strength with a blue ring and the rest are dimmed. Contact sheet beside the photo shows four coast photographs in a dark print frame with a frame number, and a column of film-style thumbnails beside it that turn from greyscale to colour when chosen and move under the photo on phones. Both work the same way: a visually hidden radio button per photo comes first in the markup, the thumbnails are its labels, and the sibling combinator shows the photo whose radio is checked, so a click, a tap or the arrow keys change the picture. Use it on product pages, property listings or anywhere a script would be overkill. The Bootstrap version uses .btn-check, .ratio and .row-cols-5, and the Tailwind version reaches each slide with arbitrary variants such as [#tva2:checked~*_&]:opacity-100.
What’s included
- Changes the main photo with no JavaScript at all
- Radio buttons make it keyboard operable with Tab and the arrow keys
- Selected thumbnail is ringed and the others dimmed
- Contact sheet layout moves its thumbnails under the photo on phones
- Crossfade between photos that stops under reduced motion
Accessibility
Each radio button has a name such as Photo 3 of 5: Night skyline, so screen readers announce the choice, its position and its checked state. Tab moves into the group and the arrow keys change photo, and the visible thumbnail of the focused radio gets a 3px outline. Hidden photos use visibility: hidden, so only the current one is read, and every photo has descriptive alt text. The crossfade is turned off under prefers-reduced-motion.
Customise it
Change --tv-accent and --tv-radius on .tv and --cs-accent on .cs. For more photos add a radio, a figure and a label, and one line to each nth-of-type list in the CSS. In Tailwind copy the [#id:checked~*_&] classes with the new id.






