A Polymer element providing a solution to paginate lists (Polymer 1.0 compatible).
Install the component using Bower:
$ bower install mercury-paginator --save
Or download as ZIP.
-
Import polyfill:
<script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
-
Import custom element:
<link rel="import" href="bower_components/mercury-paginator/mercury-paginator.html">
-
Start using it!
<template is="dom-bind"> <mercury-paginator perpage="15" items="{{items}}"></mercury-paginator> <!-- Your structure data here --> <div class="div-table"> <div class="head-row"> <div class="div-cell">Id</div> <div class="div-cell">Item name</div> <div class="div-cell">Description</div> </div> <template id="items" is="dom-repeat" items="{{items}}"> <div class="div-row"> <div class="div-cell">{{item.id}}</div> <div class="div-cell">{{item.name}}</div> <div class="div-cell">{{item.description}}</div> </div> </template> </div> </template>
Specifies an array of elements to the component through the items property and set perpage property to a pagination number
*You can use iron-ajax element to fetch data from server.
In order to run it locally you'll need to fetch some dependencies and a basic server setup.
-
$ npm install -g bower polyserve
-
Install local dependencies:
$ bower install
-
Start development server and open
http://localhost:8080/components/my-repo/
.$ polyserve
For detailed changelog, check Releases.