Navigated to /docs/ui/components/pagination

Pagination

Pagination navigation for paged data views.

Preview

A live, theme-aware example rendered with the published component.

Loading preview…

Import

Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.

TSX
tsximport { Pagination } from "@tavojs/ui/pagination";

Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/pagination.

When to use

Use it when

Use `Pagination` for paginated data

Choose something else when

Avoid Pagination when using data components as decorative layout containers.

Examples

Pagination example

TSX
tsximport { Pagination } from "@tavojs/ui/pagination";

export function PaginationExample1() {
  const setPage = (_page: number) => undefined;
  return (
    <>
      <Pagination page={2} pageCount={12} onChange={setPage} />
      <Pagination page={2} pageCount={12} getHref={(page) => `/docs?page=${page}`} />
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
pagenumber

Required

Configures page for this component.
pageCountnumber

Required

Configures pageCount for this component.
siblingCountnumber

Configures siblingCount for this component.
onChange(page: number) => void

Configures onChange for this component.
getHref(page: number) => string

renders page and control actions as links when provided.
labelstring

Configures label for this component.

Complete TypeScript API

Import from @tavojs/ui/pagination. Published exports: Pagination, PaginationProps.

PaginationProps

PropertyTypeRequiredDescription
childrenimport("/Users/hrach/Documents/Projects/Codex/tavo-ui-monorepo/node_modules/@tavojs/core/dist/jsx").Child

No

Inherited children attribute accepted by Pagination.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

idstring

No

Inherited id attribute accepted by Pagination.

pagenumber

Yes

Configures page for this component.

pageCountnumber

Yes

Configures pageCount for this component.

siblingCountnumber

No

Configures siblingCount for this component.

onChange(page: number) => void

No

Configures onChange for this component.

getHref(page: number) => string

No

renders page and control actions as links when provided.

labelstring

No

Configures label for this component.

State ownership and DOM target

ConcernContract
StateApplication controlled through page and the matching callback.
DOM targetPublic passthrough props target the component root. Treat nested elements and private class names as implementation details.

Anatomy and related components

This component exposes one public component root rather than a compound member API.

Limitations

Avoid Pagination when using data components as decorative layout containers.

Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.

Accessibility

Uses `nav`, `aria-label`, and `aria-current`.

  • Uses `nav`, `aria-label`, and `aria-current`.

Component status

ContractCurrent value
Maturitystable
Categorydata
Component import@tavojs/ui/pagination
Explicit CSS import@tavojs/ui/css/pagination
PreviewInteractive preview available on this page