Socket
Socket
Sign inDemoInstall

react-pagination-hook

Package Overview
Dependencies
8
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-pagination-hook

A React hook that helps you render a paginator


Version published
Maintainers
1
Install size
42.6 kB
Created

Readme

Source

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:

{
  activePage: number;
  isFirst: boolean;
  isLast: boolean;
  hasPrevious: boolean;
  hasNext: boolean;
  visiblePieces: PaginatorPiece[];
  goToPage: (pageNumber: number) => void;
}

And a PaginatorPiece is either of the following objects:

{ type: 'previous', pageNumber: number, isDisabled: boolean }
// or
{ type: 'next', pageNumber: number, isDisabled: boolean }
// or
{ type: 'page-number', pageNumber: number }
// 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

Keywords

FAQs

Last updated on 16 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc