Description
giant-piano is a small Javascript pagination utility. All it does is providing you the logic to render a pagination component in your app.
Features
Usage
npm install giant-piano --save
Then, in your app:
var createPagination = require('giant-piano');
var paginate = createPagination({ itemsPerPage: 10, maxPages: 5 });
console.log(paginate({ currentPage: 5, totalItems: 63 }));
console.log(paginate({ currentPage: 2, totalItems: 34 }));
console.log(paginate({ currentPage: 1, totalItems: 1234 }));
Run demo locally
npm start
License
MIT