Skip to content

TypeScript rewrite of PaginationJs. This time without JQuery and with more awesomness!

License

Notifications You must be signed in to change notification settings

lofcz/paginationts

Repository files navigation

NPM version

PaginationTs

PaginationTs Icon

TypeScript-based drop-in replacement of pagination.js without JQuery dependency and with extra features. Check out the demo for an interactive playground. Supports both client & server-side pagination. Accessible, optionally headless, comes with rich API and callbacks interface. Fully typed, SPA ready.



Getting Started

Install via npm:

npm install paginate-next --save

Or via CDN:

<script src="https://unpkg.com/paginate-next/dist/paginationts.js" />
<link rel="stylesheet" href="https://unpkg.com/paginate-next/dist/pagination.css" />

Paginate:

<div id="dataContainer"></div>
<div id="paginateContainer"></div>
const paginationIns = pagination("#paginateContainer", {
    dataSource: [1, 2, 3, 4, 5, 6 ],
    callback: function(data, pagination) {
        var html = template(data);
        document.getElementById("dataContainer").html(html);
    }
})

That's it! ⭐

License

MIT 💜