Skip to content

Compact 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-pgk">
  <button class="nuda-pgk__page">1</button>
  <span class="nuda-pgk__gap">…</span>
  <button class="nuda-pgk__page">4</button>
  <button class="nuda-pgk__page nuda-pgk__page--on">5</button>
  <button class="nuda-pgk__page">6</button>
  <span class="nuda-pgk__gap">…</span>
  <button class="nuda-pgk__page">20</button>
</nav>
CSS
.nuda-pgk {
  display: inline-flex;
  gap: .25rem;
  align-items: center;
}

.nuda-pgk__page {
  min-width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #cfcfcf;
  border-radius: 7px;
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s;
}

.nuda-pgk__page:hover {
  background: rgba(255,255,255,.07);
}

.nuda-pgk__page--on {
  background: #e4ff54;
  color: #0a0a0a;
  font-weight: 700;
}

.nuda-pgk__gap {
  color: #555;
  font-size: .78rem;
  padding: 0 .15rem;
}

How to use Compact 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.

More pagination components

← Browse all NudaUI components