Pagination
Paging with previous and next buttons and the current position. There is no list of page numbers.
Import
Copy code
import { Pagination } from '@k8ordo/ui';Usage
Copy code
const [page, setPage] = useState(1);
<Pagination
currentPage={page}
onChange={setPage}
totalPages={10}
/>Disabled
Copy code
<Pagination
currentPage={3}
disabled
onChange={() => {}}
totalPages={10}
/>Props
currentPage- Type:
number - Default: -
onChange- Type:
(page: number) => void - Default: -
totalPages- Type:
number - Default: -
aria-label?- Type:
string - Default: -
disabled?- Type:
boolean - Default:
false nextLabel?- Type:
string - Default: -
prevLabel?- Type:
string - Default: -
ref?- Type:
Ref<HTMLElement> - Default: -
| Prop | Type | Default |
|---|---|---|
currentPage | number | - |
onChange | (page: number) => void | - |
totalPages | number | - |
aria-label? | string | - |
disabled? | boolean | false |
nextLabel? | string | - |
prevLabel? | string | - |
ref? | Ref<HTMLElement> | - |
Inherited attributes (except the ones set internally): HTMLAttributes<HTMLElement>
The wording this component draws (labels, placeholders, and so on) comes from the message dictionary unless a prop sets it. To replace it, see: i18n