Segmented Page Groups
A copy-paste pagination component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
PaginationHTMLCSSany framework
Copy into your project
HTML
<nav aria-label="Pagination" class="nuda-pg2-segmented">
<div class="nuda-pg2-segmented__track">
<span class="nuda-pg2-segmented__indicator" aria-hidden="true"></span>
<button class="nuda-pg2-segmented__seg nuda-pg2-segmented__seg--on" aria-current="page">1–10</button>
<button class="nuda-pg2-segmented__seg">11–20</button>
<button class="nuda-pg2-segmented__seg">21–30</button>
</div>
</nav>CSS
.nuda-pg2-segmented {
width: 260px;
}
.nuda-pg2-segmented__track {
position: relative;
display: grid;
grid-template-columns: repeat(3,1fr);
background: #161616;
border: 1px solid rgba(255,255,255,.1);
border-radius: 10px;
padding: 3px;
}
.nuda-pg2-segmented__indicator {
position: absolute;
top: 3px;
left: 3px;
width: calc(33.333% - 4px);
height: calc(100% - 6px);
background: #e4ff54;
border-radius: 8px;
transform: translateX(0);
animation: _nuda-pg2segmentedin .4s cubic-bezier(.2,.8,.2,1);
}
.nuda-pg2-segmented__seg {
position: relative;
z-index: 1;
height: 40px;
border: none;
background: transparent;
color: #999;
font-size: .72rem;
cursor: pointer;
border-radius: 8px;
transition: color .15s;
}
.nuda-pg2-segmented__seg:hover {
color: #fafafa;
}
.nuda-pg2-segmented__seg--on {
color: #0a0a0a;
font-weight: 700;
}
.nuda-pg2-segmented__seg:focus-visible {
outline: 2px solid #e4ff54;
outline-offset: 2px;
}
@keyframes _nuda-pg2segmentedin {
from {
opacity: 0;
transform: translateX(0) scale(.85);
}
to {
opacity: 1;
transform: translateX(0) scale(1);
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-pg2-segmented__indicator {
animation: none !important;
}
}
How to use Segmented Page Groups
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.