Navigation

Pagination

Page navigation control with previous/next arrows, numbered page links, and ellipsis truncation.

Preview
01 Installation

Install

Pull Pagination from the barrel for everyday use, or the granular path when you want a tighter bundle.

tsxBarrel1 line
import { Pagination } from "@brika/clay";
tsxGranular1 line
import { Pagination } from "@brika/clay/components/pagination";
02 Usage

A minimal example

Drop this into a page. Native HTML attributes pass through to the underlying primitive.

tsxPagination.tsx43 lines
'use client';

import {
  Pagination,
  PaginationContent,
  PaginationEllipsis,
  PaginationItem,
  PaginationLink,
  PaginationNext,
  PaginationPrevious,
} from '@brika/clay/components/pagination';
/** Standard pagination layout with previous/next, numbered pages, ellipsis, and an active page. */
export default function PaginationDefaultDemo() {
  return (
    <Pagination>
      <PaginationContent>
        <PaginationItem>
          <PaginationPrevious href="#" />
        </PaginationItem>
        <PaginationItem>
          <PaginationLink href="#">1</PaginationLink>
        </PaginationItem>
        <PaginationItem>
          <PaginationLink href="#" isActive>
            2
          </PaginationLink>
        </PaginationItem>
        <PaginationItem>
          <PaginationLink href="#">3</PaginationLink>
        </PaginationItem>
        <PaginationItem>
          <PaginationEllipsis />
        </PaginationItem>
        <PaginationItem>
          <PaginationLink href="#">10</PaginationLink>
        </PaginationItem>
        <PaginationItem>
          <PaginationNext href="#" />
        </PaginationItem>
      </PaginationContent>
    </Pagination>
  );
}
03 Examples

Pagination, every way

Compact

Compact pagination that only renders prev/next with a status label, useful for tight layouts.

Controlled

Controlled pagination wired to local state, swap the active page on click and clamp at the edges.

04 Accessibility

Accessibility

  • Root renders <nav aria-label="pagination">, exposing the control as a navigation landmark.
  • PaginationLink renders aria-current="page" when isActive is set, so AT announces the current page.
  • PaginationPrevious and PaginationNext ship with visible labels plus chevron glyphs marked aria-hidden.
  • PaginationEllipsis is aria-hidden="true" with an sr-only "More pages" fallback for screen readers.
05 Tokens 8 theme-overridable

Theme tokens

Every CSS variable Pagination reads, with its default and the dotted path you'd write in a ThemeConfig JSON to override it. Set any of these in your theme to retune Pagination without touching component code.

Pagination tokens

8 tokens
ColorFill, border, and text colors.8
  • --pagination-link-containercolorvar(--background)
    components.pagination.linkContainer

    Resting background of a page-link item (transparent-feeling against the page).

  • --pagination-link-labelcolorvar(--foreground)
    components.pagination.linkLabel

    Resting text/icon color of a page-link item, including the prev/next arrows.

  • --pagination-link-hover-containercolorvar(--accent)
    components.pagination.linkHoverContainer

    Background fill of a page-link item on hover or keyboard focus.

  • --pagination-link-hover-labelcolorvar(--accent-foreground)
    components.pagination.linkHoverLabel

    Text/icon color of a page-link item on hover or keyboard focus.

  • --pagination-link-active-containercolorvar(--background)
    components.pagination.linkActiveContainer

    Background fill of the current-page link (kept neutral so the outline reads).

  • --pagination-link-active-labelcolorvar(--foreground)
    components.pagination.linkActiveLabel

    Text color of the current-page link.

  • --pagination-link-active-bordercolorvar(--border)
    components.pagination.linkActiveBorder

    Outline color drawn around the current-page link to mark `aria-current="page"`.

  • --pagination-ellipsis-colorcolorvar(--muted-foreground)
    components.pagination.ellipsisColor

    Color of the `...` truncation glyph between page-link clusters.

Override in a theme

Authoring a theme is plain JSON. Drop overrides under components.pagination, the names are camelCase versions of the variable suffix.

jsonmy-theme.json12 lines
{
  "id": "my-theme",
  "name": "My Theme",
  "description": "...",
  "accentSwatches": ["#000"],

  "components": {
    "pagination": {
      "linkContainer": "var(--background)"
    }
  }
}

Then apply with applyTheme(myTheme) (see the theming guide), scope it to a subtree with themeToCssVars(myTheme, mode), or consume any token directly in your own JSX with the matching Tailwind utility (e.g. bg-pagination-…) — see the chips on each token row.

06 API reference

API reference

Props specific to Pagination. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.

<Pagination />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<PaginationContent />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<PaginationEllipsis />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<PaginationItem />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

3 props
  • boolean
    When true, render the child element instead of the default DOM node and merge props. Lets you compose with <a>, <Link>, or another primitive while keeping behavior and styling.
  • boolean

    No description.

  • sizedefault 'icon'
    PaginationLinkSize

    No description.

<PaginationNext />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

<PaginationPrevious />

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.