Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

headless-pagination-react

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

headless-pagination-react

Headless pagination library for react with hooks

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
160
Maintainers
1
Weekly downloads
 
Created
Source

Headless Pagination React

React hook that provides the functionality from headless-pagination

Installation

Both the core library and this react adapter are required

npm i -S headless-pagination headless-pagination-react

Usage

This hook simply exposes the values provided by the core library. To read more about their usages, visit the headless-pagination documentation.

Note: In the core library, values (such as from, to, links, etc) are exposed as functions that return a value. In this hook they are not functions, they simply expose the raw underlying value.

import usePagination from 'headless-pagination-react';

function Component() {
  const {
    page,
    links,
    hasNext,
    hasPrevious,
    from,
    to,
    setPage,
    onNext,
    onPrevious,
  } = usePagination({
    totalItems: 1000, // required
    perPage: 24, // optional
    maxLinks: 7, // optional
    initialPage: 1, // optional
  });
}

FAQs

Package last updated on 17 Feb 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc