Pagination
The Pagination component is responsive and flexible way to indicate a series of related content exists across multiple pages.
Examples
Base
Slots
Use slots to override the specific buttons.
Pagination component
A responsive and flexible pagination.
html
<o-pagination></o-pagination>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
ariaCurrentLabel | Accessibility label for the current page button. | string | - | From config: pagination: { |
ariaNextLabel | Accessibility label for the next page button. | string | - | From config: pagination: { |
ariaPageLabel | Accessibility label for the page button. | string | - | From config: pagination: { |
ariaPreviousLabel | Accessibility label for the previous page button. | string | - | From config: pagination: { |
buttonTag | Pagination button tag name | DynamicComponent | - | From config: pagination: { |
current | Current page number, use v-model:current to make it two-way binding | number | - | 1 |
iconNext | Icon to use for next button | string | - | From config: pagination: { |
iconPack | Icon pack to use | string | mdi , fa , fas and any other custom icon pack | From config: pagination: { |
iconPrev | Icon to use for previous button | string | - | From config: pagination: { |
mobileBreakpoint | Mobile breakpoint as max-width value | string | - | From config: pagination: { |
order | Buttons order | "centered" | "left" | "right" | centered , right , left | From config: pagination: { |
override | Override existing theme classes completely | boolean | - | |
perPage | Items count for each page | number | string | - | From config: pagination: { |
rangeAfter | Number of pagination items to show after current page. | number | - | 1 |
rangeBefore | Number of pagination items to show before current page. | number | - | 1 |
rounded | Enable rounded button style | boolean | - | From config: pagination: { |
simple | Enable simple style | boolean | - | From config: pagination: { |
size | Pagination size | string | small , medium , large | From config: pagination: { |
total | Total count of items | number | - |
Events
Event name | Properties | Description |
---|---|---|
update:current | value number - updated current prop | current prop two-way binding |
change | value number - current value | on current change event |
Slots
Name | Description | Bindings |
---|---|---|
previous | Previous button slot | number number - page numberisCurrent boolean - if page is currentonClick (event:Event): void - click handlerariaLabel string - aria-label attribute |
next | Next button slot | number number - page numberisCurrent boolean - if page is currentonClick (event:Event): void - click handlerariaLabel string - aria-label attribute |
default | Pagination button slot | number number - page numberisCurrent boolean - if page is currentonClick (event:Event): void - click handlerariaLabel string - aria-label attribute |
Class Inspector
Class prop | Description | Props | Suffixes | |
---|---|---|---|---|
rootClass | Class of the root element. | |||
mobileClass | Class of the root element when on mobile. 👉 Switch to mobile view to see it in action! | |||
orderClass | Class of the root element with order. | order | centered | |
sizeClass | Class for the root elemnt with size. | size | small | |
simpleClass | Class of the root element when in `simple` mode. | simple | ||
infoClass | Class of the page info in `simple` mode. | simple | ||
listClass | Class of the items list element. | |||
listItemClass | Class of the list item element. | |||
ellipsisClass | Class of the ellipsis element. | |||
buttonClass | Class of the button element. | |||
roundedClass | Class of the button element when rounded. | rounded | ||
buttonCurrentClass | Class of the current button element. | |||
buttonPrevClass | Class of the prev button element. | |||
buttonNextClass | Class of the next button element. | |||
buttonDisabledClass | Class of the prev or next button when disabled. |
Sass variables
Current theme ➜ Oruga
SASS Variable | Default |
---|---|
$pagination-disabled-opacity | var(--#{$prefix}base-disabled-opacity) |
$pagination-ellipsis-color | var(--#{$prefix}grey-light) |
$pagination-button-border-color | var(--#{$prefix}grey-light) |
$pagination-button-border-radius | var(--#{$prefix}base-border-radius) |
$pagination-button-border | 1px solid transparent |
$pagination-button-color | var(--#{$prefix}black) |
$pagination-button-background-color | transparent |
$pagination-button-background-color-hover | var( --#{$prefix}grey-lighter) |
$pagination-button-current-background-color | var(--#{$prefix}primary) |
$pagination-button-current-border-color | var(--#{$prefix}primary) |
$pagination-button-current-color | #fff |
$pagination-button-height | 2.25em |
$pagination-button-hover-border-color | var(--#{$prefix}grey-light) |
$pagination-button-line-height | var(--#{$prefix}base-line-height) |
$pagination-button-margin | 0.25rem |
$pagination-button-min-width | 2.25em |
$pagination-button-padding | 0.5em 0.5em |
$pagination-margin | -0.25rem |
$pagination-rounded-border-radius | var( --#{$prefix}base-border-radius-rounded) |
See ➜ 📄 Full scss file
Current theme ➜ Bulma
The theme does not have any custom variables for this component.