1.2.0 • Published 3 years ago

hui-pagination v1.2.0

Weekly downloads
13
License
MIT
Repository
github
Last release
3 years ago

Pagination :blue_book:

Version

Pagination provides you a page information.

ezgif com-gif-maker

Install

npm install --save hui-pagination

Usage

HTML

Create a container element.

<div id="pagination"></div>

JavaScript

Import a component.

const Pagination = require('hui-pagination'); /* CommonJS */
import Pagination from 'hui-pagination'; /* ES6 */

You can create an instance by passing the container element and option.

Information about each option is as follows:

NameTypeValue
totalPagesnumberNumber ot pages your data will have.
visiblePagesnumberNumber of pages you can see in one rotation.
bgColorstringColor of focused page button. It can be assigned color name or hex value.
const container = document.getElementById('pagination');
const option = {
  totalPages: 20,
  visiblePages: 10,
  bgColor: 'rgba(26, 92, 255, 1)',
}; /* This is default value. */

const instance = new Pagination(container, option);

instance.getPage();

And you can get a current page for getPage function.

1.2.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago