react-pagination-hook
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Welcome to react-pagination-hook 👋

Documentation Maintenance License: MIT

A React hook that helps you render a paginator (with TypeScript support)

🏠 See a demo

Prerequisites

  • react >=16.8.0

Install

npm install react-pagination-hook --save

API

The hook returns the following object:

{
  activePagenumber;
  isFirstboolean;
  isLastboolean;
  hasPreviousboolean;
  hasNextboolean;
  visiblePiecesPaginatorPiece[];
  goToPage: (pageNumber: number) => void;
}

And a PaginatorPiece is either of the following objects:

{ type'previous', pageNumbernumber, isDisabledboolean }
// or
{ type'next', pageNumbernumber, isDisabledboolean }
// or
{ type'page-number', pageNumbernumber }
// or
{ type'ellipsis' }

Usage

You can use this hook to develop your own pagination component. Check out the demo

Author

👤 Eliseu dos Santos <eliseumds@gmail.com>

🤝 Contributing

Contributions, issues and feature requests are welcome !
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 Eliseu dos Santos <eliseumds@gmail.com>.
This project is MIT licensed.


This project was bootstraped with typescript-library-starter

This README was generated with ❤️ by readme-md-generator

Package Sidebar

Install

npm i react-pagination-hook

Weekly Downloads

88

Version

0.0.1

License

MIT

Unpacked Size

42.7 kB

Total Files

13

Last publish

Collaborators

  • eliseumds