Pagination
Leave feedbackNavigation between multiple pages of some set of results. Controls are provided to navigate through multiple pages of related data.
Basic usage (Default Size)
Any Paragon component or export may be added to the code example.
Secondary
Any Paragon component or export may be added to the code example.
Reduced
Any Paragon component or export may be added to the code example.
Minimal
Any Paragon component or export may be added to the code example.
Basic usage (Small Size)
Any Paragon component or export may be added to the code example.
Secondary (Small Size)
Any Paragon component or export may be added to the code example.
Reduced (Small Size)
Any Paragon component or export may be added to the code example.
Minimal (Small Size)
Any Paragon component or export may be added to the code example.
Inverse Pallete (Default Size)
Any Paragon component or export may be added to the code example.
Inverse Pallete (Small Size)
Any Paragon component or export may be added to the code example.
Theme Variables (SCSS)#
$pagination-padding-y: .625rem !default;$pagination-padding-x: 1rem !default;$pagination-padding-y-sm: .8rem !default;$pagination-padding-x-sm: .6rem !default;$pagination-padding-y-lg: .75rem !default;$pagination-padding-x-lg: 1.5rem !default;$pagination-margin-x: .5rem !default;$pagination-margin-y: .5rem !default;$pagination-line-height: 1.5rem !default;$pagination-font-size-sm: .875rem !default;$pagination-icon-size: 1.375rem !default;$pagination-icon-size-sm: 1rem !default;$pagination-icon-width: 2.25rem !default;$pagination-icon-height: 2.25rem !default;$pagination-padding-icon: .5rem !default;$pagination-toggle-border: .3125rem !default;$pagination-toggle-border-sm: .25rem !default;$pagination-secondary-height: 2.75rem !default;$pagination-secondary-height-sm: 2.25rem !default;$pagination-color: $link-color !default;$pagination-color-inverse: $white !default;$pagination-bg: $white !default;$pagination-border-width: $border-width !default;$pagination-border-color: theme-color("gray", "border") !default;$pagination-focus-box-shadow: $input-btn-focus-box-shadow !default;$pagination-focus-outline: 0 !default;$pagination-focus-border-width: .125rem !default;$pagination-focus-color: $primary-500 !default;$pagination-focus-color-text: $black !default;$pagination-hover-color: $link-hover-color !default;$pagination-hover-bg: theme-color("gray", "background") !default;$pagination-hover-border-color: theme-color("gray", "border") !default;$pagination-active-color: $component-active-color !default;$pagination-active-bg: $component-active-bg !default;$pagination-active-border-color: $pagination-active-bg !default;$pagination-disabled-color: theme-color("gray", "light-text") !default;$pagination-disabled-bg: $white !default;$pagination-disabled-border-color: theme-color("gray", "disabled-border") !default;$pagination-border-radius-sm: $border-radius-sm !default;$pagination-border-radius-lg: $border-radius-lg !default;$pagination-reduced-dropdown-max-height: 60vh !default;$pagination-reduced-dropdown-min-width: 6rem !default;
Props API#
- onPageSelect
funcRequiredSpecifies a callback function that is executed when the user selects a page button or the
Previous/Nextbuttons. For example:<Pagination onPageSelect={(pageNumber) => { console.log(pageNumber); } /> - pageCount
numberRequiredSpecifies the total number of pages in the
Paginationcomponent. - paginationLabel
stringRequiredSpecifies the
aria-labelfor the<nav>element that wraps the pagination button list. - buttonLabels
shape{previous:string,next:string,page:string,currentPage:string,pageOfCount:}string,Default{ previous: PAGINATION_BUTTON_LABEL_PREV, next: PAGINATION_BUTTON_LABEL_NEXT, page: PAGINATION_BUTTON_LABEL_PAGE, currentPage: PAGINATION_BUTTON_LABEL_CURRENT_PAGE, pageOfCount: PAGINATION_BUTTON_LABEL_PAGE_OF_COUNT, }Specifies the labels to use for the
Previous/Nextbuttons as well as the various parts ofaria-labelon the page buttons for accessibility. All button labels accept both string or elements. The button label options are as follows:previous: Text for thePreviousbutton;next: Text for theNextbutton;page: Text in thearia-labelon page buttons to describe the button (e.g., "Page 1");currentPage: Text to depict the selected page in thearia-labelon page buttons (e.g., "Page 1, Current Page");pageOfCount: Text that separates the current page and total page count for the mobile UI (e.g., "Page 1 of 20").The default is:
{ previous: 'Previous', next: 'Next', page: 'Page', currentPage: 'Current Page', pageOfCount: 'of', } - className
stringSpecifies any class name(s) for the
Paginationcomponent. The default is an empty string. - currentPage
numberDefault1specifies the page that the
Paginationcomponent will automatically select. The default is1. - maxPagesDisplayed
greaterThan(4)Default7Specifies the number of page buttons to display in between the
PreviousandNextbuttons. This number also includes any ellipses in the total count. Also, to ensure that at least one clickable page button is shown when both ellipses are displayed, this value must be greater than4. The default is7. - icons
shape{leftIcon:node,rightIcon:}node,Default{ leftIcon: <Icon src={ChevronLeft} />, rightIcon: <Icon src={ChevronRight} />, }Specifies icons used to indicate previous and next page. Can be an element, string, symbol, etc. Default is chevrons rendered using fa-css.
- variantDefault'default'
enum'default' | 'secondary' | 'reduced' | 'minimal' - invertColorsDefaultfalse
bool - sizeDefault'default'
enum'default' | 'small'
Usage Insights#
Pagination
| Project Name | Paragon Version | Instance Count | |
|---|---|---|---|
| frontend-app-admin-portal | 20.39.2 | 3 | |
| frontend-app-ecommerce | 20.35.0 | 1 | |
| frontend-app-learner-dashboard | 20.32.0 | 1 | |
| frontend-app-library-authoring | 20.45.5 | 4 | |
| frontend-app-program-console | 20.32.0 | 2 | |
| frontend-app-publisher | 20.28.5 | 1 | |
| catalog-search | 20.45.0 | 1 | |
| prospectus | 20.45.2 | 1 | |
| studio-frontend | 3.4.8 | 1 |
PaginationReduced
| Project Name | Paragon Version | Instance Count | |
|---|---|---|---|
| frontend-app-admin-portal | 20.39.2 | 1 |