Pagination
Page navigation control with previous/next arrows, numbered page links, and ellipsis truncation.
Install
Pull Pagination from the barrel for everyday use, or the granular path when you want a tighter bundle.
import { Pagination } from "@brika/clay";import { Pagination } from "@brika/clay/components/pagination";A minimal example
Drop this into a page. Native HTML attributes pass through to the underlying primitive.
'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>
);
}Pagination, every way
Accessibility
- Root renders
<nav aria-label="pagination">, exposing the control as a navigation landmark. -
PaginationLinkrendersaria-current="page"whenisActiveis set, so AT announces the current page. -
PaginationPreviousandPaginationNextship with visible labels plus chevron glyphs markedaria-hidden. -
PaginationEllipsisisaria-hidden="true"with ansr-only"More pages" fallback for screen readers.
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--pagination-link-containercolorvar(--background)components.pagination.linkContainerResting background of a page-link item (transparent-feeling against the page).
--pagination-link-labelcolorvar(--foreground)components.pagination.linkLabelResting text/icon color of a page-link item, including the prev/next arrows.
--pagination-link-hover-containercolorvar(--accent)components.pagination.linkHoverContainerBackground fill of a page-link item on hover or keyboard focus.
--pagination-link-hover-labelcolorvar(--accent-foreground)components.pagination.linkHoverLabelText/icon color of a page-link item on hover or keyboard focus.
--pagination-link-active-containercolorvar(--background)components.pagination.linkActiveContainerBackground fill of the current-page link (kept neutral so the outline reads).
--pagination-link-active-labelcolorvar(--foreground)components.pagination.linkActiveLabelText color of the current-page link.
--pagination-link-active-bordercolorvar(--border)components.pagination.linkActiveBorderOutline color drawn around the current-page link to mark `aria-current="page"`.
--pagination-ellipsis-colorcolorvar(--muted-foreground)components.pagination.ellipsisColorColor 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.
{
"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.
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 />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<PaginationContent />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<PaginationEllipsis />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<PaginationItem />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<PaginationLink />
3 props- booleanWhen 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'PaginationLinkSizeNo description.
<PaginationNext />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<PaginationPrevious />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.