Sliding Pagination for Vue is an ARIA-compliant pagination component with a sliding window. Basic use of the pagination component requires only the current page, the total number of pages, and a handler called Change on Page.
aria current pagination, accessible pagination buttons, table pagination accessibility, accessible navigation, w3c pagination, wcag pagination, bootstrap pagination accessibility
How to make use of it:
Install and download:
# Yarn $ yarn add vue-sliding-pagination # NPM $ npm install vue-sliding-pagination --save
1. Import the vue-sliding-pagination component into your app.
import SlidingPagination from 'vue-sliding-pagination'
2. Add the pagination component to the form as follows:
<template> <sliding-pagination :current="current" :total="total" @page-change="onPageChange" > </sliding-pagination> </template>
export default { name: 'SimpleExample', components: { SlidingPagination }, data() { return { current: 1, total: 10 } }, methods: { onPageChange (page) { this.current = page } } }
3. The default props for configuring pagination controls.
ariaPaginationLabel: { type: String, required: false, default: 'Pagination Navigation' }, ariaGotoPageLabel: { type: String, required: false, default: 'Go to page %page% of %total%' }, ariaPreviousPageLabel: { type: String, required: false, default: 'Go to previous page' }, ariaNextPageLabel: { type: String, required: false, default: 'Go to next page' }, ariaCurrentPageLabel: { type: String, required: false, default: 'Page %page% of %total%, current page' }, classMap: { type: Object, required: false, default: () => { return defaultClassMap } }, current: { required: true, type: Number }, total: { required: true, type: Number }, slidingEndingSize: { required: false, type: Number, default: 2 }, slidingWindowSize: { required: false, type: Number, default: 3 }, nonSlidingSize: { required: false, type: Number, default: 9 }, pageComponent: { required: false, type: String, default: 'sliding-pagination-default-page' }
Options
name | type | default | description |
---|---|---|---|
ariaPaginationLabel | String | 'Pagination navigation' | ARIA label for the whole <nav> area |
ariaGotoPageLabel | String | 'Go to page %page% of %total%' | ARIA label for a page link that is not the current page |
ariaPreviousPageLabel | String | 'Go to previous page' | ARIA label for the previous page action |
ariaNextPageLabel | String | 'Go to next page' | ARIA label for the next page action |
ariaCurrentPageLabel | String | 'Page %current of %total, current page' | ARIA label for the current page |
classMap | Object | default class map | CSS classes used by the components |
current | Number | – | Integer representing the current page |
total | Number | – | Integer representing the total number of pages |
slidingEndingSize | Number | 2 | Number of always listed pages on the beginning and end |
slidingWindowSize | Number | 3 | Number of pages in the sliding window |
nonSlidingSize | Number | 9 | Number of pages before the paginator switches to sliding mode |
pageComponent | String | 'sliding-pagination-default-page' | Component name (must be registered) for the page elements |
Accessible Pagination Component, Sliding Pagination for Vue Plugin/Github
See Demo And Download
Official Website(eFrane): Click Here
This superior jQuery/javascript plugin is developed by eFrane. For extra advanced usage, please go to the official website.