Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
react-responsive-pagination
Advanced tools
A responsive React pagination component which intelligently renders to the available width
🌟 Just updated for React 18 🌟
Using Bootstrap? See the Bootstrap 4 Getting Started Guide
Custom styles? No problem - see the Custom Styles Guide
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}
/>
);
}
Prop name | Type | Description |
---|---|---|
current | number | The current active page. Indexed from 1 |
total | number | The total number of pages |
onPageChange | (newPage: number) => void | A 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 |
previousLabel (optional) | string | (optional) The label for the previous button, default value is « |
nextLabel (optional) | string | (optional) The label for the next button, default value is » |
More info in the FAQ
FAQs
React component for responsive pagination
The npm package react-responsive-pagination receives a total of 3,188 weekly downloads. As such, react-responsive-pagination popularity was classified as popular.
We found that react-responsive-pagination demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.