@k8ordo/ui

Pagination

Paging with previous and next buttons and the current position. There is no list of page numbers.

Import

ts
import { Pagination } from '@k8ordo/ui';

Usage

tsx
const [page, setPage] = useState(1);

<Pagination
  currentPage={page}
  onChange={setPage}
  totalPages={10}
/>

Disabled

tsx
<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: -
PropTypeDefault
currentPagenumber-
onChange(page: number) => void-
totalPagesnumber-
aria-label?string-
disabled?booleanfalse
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

k8ordo

React libraries that use Baseline features without holding back.