onedionys / onedionys-pagination-component

A component to divide content into multiple pages, making it easier for users to navigate.

Home Page:https://www.npmjs.com/package/onedionys-pagination-component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to One Dionys - Pagination Component! πŸ‘‹

A component to divide content into multiple pages, making it easier for users to navigate. πŸ’–

πŸ’Ύ Requirements

  • Web Browser - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera].
  • Internet - Because many use CDN and to make it easier to find solutions to all problems.

🎯 How To Use

Example Syntax

const generatePagination = require('pagination-component');

const currentPage = 5;
const totalPages = 10;
const visiblePages = 5;

const pagination = generatePagination(currentPage, totalPages, visiblePages);
console.log(pagination); // Output: [3, 4, 5, 6, 7]

Explanation

The generatePagination function takes three parameters:

  • currentPage: The current page number.
  • totalPages: The total number of pages.
  • visiblePages: The number of visible page links. It returns an array of page numbers to be displayed based on the current page, total pages, and visible pages.

Return Value

  • The function returns an array of page numbers to be displayed.

πŸ“† Release Date

  • v1.0.0 : 07 March 2024
  • v1.0.1 : 11 March 2024
  • v4.0.0 : 11 March 2024
  • v4.0.1 : 13 March 2024
  • v4.0.2 : 18 March 2024
  • v5.0.0 : 31 March 2024

πŸ§‘ Author

πŸ“ License

  • Copyright Β© 2024 One Dionys
  • One Dionys - Pagination Component is an open source project licensed under the MIT license

β˜•οΈ Suppport & Donation

Love One Dionys - Pagination Component? Support this project by donating or sharing with others in need.

Made with ❀️ One Dionys

About

A component to divide content into multiple pages, making it easier for users to navigate.

https://www.npmjs.com/package/onedionys-pagination-component

License:MIT License


Languages

Language:JavaScript 100.0%