Scroll-Snap Thumbnail Strip
A copy-paste galleries & carousels component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Galleries & CarouselsHTMLCSSany framework
Copy into your project
HTML
<div class="nuda-gc2-snap-thumbs" role="group" aria-roledescription="carousel" aria-label="Photo carousel with thumbnails">
<div class="nuda-gc2-snap-thumbs__viewport">
<div class="nuda-gc2-snap-thumbs__slide" role="group" aria-roledescription="slide" aria-label="1 of 4" style="background:linear-gradient(135deg,#ff5e7a,#ffb45e)"></div>
<div class="nuda-gc2-snap-thumbs__slide" role="group" aria-roledescription="slide" aria-label="2 of 4" style="background:linear-gradient(135deg,#62b6ff,#9d6dff)"></div>
<!-- More slides -->
</div>
<div class="nuda-gc2-snap-thumbs__strip">
<button type="button" class="nuda-gc2-snap-thumbs__thumb is-on" aria-label="Go to slide 1" aria-current="true" style="background:linear-gradient(135deg,#ff5e7a,#ffb45e)"></button>
<button type="button" class="nuda-gc2-snap-thumbs__thumb" aria-label="Go to slide 2" style="background:linear-gradient(135deg,#62b6ff,#9d6dff)"></button>
<!-- More thumbs -->
</div>
</div>CSS
.nuda-gc2-snap-thumbs {
display: flex;
flex-direction: column;
gap: 8px;
width: 100%;
max-width: 280px;
}
.nuda-gc2-snap-thumbs__viewport {
display: flex;
gap: 8px;
overflow-x: auto;
scroll-snap-type: x mandatory;
border-radius: 12px;
scrollbar-width: none;
}
.nuda-gc2-snap-thumbs__viewport::-webkit-scrollbar {
display: none;
}
.nuda-gc2-snap-thumbs__slide {
flex: 0 0 100%;
height: 130px;
border-radius: 12px;
scroll-snap-align: center;
border: 1px solid rgba(255,255,255,.08);
}
.nuda-gc2-snap-thumbs__strip {
display: flex;
gap: 6px;
justify-content: center;
}
.nuda-gc2-snap-thumbs__thumb {
width: 36px;
height: 28px;
padding: 0;
border-radius: 6px;
border: 2px solid transparent;
cursor: pointer;
opacity: .55;
transition: opacity .25s,border-color .25s,transform .25s;
min-width: 0;
}
.nuda-gc2-snap-thumbs__thumb:hover {
opacity: .85;
transform: translateY(-1px);
}
.nuda-gc2-snap-thumbs__thumb.is-on {
opacity: 1;
border-color: #e4ff54;
}
.nuda-gc2-snap-thumbs__thumb:focus-visible {
outline: 2px solid #e4ff54;
outline-offset: 2px;
}
@media (prefers-reduced-motion:reduce) {
.nuda-gc2-snap-thumbs__viewport {
scroll-behavior: auto;
}
.nuda-gc2-snap-thumbs__thumb {
transition: none;
}
}
How to use Scroll-Snap Thumbnail Strip
Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.
Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.