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

react-responsive-pagination

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-responsive-pagination

React component for responsive pagination

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Responsive Pagination

npm version minzipped size GitHub license Test Release semantic-release

A responsive React pagination component which intelligently renders to the available width

react-responsive-pagination example

⚡️ LIVE DEMO - try it out for yourself! 🚀

🥾 Works out of the box with Bootstrap 4.x

Using Bootstrap? See the Bootstrap 4 Getting Started Guide

🎨 Supports custom styling

Custom styles? No problem - see the Custom Styles Guide

⏳ Quick Start

npm install react-responsive-pagination
// ... make sure appropriate css is in the project (see guides above)
import React, { useState } from 'react';
import Pagination from 'react-responsive-pagination';

function MyApp() {
  const [currentPage, setCurrentPage] = useState(4);

  const totalPages = 17;

  return (
    <Pagination
      current={currentPage}
      total={totalPages}
      onPageChange={setCurrentPage}
    />
  );
}

✔︎ Requirements / Compatibility

  • React 16.8 (the one with hooks)
  • Modern browsers only - not suitable for IE 11

🔧 Props

Prop nameTypeDescription
currentnumberThe current active page. Indexed from 1
totalnumberThe total number of pages
onPageChange(newPage: number) => voidA callback handler which is called when the user clicks a new page, note that the active page will not change unless the current prop is updated to reflect the new page (as in the example above). The newPage value is indexed from 1
maxWidth (optional)number(optional) The maximum width (in pixels) of the pagination component. Specify a value if you want to override the automatic sizing. Note this width may be exceeded in the case where it's not possible to output a small enough component

ℹ About Auto Sizing

More info in the FAQ

Keywords

FAQs

Package last updated on 04 Oct 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