Components
Pagination

Pagination

Import

import { VKPagination } from "@vivakits/react-components";

Basic

The handlePageChange, totalPages and currentPage props are required. The handlePageChange function updates the currentPage state. totalPages defines the total number of pages, while currentPage indicates the current page the user is on.

Total Record

The totalRecord and noOfEntries props control the total number of items and the number of items per page.

-
of 50

Alignment

The rtl prop is used to align the pagination on the left or right side.

CustomIcon

The nextIcon and previousIcon props enable customization of navigation icons for forward and backward movements within the component.

Custom pagination

Pagination can be customized using paginationWrapperClassName and paginationButtonClassName props.

-
of 50

Table pagination

NamePositionAgeStart DateSalary
Humfrey ScainConstruction Foreman4008/10/2023150,000
Jeane SherlandElectrician3812/12/2023140,000
Merrie Van SonConstruction Worker3730/06/2023110,000
Myrtia FitchellProject Manager3509/04/2024110,000
Betty GiannottiConstruction Worker3010/02/2024140,000
-
of 50

API Reference

AttributeTypeDescriptionDefault
totalPagesnumberDefines the total number of pages. -
currentPagenumberIndicates the current page the user is on. -
totalRecordnumberControl the total number of items. -
noOfEntriesnumberControl the total the number of items per page. -
nextIconReactNodeEnable customization of navigation icons for forward movements within the component. -
previousIconReactNodeEnable customization of navigation icons for backward movements within the component. -
dynamicPreviousTextstringChanges the text for previous button. -
dynamicNextTextstringChanges the text for next button. -
rtlbooleanAdjusts the pagination position to either the left or right side. false
entriesShowingSpaceTextstringShows text before entries. -
handlePageChangefunctionCallback function triggered when the page is changed. -
paginationWrapperClassNameCSSChanges pagination body style. -
paginationNoOfEntriesWrapperClassNameCSSChanges NoOfEntries body style. -
paginationPrevBtnClassNameCSSChanges previous button style. -
paginationNextBtnClassNameCSSChanges next button style. -
paginationButtonClassNameCSSChanges paginaton button style. -
paginationButtonSelectedClassNameCSSChanges paginaton selected button style. -