compact-pagination

2.0.0 • Public • Published

Pages

No fuss, opinionated pagination helper.

import compactPagination from 'compact-pagination'
 
compactPagination({
    totalSize: 10,
    currentIndex: 5,
    bufferSize: 1
});
 
/*
returns :
    [
        {page: 1},
        {isSeparator: true},
        {page: 4},
        {page: 5, isCurrent: true},
        {page: 6},
        {isSeparator: true},
        {page: 10}
    ]
which could be templated :
    1 … 4 5 6 … 10
*/

Readme

Keywords

Package Sidebar

Install

npm i compact-pagination

Weekly Downloads

184

Version

2.0.0

License

ISC

Unpacked Size

2.6 kB

Total Files

3

Last publish

Collaborators

  • vond