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

@lidofinance/pagination

Package Overview
Dependencies
Maintainers
8
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lidofinance/pagination

React component for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)

  • 1.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-5.86%
Maintainers
8
Weekly downloads
 
Created
Source

Pagination Component

React component for Lido Finance projects. Part of Lido UI Components

Install

yarn add @lidofinance/pagination

Usage

import React from 'React'
import { Pagination } from '@lidofinance/pagination'

const TableExample: React.FC = () => {
  const [activePage, setActivePage] = React.useState(5)
  return (
    <Pagination
      siblingCount={1}
      pagesCount={10}
      activePage={activePage}
      onItemClick={setActivePage}
    />
  )
}

Props

type SiblingsCount = 0 | 1

type onItemClick = (index: number, e?: React.MouseEvent) => void

type PaginationProps = {
  pagesCount: number
  activePage?: number
  onItemClick: onItemClick
  siblingCount?: SiblingsCount
}
  • siblingCount - count of siblings which will be shown to current page
    • Default value is 1. For example, if activePage = 5, then pages to show will be 1, ..., 4, 5, 6, ..., 10, so 4 (curr - siblingCount) & 6 (curr + siblingCount) are siblings.
    • Value 0 means without siblings. In above example pages to show will be 1, ..., 5, ..., 10. For more examples see getShowingPages.test.ts
  • pagesCount - quantity of pages
  • activePage - or currentPage, means current active Page
  • onItemClick - callback, usually for getting activePage value

Check out our Storybook at https://ui.lido.fi

Keywords

FAQs

Package last updated on 22 Aug 2022

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