Skip to content

Pagination

Pagination component with page numbers, supporting custom sibling count, responsive collapsing, different sizes, and global theme configuration.

Built on top of Radix Vue Pagination and BrConfigProvider.

Basic Usage

The most basic pagination, binding the current page number via v-model:page.

Current page: 1
Example

Custom Sibling Count

Control the number of page numbers shown on each side of the current page via the sibling-count prop.

Sibling count: 3
Example

Different Sizes

Supports xs, sm, md, lg, xl, 2xl size variants.

Extra Small (xs)
Small (sm)
Medium (md)
Large (lg)
Extra Large (xl)
2 Extra Large (2xl)
Example

Responsive Pagination

Combine with useWindowSize from @vueuse/core to dynamically control sibling-count for automatic collapsing on smaller screens.

Try resizing the window width (< 640px)
Example

Theming

The colors (primary, active color), border radius, and sizes of the BrPagination component are fully implemented based on CSS variables provided by BrConfigProvider.

Example

You can also locally override via TailwindCSS:

vue
<BrPaginationLink class="rounded-full border-blue-500 text-blue-500" />

API

BrPagination

PropTypeDefaultDescription
totalnumber-Total number of items
page (v-model)number1Current page number
itemsPerPagenumber10Number of items per page
siblingCountnumber1Number of page numbers shown on each side of the current page
showEdgesbooleanfalseWhether to always show the first and last page numbers
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl''md'Pagination button size, overrides global configuration
PropTypeDefaultDescription
valuenumber-The value of the corresponding page number
isActivebooleanfalseWhether it is active
disabledbooleanfalseWhether it is disabled
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'-Size variant

Other Sub-components

BrPaginationPrevious, BrPaginationNext, BrPaginationFirst, BrPaginationLast, etc. all support passing class to override styles via TailwindCSS.