Pagination

Maintainer:
jhoncool
GitHub
page
pageSize
total
compact
showInput
showPages
import {Pagination} from '@gravity-ui/uikit';

This component renders pagination.

Usage

import {Pagination, PaginationProps} from '@gravity-ui/uikit';

const [state, setState] = React.useState({page: 1, pageSize: 100});

const handleUpdate: PaginationProps['onUpdate'] = (page, pageSize) =>
  setState((prevState) => ({...prevState, page, pageSize}));

const pagination = <Pagination page={1} pageSize={100} total={1000} onUpdate={handleUpdate} />;

Properties

NameDescriptionTypeDefault
classNameclass HTML attributestring
compactHides the title for the First, Previous, and Next buttons. Always set to true in mobile version.booleantrue
onUpdateCalled when the page number or pageSize is changedFunction
sizeSize of the pagination items. By default, its value is l in mobile version and m, in desktop versionstring
pageCurrent page numbernumber
pageSizeNumber of data items per pagenumber
pageSizeOptionsAllows you to specify the sizeChanger optionsnumber[]
totalTotal number of data itemsnumber
showInputShows input to navigate to pages directlybooleanfalse
showPagesShows page numberingbooleantrue
qadata-qa HTML attribute, used for testingstring