Skip to content

KPagination

A long list can be divided into several pages using Pagination, and only one page will be loaded at a time.

Install

bash
pnpm add @ikun-ui/pagination
bash
yarn add @ikun-ui/pagination
bash
npm install @ikun-ui/pagination

Basic usage

Pager with background

The isBg attribute gives the pager a background

Control and Layout

Use the layout attribute to enable related display controls

Disabled Pagination

Use disabled attribute to determine whether a pagination is disabled.

Customize next and prev

You can also control the paging button to display text or icons yourself

Pagination Size

Use the size property to control the pagination size. It supports enumerations such as md, sm, and lg.

Infinite Paging

For scenarios like search engines where there is no total number of pages,
you can use infinite paging

Pagination Props

NameTypeDefaultDescription
totalnumber0Total number of data items.
pagerCountnumber7Number of pagers. Pagination collapses when the total page count exceeds this value.
pageSizenumber10Item count of each page.
currentPagenumber1Current page number.
prevTextstring-Text for the prev button.
prevIconstring-Icon for the prev button(following the unocss standard).
nextTextstring-Text for the next button.
nextIconstring-Icon for the prev button(following the unocss standard).
infinitebooleanfalseEnable infinite paging.
layoutArray<'jumper' | 'sizes' | 'total' | 'pager'>['pager']Pagination control display order.
disabledbooleanfalseDisable the pagination.
size'sm' | 'md' | 'lg'mdPagination size.
pageSizesnumber[][10, 20, 30, 40, 50, 100]Options of item count per page.
isBgbooleanfalseShow pager background.
clsstring''Additional class for component
attrsany{}Additional attributes

Pagination Events

NameDescriptionType
currentChangeTriggered when currentPage changes.(event: CustomEvent)=> void
sizeChangeTriggered when pageSize changes.(event: CustomEvent)=> void

MIT Licensed