Underline Pagination
A copy-paste pagination component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
PaginationHTMLCSSany framework
Copy into your project
HTML
<nav class="nuda-pgu">
<button class="nuda-pgu__page">1</button>
<button class="nuda-pgu__page nuda-pgu__page--on">2</button>
<button class="nuda-pgu__page">3</button>
<button class="nuda-pgu__page">4</button>
</nav>CSS
.nuda-pgu {
display: inline-flex;
gap: .2rem;
}
.nuda-pgu__page {
position: relative;
min-width: 34px;
height: 34px;
border: none;
background: transparent;
color: #999;
font-size: .82rem;
cursor: pointer;
transition: color .15s;
}
.nuda-pgu__page:hover {
color: #fafafa;
}
.nuda-pgu__page--on {
color: #e4ff54;
font-weight: 700;
}
.nuda-pgu__page--on::after {
content: "";
position: absolute;
left: 25%;
right: 25%;
bottom: 2px;
height: 2px;
background: #e4ff54;
border-radius: 2px;
animation: _pguIn .25s ease-out;
}
@keyframes _pguIn {
from {
transform: scaleX(0);
}
to {
transform: scaleX(1);
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-pgu__page--on::after {
animation: none;
}
}
How to use Underline Pagination
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.