Thanks to visit codestin.com
Credit goes to github.com

Skip to content

F4RAN/vue3-pagin8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Vue Pagin8

A simple, lightweight, and customizable pagination component for Vue 3 applications.

Designed for client-side pagination interfaces where page changes trigger backend API calls.

Looking for Vue 2?
๐Ÿ‘‰ https://www.npmjs.com/package/vue-pagin8


Preview

preview-1 preview-2 preview-3 preview-4 preview-5 preview-6 preview-7 preview-8


Features

  • Fully compatible with Vue 3
  • Arrow-based and input-based navigation
  • Customizable color themes
  • Emits page-change events for API-driven pagination
  • Lightweight and easy to integrate

Installation

npm install vue3-pagin8

Demo

Live demo:
๐Ÿ‘‰ https://f4ran.github.io/vue3-pagin8/


Component-Level Usage

<template>
  <Paginate
    :initPage="1"
    :totalPages="totalPages"
    :color="'red'"
    @currentPage="fetchPage"
  />
</template>

<script>
import Paginate from "vue3-pagin8";

export default {
  components: { Paginate },
  data() {
    return {
      totalPages: 10,
    };
  },
  methods: {
    fetchPage(page) {
      // Call your backend API with selected page
      console.log("Selected page:", page);
    },
  },
};
</script>

Global Registration (Vue 3)

import { createApp } from "vue";
import App from "./App.vue";
import Paginate from "vue3-pagin8";

const app = createApp(App);
app.component("Paginate", Paginate);
app.mount("#app");

Props

Property Description Accepted Values
initPage Initial page number 1, 2, 3, ...
totalPages Total number of pages 1, 2, 3, ...
color Theme color green, red, orange, blue, gray, purple, dark

Events

Event Description Parameters
currentPage Triggered when page changes page (Number)
reset Resets component state (use with ref) none

Reset Example

<Paginate ref="pagin8" />

<script>
this.$refs.pagin8.reset();
</script>

Contribution

Contributions are welcome.
Feel free to open issues or submit pull requests on GitHub.


License

MIT

About

Vue pagination using beautiful and simple methods

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published