Help users view and navigate long lists of data by breaking them into "pages".
To implement a Pagination component, leverage the Pagination object which comprises three subcomponents: Pagination.Records, Pagination.Controls and Pagination.PageSize.
Pagination.Recordsdisplays thepageSizeand thetotalItemscount.Pagination.Controlsencompasses buttons for actions like navigating to specific pages, moving forward/backward, and going to the first or last page.Pagination.PageSizeenables thepageSizeto be changed via the menu.
Use these subcomponents in combination or independently, tailoring their placement based on your needs. You can configure their placement in different areas of the page or render them multiple times; for instance, you might choose to position the controls both above and below a table or list of data.
Usage
TSX
import { Pagination } from '@console/nimbus-ui/core';
...
<>
<Pagination.Records totalItems={200} ...others />
<Pagination.PageSize>
<Pagination.PageSize.Button>Items: {pageSize}</Pagination.PageSize.Button>
<Pagination.PageSize.Menu
onChange={setPageSize}
/>
</Pagination.PageSize>
<Pagination.Controls onPageChange={onPageChange} ...others />
</>
...
Figma