Skip to content

Pagination

<nav class="pagination" aria-label="Pagination">
<ul class="pagination-list">
<li><a class="btn btn-ghost btn-sm" href="?page=1">Previous</a></li>
<li><a class="btn btn-outline btn-icon-sm" href="?page=2" aria-current="page">2</a></li>
</ul>
</nav>
ClassPart
.paginationThe <nav>
.pagination-listThe <ul> of pages
.pagination-ellipsisA gap in the sequence

The pages themselves are buttons — ghost for the rest, outline for the current one — so there is no third set of classes to learn.

Set dir="rtl" on the page or on any subtree — the row follows the reading direction, so “Previous” sits on the right. See the button page for a live example.

  • aria-label="Pagination" on the <nav>, so it is distinguishable from other navigations.
  • aria-current="page" on the current page. The outline variant shows it; aria-current announces it.
  • Previous and next need to say where they go when they are icon-only: aria-label="Previous page", not just an arrow.
  • Disable the ends rather than hiding them. A control that disappears at the first page shifts the row under the pointer; one that is disabled stays put.