You are viewing a PR preview for PR #1506

Agriculture Design System
Beta
Design System for the Export Service

Pagination

Pagination separates large amounts of content into separate pages, which helps reduce cognitive load.

View in FigmaView in StorybookView in Github
import { ... } from '@ag.ds-next/react/pagination';

Usage

Pagination components can be imported via the pagination entrypoint in the @ag.ds-next/react package.

For example:

import { ... } from '@ag.ds-next/react/pagination';

Props

Pagination Props
PropTypeDescription
currentPagenumberThe current page number.
generateHref(pageNumber: number) => stringFunction to generate a href for each list item.
totalPagesnumberThe total number of pages.
aria-label?stringDescribes the navigation element to assistive technologies.
itemRangeText?stringText to describe the range of items shown.
itemsPerPage?numberThe selected number of items per page.
itemsPerPageOptions?number[]The options for the items per page select.
onItemsPerPageChange?((itemsPerPage: number) => void)Callback when the items per page is changed.
windowLimit?numberDefault: "3"Controls how many list items are shown.
PaginationButtons Props
PropTypeDescription
currentPagenumberThe current page number.
onChange(pageNumber: number) => voidCallback for when a list item is pressed.
totalPagesnumberThe total number of pages.
aria-label?stringDescribes the navigation element to assistive technologies.
itemRangeText?stringText to describe the range of items shown.
itemsPerPage?numberThe selected number of items per page.
itemsPerPageOptions?number[]The options for the items per page select.
onItemsPerPageChange?((itemsPerPage: number) => void)Callback when the items per page is changed.
windowLimit?numberDefault: "3"Controls how many list items are shown.

Source

You can view the full source code for this package on Github.