Pagination
Pagination allows you to divide large amounts of content into smaller chunks across multiple pages.Installation
| Install | yarn add @atlaskit/pagination |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/pagination, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
| Description | Additional information to be included in the |
|---|---|
| Type | { [x: string]: any; } |
| Description | Replace the built-in page, previous, next and/ or ellipsis component |
|---|---|
| Type | { Page?: React.ElementType<any, keyof React.JSX.IntrinsicElements>; Previous?: React.ElementType<any, keyof React.JSX.IntrinsicElements>; Next?: React.ElementType<...>; } |
| Description | Index of the page to be selected by default. |
|---|---|
| Type | number |
| Description | Helper function to get text displayed on the page button. This is helpful in scenarios when page the page passed in is an object. |
|---|---|
| Type | (page: T, pageIndex: number) => string | number |
| Description | Sets whether the Paginator is disabled |
|---|---|
| Type | boolean |
| Description | The aria-label for the pagination nav wrapper. The default value is "pagination". |
|---|---|
| Type | string |
| Description | Maximum number of pages to be displayed in the pagination. |
|---|---|
| Type | number |
| Description | The aria-label for the next button. The default value is "next". |
|---|---|
| Type | string |
| Description | The onChange handler which is called when the page is changed. |
|---|---|
| Type | (event: React.SyntheticEvent<Element, Event>, page: T, analyticsEvent?: UIAnalyticsEvent) => void |
| Description | The aria-label for the individual page numbers. The default value is "page". The page number is automatically appended to the pageLabel. For Example, pageLabel="página" will render aria-label="página 1" as the label for page 1. |
|---|---|
| Type | string |
| Description | Array of the pages to display. |
|---|---|
| Type | T[] |
| Description | The aria-label for the previous button. The default value is "previous". |
|---|---|
| Type | string |
| Description | No description. |
|---|---|
| Type | ((instance: HTMLDivElement) => void) | React.RefObject<HTMLDivElement> |
| Description | The react Node returned from the function is rendered instead of the default ellipsis node. |
|---|---|
| Type | (arg: { key: string; from: number; to: number; }) => React.ReactElement<any, string | React.JSXElementConstructor<any>> |
| Description | Index of the selected page. This will make this pagination controlled. |
|---|---|
| Type | number |
| Description | Style to spread on the container element. |
|---|---|
| Type | React.CSSProperties |
| Description | A Will set data-testid on these elements when defined:
|
|---|---|
| Type | string |