import * as React from 'react'import { Pagination, PaginationProps } from '@welcome-ui/pagination'const Example = () => {const [page, setPage] = React.useState<PaginationProps['page']>(8)return (<Paginationaria-label="Pagination"getHref={page => `?page=${page}`}onChange={page => setPage(Number(page))}page={page}pageCount={10}/>)}export default Example
Installation
1
Run the following command:
yarn add @welcome-ui/pagination
2
Import component:
import { Pagination } from '@welcome-ui/pagination'
Range display
When your range display is above your pageCount, all the pages are shown.
Change range with rangeDisplay
, by default it is 5
.
Custom navigation
Set custom previous and next buttons using leftArrow
and rightArrow
.