Skip to main content

Pagination

This is the <Pagination /> component.


of 10

Basic Usage

import Pagination from '@candy/kitkat/pagination'

export const MyComponent = () => (
<Pagination
page={page}
pageCount={pageCount || 1}
onPageChange={onPageChange}
previousButton={<ArrowLeft width={24} height={24} />}
nextButton={<ArrowRight width={24} height={24} />}
/>
)

Props

NameTypeDefaultDescription
className?string''Css class name
nextButton?ReactNode{'>'}Next button element
onPageChange?((page: number) => void) | nullnullCallback function when the page has changed
page'light' | 'dark'darkCurrent page
pageCountany[]Total number of pages
previousButton?ReactNode{'<'}Previous button element