Appica UIUI 1.0.0

Pagination

Navigation for splitting long lists of content across multiple pages.

Usage

Pagination is a set of semantic primitives — there's no hidden state, so you build the page list yourself and decide which links to show. Every part lives under @appica/ui-react/pagination:

  • Pagination — the <nav aria-label="pagination"> landmark that wraps the control.
  • PaginationList — the <ul> that lays the items out in a row.
  • PaginationItem — one <li> wrapping a link or the ellipsis.
  • PaginationLink — a page link. Mark the current page with active (it becomes a non-interactive aria-current="page" element); mark out-of-range prev/next controls with disabled.
  • PaginationEllipsis — a decorative "…" standing in for the pages collapsed out of a long range.

The variant (outline or soft) and size (sm/md/lg) set on the root flow to every link through context. PaginationLink is built on Base UI's useRender, so you can project each link onto your router's link — e.g. a Next.js Link — without losing its styling or active state.

Examples

Default

A typical truncated range: an icon previous control (disabled on the first page), the current page marked active, an ellipsis for the gap, the last page, and an icon next control. Prev/next are chevron icons — give each an aria-label, and className="px-0" squares the link up around the lone icon.

Variants

outline (the default) draws a bordered button for each page; soft drops the borders for a lighter, fill-on-hover look. The active page is filled in both.

Sizes

Three sizes — sm, md (default), and lg — scale each link's height, minimum width, and text together.

With first & last

For long ranges, flank the prev/next controls with first and last jump buttons — double-chevron icons that skip straight to the ends. Each is icon-only, so it needs an aria-label and className="px-0".

Controlled

Pagination holds no state of its own, so wire it to your own page state. Here the current page lives in useState, each link's onClick updates it instead of navigating, the active page reflects state, and prev/next disable at the bounds.

For client-side routing, project each PaginationLink onto your framework's link via render — here a Next.js Link. The link keeps its styling and active handling while the router owns navigation; put the href on the Link and any class overrides on the PaginationLink wrapper. Mark the current page active (no Link needed — it's non-interactive).

RTL

Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior follows the same direction.

The page list flows from the right, and the previous/next controls swap sides — point their chevrons the other way so they still read as "back" and "forward". For setup details and caveats, see the RTL guide.

API reference

Pagination is a set of styled HTML elements. Each part forwards every remaining prop to its underlying element (nav, ul, li, a, span), so any native attribute works here — the tables below list the Appica additions and the most common props.

Pagination

The navigation landmark. Renders a <nav role="navigation" aria-label="pagination"> and provides the variant/size context.

PaginationList

The list of items. Renders a <ul> laying the items out in a row.

PaginationItem

One item's <li> wrapper.

A page link. Built on Base UI's useRender; renders an <a> unless you project it onto another element with render. Inherits variant/size from the root.

PaginationEllipsis

A "…" placeholder for collapsed pages. Decorative (aria-hidden), with an sr-only "More pages" label.

Accessibility

  • Pagination renders a <nav> with aria-label="pagination", so it's exposed as a named navigation landmark.
  • The current page (active) carries aria-current="page" and is non-interactive, so it isn't announced as a destination.
  • disabled links set aria-disabled and drop out of the tab order — the right way to express an out-of-range Previous/Next control.
  • Controls without visible text — icon-only prev/next, for instance — need an aria-label.
  • The ellipsis is aria-hidden and keeps an sr-only "More pages" label for context.

© 2026 Appica UI. A free component library, crafted by the Appica team.