Navigation & Disclosure
Pagination
Pagination surfaces page navigation with optional chevrons, ellipsis, and compact table-style layouts — aligned with shadcn/ui patterns. Organize content into understandable destinations and reveal detail when it becomes relevant. Keep the active location or expanded state easy to recognize. Import it from @/components/kamod-ui/pagination.
Source · Design reference · API reference · Theming · Styles
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthInstallation
Import Pagination primitives from @/components/kamod-ui/pagination.
pnpm add @kamod-ch/uiCopy an example with @kamod-ch/ui or the matching @kamod-ch/ui/… subpath. The code block switches between those two installs. Connect The Global Theme CSS and Tailwind Source Detection before your first render.
Usage
Compose Pagination with PaginationContent and PaginationItem wrappers. Use PaginationLink for numeric pages (outline when active, ghost otherwise). PaginationPrevious and PaginationNext add chevrons and hide link text on small screens; pass text for localization.
import { Pagination } from "@kamod-ch/ui";Choose a complete composition from the examples below; required child components and props vary by pattern.
Component Examples & Variants
Explore Pagination in Different Contexts, from the starting pattern to the compositions below. Begin with Demo, then compare the examples that match your content, state and layout. These are working patterns to adapt, not a list of interchangeable variant values: check the API Reference before using a prop or combining behaviors. Look at the surrounding labels, supporting text and spacing as well as the component itself.
Read the Result and Its Implementation Together. Use each showcase’s Code view to inspect imports and composition, or its Prompt view to prepare a setup or adaptation brief. Try the narrow preview and local theme controls before connecting real data, and use Reset to return an example to its initial state. Keep layout changes in class utilities where appropriate; follow the Component Styles Guide for hierarchy and the Theming Guide for shared surfaces and colors. The Accessibility Notes explain what to preserve when making those changes.
Demo
Keep the Current Location and Available Destinations Clear. Compose previous/next links, numbered pages and an ellipsis around the active page. The pagination presents the available destinations, while your routing or data layer supplies the records belonging to each page.
Build the visible range from your dataset, distinguish ellipsis from selectable pages, and define what happens at the first and last page before connecting remote results.
import { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "@kamod-ch/ui";
export const Example = () => (
<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>
<PaginationNext href="#" />
</PaginationItem>
</PaginationContent>
</Pagination>
);Simple
Use a Compact Range When Every Page Can Remain Visible. Use numbered page links alone when the range is short or previous/next controls already exist elsewhere. Mark the current page clearly so the compact layout still communicates where the reader is within the result set.
Give the navigation a useful accessible name, keep the current page explicit, and switch patterns before the list becomes too long for narrow screens.
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthIcons Only (with Rows per Page)
Keep Navigation Distinct from Page Size. Pair icon-only previous/next controls with a rows-per-page selector for a compact table footer. The controls change which records are displayed, while accessible names explain their direction without requiring visible button labels.
Give icon-only links descriptive accessible names, reset or clamp the current page when page size changes, and expose a readable result summary so users can tell where they are.
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthProps and Data
Configure Pagination using the contracts below. Read the documented options alongside the Source Definitions to understand which values your application supplies and which details the component owns. Start with a prop or helper, then follow its type link to inspect the declaration without leaving the page.
Props, slots and variants for this component.
Type cards are extracted from this checkout’s TypeScript source at build time. Props inherited through HTMLAttributes, Omit or variant helpers remain references in those declarations; their fields are not flattened here. Match the reference to your installed version, and check a package’s exports before writing an import type. A type exported by a source file is not necessarily re-exported by @kamod-ch/ui.
Component Props
? means a field can be omitted; it does not promise a fallback value. Existing documented defaults remain alongside the descriptions. For callbacks, check the argument and return types before connecting your own state or services.Pagination
PaginationProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
PaginationContent
PaginationContentProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
PaginationEllipsis
PaginationEllipsisProps
| Prop / type | Description |
|---|---|
class | Configure
|
PaginationItem
PaginationItemProps
| Prop / type | Description |
|---|---|
children | Configure
|
PaginationLink
PaginationLinkProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
data-slot | Configure
|
isActive | Configure
|
size | Configure
|
PaginationNext
PaginationNextProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
data-slot | Configure
|
isActive | Configure
|
size | Configure
|
text | Configure
|
PaginationPrevious
PaginationPreviousProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
data-slot | Configure
|
isActive | Configure
|
size | Configure
|
text | Configure
|
Data Type Reference
Expand a card to inspect and copy the exact declaration. The code header identifies its repository file; follow imported or inherited types in the Implementation Source when you need the complete dependency chain. Required-field summaries cover fields declared directly in that type. Source-only helpers and inferred schema outputs describe the local implementation, not additional props you can pass to every component.
Pagination Props
1 declared fieldPaginationPropsPagination.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of PaginationProps before adapting it.PaginationContent Props
1 declared fieldPaginationContentPropsPaginationContent.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of PaginationContentProps before adapting it.PaginationEllipsis Props
DeclarationPaginationEllipsisPropsPaginationEllipsis.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of PaginationEllipsisProps before adapting it.PaginationItem Props
1 declared fieldPaginationItemPropsPaginationItem.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of PaginationItemProps before adapting it.PaginationLink Props
4 declared fieldsPaginationLinkPropsPaginationLink.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of PaginationLinkProps before adapting it.PaginationNext Props
2 declared fieldsPaginationNextPropsPaginationNext.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of PaginationNextProps before adapting it.PaginationPrevious Props
2 declared fieldsPaginationPreviousPropsPaginationPrevious.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of PaginationPreviousProps before adapting it.Accessibility
Pagination provides a navigation landmark, named previous/next controls and aria-current="page" on the active PaginationLink. Ellipsis is decorative rather than another selectable page.
You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.
Connect the Foundation
Return to Choose and Compose Components to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.
Build the Surrounding Screen
Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.
Make the Result Hold Up
Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.
Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.