Component docs
Loading
"use client";
import { Pagination } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
pageCount (required) | number | — | — |
onValueChange | (value: number) => void | — | Called with the new value (only when it changes). |
value | number | — | Current value (controlled); null where it means "nothing selected". |
defaultValue | number | — | Initial value when uncontrolled. |
nextLabel | string | — | — |
previousLabel | string | — | — |
pageCountrequirednumber
onValueChange(value: number) => void
Called with the new value (only when it changes).
valuenumber
Current value (controlled); null where it means "nothing selected".
defaultValuenumber
Initial value when uncontrolled.
nextLabelstring
previousLabelstring
Other props are passed to the root element (HTMLAttributes<HTMLElement>), including className, style, id and aria-* attributes.
const [page, setPage] = useState(2);
<Pagination value={2} pageCount={8} onValueChange={setPage} />