Examples
Indeterminate
By not passing itemCount and passing toggleTemplate you can customize the toggle with text.
1 - 20 of many
Props
Pagination
| Name | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | What should be rendered inside the pagination. | |
| className | string | '' | Additional classes for the pagination container. |
| dropDirection | 'up' | 'down' | Direction of dropdown context menu. | |
| firstPage | number | 1 | Page to start at. |
| inset | { default?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl'; sm?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl'; md?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl'; lg?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl'; xl?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl'; '2xl'?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl'; } | Insets at various breakpoints. | |
| isCompact | boolean | false | Flag indicating if pagination is compact. |
| isDisabled | boolean | false | Flag indicating if pagination is disabled. |
| isLastFullPageShown | boolean | false | Indicate whether to show last full page of results when user selects perPage value greater than remaining rows. |
| isStatic | boolean | false | Flag indicating if pagination should not be sticky on mobile. |
| isSticky | boolean | false | Flag indicating if pagination should stick to its position (based on variant). |
| itemCount | number | Total number of items. | |
| itemsEnd | number | null | Last index of items on current page. |
| itemsStart | number | null | First index of items on current page. |
| menuAppendTo Beta | HTMLElement | (() => HTMLElement) | 'inline' | The container to append the pagination options menu to. | |
| offset | number | null | Start index of rows to display, used in place of providing page. |
| onFirstClick | (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void | () => undefined | Function called when user clicks on navigate to first page. |
| onLastClick | (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void | () => undefined | Function called when user clicks on navigate to last page. |
| onNextClick | (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void | () => undefined | Function called when user clicks on navigate to next page. |
| onPageInput | (event: React.KeyboardEvent<HTMLInputElement>, page: number) => void | () => undefined | Function called when user inputs page number. |
| onPerPageSelect | ( event: React.MouseEvent | React.KeyboardEvent | MouseEvent, newPerPage: number, newPage: number, startIdx?: number, endIdx?: number ) => void | () => undefined | Function called when user selects number of items per page. |
| onPreviousClick | (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void | () => undefined | Function called when user clicks on navigate to previous page. |
| onSetPage | ( event: React.MouseEvent | React.KeyboardEvent | MouseEvent, newPage: number, perPage?: number, startIdx?: number, endIdx?: number ) => void | () => undefined | Function called when user sets page. |
| ouiaId | number | string | Value to overwrite the randomly generated data-ouia-component-id. | |
| ouiaSafe | boolean | true | Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. |
| page | number | 1 | Current page number. |
| perPage | number | defaultPerPageOptions[0].value | Number of items per page. |
| perPageOptions | PerPageOptions[] | [ { title: '10', value: 10 }, { title: '20', value: 20 }, { title: '50', value: 50 }, { title: '100', value: 100 } ] | Array of the number of items per page options. |
| titles | PaginationTitles | { items: '', page: '', pages: '', itemsPerPage: 'Items per page', perPageSuffix: 'per page', toFirstPageAriaLabel: 'Go to first page', toPreviousPageAriaLabel: 'Go to previous page', toLastPageAriaLabel: 'Go to last page', toNextPageAriaLabel: 'Go to next page', optionsToggleAriaLabel: '', currPageAriaLabel: 'Current page', paginationAriaLabel: 'Pagination', ofWord: 'of' } | Object with titles to display in pagination. |
| toggleTemplate | ((props: PaginationToggleTemplateProps) => React.ReactElement<any>) | string | This will be shown in pagination toggle span. You can use firstIndex, lastIndex, itemCount, itemsTitle, and/or ofWord props. | |
| usePageInsets | boolean | Flag indicating that pagination should use page insets. | |
| variant | 'top' | 'bottom' | PaginationVariant | PaginationVariant.top | Position where pagination is rendered. |
| widgetId | string | 'options-menu' | Id to identify widget on page. |
PaginationTitles
| Name | Type | Default | Description |
|---|---|---|---|
| currPageAriaLabel | string | Accessible label for the input displaying the current page. | |
| items | string | The type or title of the items being paginated. | |
| itemsPerPage | string | The title of the pagination options menu. | |
| ofWord | string | Label for the English word "of". | |
| optionsToggleAriaLabel | string | Accessible label for the options toggle. | |
| page | string | The title of a page displayed beside the page number. | |
| pages | string | The title of a page displayed beside the page number (plural form). | |
| paginationAriaLabel | string | Accessible label for the pagination component. | |
| perPageSuffix | string | The suffix to be displayed after each option on the options menu dropdown. | |
| toFirstPageAriaLabel | string | Accessible label for the button which moves to the first page. | |
| toLastPageAriaLabel | string | Accessible label for the button which moves to the last page. | |
| toNextPageAriaLabel | string | Accessible label for the button which moves to the next page. | |
| toPreviousPageAriaLabel | string | Accessible label for the button which moves to the previous page. |
PerPageOptions
| Name | Type | Default | Description |
|---|---|---|---|
| title | string | The text title of the option, which is rendered inside the pagination dropdown menu. | |
| value | number | The value of the option, which determines how many items are displayed per page. |
PaginationToggleTemplateProps
| Name | Type | Default | Description |
|---|---|---|---|
| firstIndex | number | The first index of the items being paginated | |
| itemCount | number | The total number of items being paginated | |
| itemsTitle | string | The type or title of the items being paginated | |
| lastIndex | number | The last index of the items being paginated | |
| ofWord | React.ReactNode | The word that joins the index and itemCount/itemsTitle |
CSS variables
| Expand or collapse column | Selector | Variable | Value | |
|---|---|---|---|---|
| .pf-v6-c-pagination | --pf-v6-c-pagination--inset | 0 | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--ColumnGap | 1.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--BorderColor | (In light theme) rgba(255, 255, 255, 0.0000) | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--BorderBlockStartWidth | 0 | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--BorderBlockEndWidth | 0 | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-page-insets--inset | calc(1.5rem - 4px) | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination__nav--Display | none | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-display-summary__nav--Display | none | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-display-full__nav--Display | inline-flex | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination__nav--ColumnGap | 0.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination__nav-page-select--FontSize | 0.875rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination__nav-page-select--ColumnGap | 0.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination__nav-page-select--c-form-control--width-base | calc(1rem + 1rem + 1px * 2) | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination__nav-page-select--c-form-control--width-chars | 2 | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination__nav-page-select--c-form-control--Width | calc(calc(1rem + 1rem + 1px * 2) + (2 * 1ch)) | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination__total-items--Display | block | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-display-summary__total-items--Display | block | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-display-full__total-items--Display | none | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-sticky--BackgroundColor | (In light theme) #ffffff | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-sticky--BoxShadow | 0px
4px
4px
-4px
rgba(41, 41, 41, 0.2000) | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-sticky--PaddingBlockStart | 1rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-sticky--PaddingBlockEnd | 1rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-sticky--PaddingInlineStart | 1.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-sticky--PaddingInlineEnd | 1.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-sticky--ZIndex | 100 | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-sticky--InsetBlockStart | 0 | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-sticky--BorderBlockEndWidth | 0px | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--BackgroundColor | (In light theme) #ffffff | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--BoxShadow | 0px
-4px
4px
-4px
rgba(41, 41, 41, 0.2000) | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--m-sticky--BoxShadow | 0px
-4px
4px
-4px
rgba(41, 41, 41, 0.2000) | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--InsetBlockEnd | 0 | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--BorderBlockStartWidth | 0px | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--m-sticky--PaddingBlockStart | 0.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--m-sticky--PaddingBlockEnd | 0.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--m-sticky--PaddingInlineStart | 0.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--m-sticky--PaddingInlineEnd | 0.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--m-sticky--BorderBlockStartWidth | 0px | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--m-static--PaddingBlockStart | 0.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--m-static--PaddingBlockEnd | 0 | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--m-static--PaddingInlineStart | 0.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom--m-static--PaddingInlineEnd | 0.5rem | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination__page-menu--Display--base | block | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination__page-menu--Display | none | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-display-summary__page-menu--Display | none | ||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-display-full__page-menu--Display | block | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination--m-bottom__page-menu--Display | block | ||
| ||||
| .pf-v6-c-pagination | --pf-v6-c-pagination__page-menu--md--Display | block | ||
| ||||
| .pf-v6-c-pagination.pf-m-bottom | --pf-v6-c-pagination--m-sticky--BoxShadow | 0px
-4px
4px
-4px
rgba(41, 41, 41, 0.2000) | ||
| ||||
| .pf-v6-c-pagination.pf-m-bottom | --pf-v6-c-pagination--m-sticky--InsetBlockStart | auto | ||
| .pf-v6-c-pagination.pf-m-bottom | --pf-v6-c-pagination--BorderBlockStartWidth | 0px | ||
| ||||
| .pf-v6-c-pagination.pf-m-sticky | --pf-v6-c-pagination--m-bottom--InsetBlockEnd | 0 | ||
| .pf-v6-c-pagination.pf-m-sticky | --pf-v6-c-pagination--BorderBlockEndWidth | 0px | ||
| ||||
| .pf-v6-c-pagination.pf-m-sticky | --pf-v6-c-pagination--m-bottom--BorderBlockStartWidth | 0px | ||
| ||||
| .pf-v6-c-pagination.pf-m-page-insets | --pf-v6-c-pagination--inset | calc(1.5rem - 4px) | ||
| ||||
| .pf-v6-c-pagination.pf-m-display-summary | --pf-v6-c-pagination__nav--Display | none | ||
| ||||
| .pf-v6-c-pagination.pf-m-display-summary | --pf-v6-c-pagination__page-menu--Display | none | ||
| ||||
| .pf-v6-c-pagination.pf-m-display-summary | --pf-v6-c-pagination__total-items--Display | block | ||
| ||||
| .pf-v6-c-pagination.pf-m-display-full | --pf-v6-c-pagination__nav--Display | inline-flex | ||
| ||||
| .pf-v6-c-pagination.pf-m-display-full | --pf-v6-c-pagination__page-menu--Display | block | ||
| ||||
| .pf-v6-c-pagination.pf-m-display-full | --pf-v6-c-pagination__total-items--Display | none | ||
| ||||
| .pf-v6-c-pagination.pf-m-inset-none | --pf-v6-c-pagination--inset | 0 | ||
| .pf-v6-c-pagination.pf-m-inset-sm | --pf-v6-c-pagination--inset | 0.5rem | ||
| ||||
| .pf-v6-c-pagination.pf-m-inset-md | --pf-v6-c-pagination--inset | 1rem | ||
| ||||
| .pf-v6-c-pagination.pf-m-inset-lg | --pf-v6-c-pagination--inset | 1.5rem | ||
| ||||
| .pf-v6-c-pagination.pf-m-inset-xl | --pf-v6-c-pagination--inset | 2rem | ||
| ||||
| .pf-v6-c-pagination.pf-m-inset-2xl | --pf-v6-c-pagination--inset | 3rem | ||
| ||||

