Skip to content
Basic pagination layout calculator
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
network.js
network.png
network.test.js
package-lock.json
package.json
pagination-layout.html
pagination-layout.js
pagination-layout.min.js
pagination-layout.test.js

README.md

Pagination Layout

In keeping with the idea that data should represent your layout, this simple library will help you calculate your pagination navigation view.

demo

network

Usage

npm version

or

<script src="https://unpkg.com/pagination-layout@1.0.5/pagination-layout.js"></script>
<!-- prod -->
<script src="https://unpkg.com/pagination-layout@1.0.5/pagination-layout.min.js"></script>
const pages = [ [], [], [], [], [] ];
paginationLayout(pages);
// => [1, 2, 3, 4, 5]

const pages = [ [], [], [], [], [], [], [], [] ];
const currentPage = 4;
paginationLayout(pages, currentPage);
// => [1, "...", 3, 4, 5, "...", 8]

Build

uglifyjs pagination-layout.js > pagination-layout.min.js

Publish

npm publish
You can’t perform that action at this time.