Skip to content

Pagination ​

Introduction ​

The Pagination component is used for displaying data in pages, improving user experience. You can use <MYPagination></MYPagination> or <MYPagination /> to implement a pagination component.

Basic Pagination ​

Basic Pagination
展开代码

Complete Color Customization ​

Complete Color Customization
Combine all color customization properties to achieve fully custom styles
Go to
展开代码

API Reference ​

Props ​

ParameterDescriptionTypeOptionsDefault
totalTotal number of data itemsnumber—0
pageSizeNumber of items per pagenumber—10
currentPageCurrent page numbernumber—1
maxPagerCountMaximum number of page buttonsnumber—7
layoutPagination component layoutstring—'prev, pager, next'
pageSizesOptional values for items per pagenumber[]—[]
backgroundWhether to add background color to pagination buttonsboolean—false
smallWhether to use small pagination styleboolean—false
hideOnSinglePageWhether to hide pagination when only one pageboolean—false
disabledWhether to disable the pagination componentboolean—false
prevColorPrevious/Next button background colorstringSupports hex colors or color names''
prevTextColorPrevious/Next button text colorstringSupports hex colors or color names''
itemColorPage button background colorstringSupports hex colors or color names''
itemTextColorPage button text colorstringSupports hex colors or color names''
activeItemColorActive page button background colorstringSupports hex colors or color names''
activeItemTextColorActive page button text colorstringSupports hex colors or color names''

Type Definitions ​

typescript
interface PaginationProps {
  total?: number;
  pageSize?: number;
  currentPage?: number;
  maxPagerCount?: number;
  layout?: string;
  pageSizes?: number[];
  background?: boolean;
  small?: boolean;
  hideOnSinglePage?: boolean;
  disabled?: boolean;
  prevColor?: string;
  prevTextColor?: string;
  itemColor?: string;
  itemTextColor?: string;
  activeItemColor?: string;
  activeItemTextColor?: string;
}

Released under the MIT License.