Socket
Book a DemoInstallSign in
Socket

@resourge/pagination

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@resourge/pagination

`Pagination` is a small function that returns an array containing information for the pagination creation.

1.2.0
latest
Source
npmnpm
Version published
Maintainers
0
Created
Source

Pagination

Pagination is a small function that returns an array containing information for the pagination creation.

Installation

Install using Yarn:

yarn add @resourge/pagination

or NPM:

npm install @resourge/pagination --save

Usage

import { pagination } from '@resourge/pagination';

pagination({
  /**
   * Current page
   */
  page: 0,
  /**
   * Total page number
   */
  totalPages: 10,
  /**
   * Number of "pages" displaying.
   * * Note: Current page will try to stay in the middle
   */
  displayRange: 5,
  /**
   * If pagination is disabled
   */
  disabled: false,
  /**
   * Method for "page" click
   */
  onPageChange: (page: number) => {},
  /**
   * Defines the "page" for first page
   * * When undefined the item will not be included
   */
  firstLabel: () => 'First Page',
  /**
   * Defines the "page" for previous page
   * * When undefined the item will not be included
   */
  previousLabel: () => 'Previous Page',
  /**
   * Defines the "page" for next page
   * * When undefined the item will not be included
   */
  nextLabel: () => 'Next Page',
  /**
   * Defines the "page" for last page
   * * When undefined the item will not be included
   */
  lastLabel: () => 'Last Page'
})

Others

react-hook: React-hook-pagination

react component: React-pagination

License

MIT Licensed.

Keywords

javascript

FAQs

Package last updated on 24 Feb 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.