1.0.10 • Published 5 months ago

paginate-vuejs v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Paginate Vuejs

Uniflapp - paginate-vuejs npm version npm downloads License

NPM

Note: This version only works with Vue 3


Pagination

The Pagination component allows the user to choose a particular page from a selection of pages.

Basic pagination

Basic pagination

Outlined pagination

Outlined pagination

Rounded pagination

Rounded pagination

Show buttons

You can optionally enable first-page and last-page buttons.

Show buttons

Hide buttons

You can optionally disable the previous-page and next-page buttons.

Hide buttons

Custom icons

It's possible to customize the control icons.

Custom icons

Pagination ranges

You can specify how many digits to display either side of current page with the siblingCount prop, and adjacent to the start and end page number with the boundaryCount prop.

Pagination ranges

Pagination API

Explore the API reference documentation for the Vuejs Pagination component, where you can discover information regarding its props, classes, and other available APIs.

Demos

This is a simple Demo environment for the package where you can use and test the package.

Import

App.vue

<script setup>
// Import the package
import { Pagination } from "paginate-vuejs";

// Import the CSS file to apply the default styling.
import 'paginate-vuejs/dist/style.css';

const clickCallback = (pageNum) => {
  // Add your code here
};
</script>

<template>
  <Pagination :total="100" :clickHandler="clickCallback" />
</template>

OR

main.js

import { createApp } from 'vue';
import App from './App.vue';

// Import the package
import Pagination from 'paginate-vuejs';

// Import the CSS file to apply the default styling.
import 'paginate-vuejs/dist/style.css';

// Register the package
createApp(App).use(PaginateVuejs).mount('#app');

import { Pagination } from "paginate-vuejs";

App.vue

<script setup>
const clickCallback = (pageNum) => {
  // Add your code here
};
</script>

<template>
  <Pagination :total="100" :clickHandler="clickCallback" />
</template>

Props

Component Attributes

NameTypeDefaultDescription
totalinteger___The total count of pages is required.
perPagebool10The number of items or records displayed on each page.
currentPageinteger1The current page active.
siblingCountinteger1Number of always visible pages before and after the current page.
boundaryCountinteger1Number of always visible pages at the beginning and end.
hideNextButtonboolfalseIf true, hide the next-page button.
hidePrevButtonboolfalseIf true, hide the previous-page button.
showFirstButtonboolfalseShow the First button.
showLastButtonboolfalseShow the Last button.
clickHandlerfunc___Callback fired when the page is changed. function(page: number) => void page The page selected.
type'link' \| 'button''button'HTML Element type of the pagination component.
linkUrlstring'#'Necessary when the type attribute is configured as 'link' and should include the "{page}" placeholder for it to be substituted with the actual page number when rendering.
disablePaginationboolfalseToggle the buttons for the entire component on/off.
disablePaginationboolfalseToggle the buttons for the entire component on/off.
paginationTypes'normal' \| 'standard' \| 'minimal' \| 'of'normalThe style of pagination to be applied ('normal', 'standard', 'minimal', or 'of').

Class Name Attributes

NameDefaultDescription
pageContainerClass'pagination-container'Styles applied to the component's container.
pageItemClass'page-item'Styles applied to individual page items.
pageLinkClass'page-link'Styles applied to page links.
activeClass'active'Styles applied to the currently active page.
ellipsisClass'pagination-ellipsis'Styles applied to the ellipsis indicator.

Slot Names

These slot names can be utilized for Vue Slots to insert custom HTML into the specified element.

NameTarget
firstBtnFirst page button
lastBtnLast page button
prevBtnPrevious page button
nextBtnNext page button
ellipsisTextEllipsis indicator

Author

Dadda Abdelghafour

License

The MIT License

1.0.9

5 months ago

1.0.10

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

2.0.1

7 months ago

2.0.0

7 months ago

1.1.2

7 months ago

1.1.1

7 months ago

1.1.0

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago