Vertical Pagination Rail
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-rail">
<button class="nuda-pg2-rail__item" aria-label="Slide 1"></button>
<button class="nuda-pg2-rail__item nuda-pg2-rail__item--on" aria-current="page" aria-label="Slide 2"></button>
<button class="nuda-pg2-rail__item" aria-label="Slide 3"></button>
<button class="nuda-pg2-rail__item" aria-label="Slide 4"></button>
</nav>CSS
.nuda-pg2-rail {
display: flex;
flex-direction: column;
align-items: center;
gap: .15rem;
width: 44px;
}
.nuda-pg2-rail__item {
position: relative;
width: 44px;
height: 44px;
border: none;
background: transparent;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.nuda-pg2-rail__item::before {
content: "";
display: block;
width: 6px;
height: 6px;
border-radius: 50%;
background: rgba(255,255,255,.25);
transition: transform .2s,background .2s;
}
.nuda-pg2-rail__item:hover::before {
background: rgba(255,255,255,.5);
}
.nuda-pg2-rail__item:focus-visible {
outline: 2px solid #e4ff54;
outline-offset: 2px;
}
.nuda-pg2-rail__item--on::before {
background: #e4ff54;
transform: scale(1.7);
animation: _nuda-pg2railpop .3s ease-out;
}
@keyframes _nuda-pg2railpop {
from {
transform: scale(1);
}
to {
transform: scale(1.7);
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-pg2-rail__item--on::before {
animation: none !important;
}
}
How to use Vertical Pagination Rail
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.