Components/Navigation/Pagination
COMPONENT40.40

Pagination

Page navigation in nav.pagination > ul > li > a. Current page via aria-current; Prev/Next collapse to icons on small screens.


INSTALL

1pnpm dlx @sayagodev/mo add pagination

Or import the files from the package (no copy):

1import "@sayagodev/mo/css/pagination.css";

EXAMPLES

Default
Simple
Icon only
Rows per page

USAGE

1<nav aria-label="Pagination">2  <ul class="pagination">3    <li>4      <a href="#" aria-label="Go to previous page">5        <svg …chevron-left… /> <span class="pagination-label">Previous</span>6      </a>7    </li>8    <li><a href="#">1</a></li>9    <li><a href="#" aria-current="page">2</a></li>10    <li><span aria-hidden="true"></span></li>11    <li><a href="#">17</a></li>12    <li>13      <a href="#" aria-label="Go to next page">14        <span class="pagination-label">Next</span> <svg …chevron-right… />15      </a>16    </li>17  </ul>18</nav>

API

NAMEKINDDESCRIPTION
.paginationclassRow of square link targets
> svg + .pagination-labelelementPrev/Next anatomy; label hidden below 640px, svg normalizes to 16px
[aria-current="page"]attributeSolid primary current page
[aria-disabled="true"]attributeDimmed, non-clickable neighbour
span[aria-hidden]elementEllipsis gap

FILES

src/css/pagination.css
Install:mo add pagination

THEMING · PLAYGROUND

This is the exact component from the examples above, wearing a completely different theme. Edit the tokens and --mo-* hooks in the editor — autocomplete knows them all — and the preview obeys in real time. Your CSS always wins.

Tokens & hooks — edit live
Global tokens
--background--border--foreground--muted--muted-foreground--radius

Preview

Your CSS

Try it: type --mo- for the component hooks, or edit any value — the preview obeys in real time.