Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
nextjs-pagination
Advanced tools
Nextjs-Pagination is a powerful, customizable, and easy-to-use pagination component built specifically for Next.js projects. Designed with user experience in mind, it provides flexible configuration options so you can adjust the pagination behavior and look-and-feel to suit your needs. Nextjs-Pagination is built with TypeScript, offering type safety and autocompletion support in supported editors.
Install the package using npm:
npm install nextjs-pagination
npm install nextjs-pagination
First, import the Pagination component from the nextjs-pagination
package then use it in your components:
import { Pagination } from 'nextjs-pagination';
//...
<Pagination
onPageChange={(page: number) => setCurrentPage(page)}
totalItems={100}
itemsPerPage={10}
/>
import Pagination from 'nextjs-pagination';
//...
<Pagination
onPageChange={(page) => setCurrentPage(page)}
totalItems={100}
itemsPerPage={10}
/>
This will render a pagination component for 100 items with 10 items per page.
Below are the props that you can pass to the Pagination component:
Prop | Description | Type | Default | Required |
---|---|---|---|---|
totalItems | Total number of items | number | - | Yes |
itemsPerPage | Number of items per page | number | - | Yes |
onPageChange | Callback function called when page changes | function | () => {} | Yes |
color | Button color | string | '#007bff' | No |
shape | Button shape ('circle' or 'square') | string | 'square' | No |
buttonCount | Maximum number of page buttons | number | 5 | No |
showNextPrev | Whether to show 'Next' and 'Prev' buttons | boolean | false | No |
showFirstLast | Whether to show 'First' and 'Last' buttons | boolean | false | No |
onSuccess | Callback function called when a valid page is selected | function | () => {} | No |
onError | Callback function called when an error occurs | function | () => {} | No |
@types/
nextjs-pagination.d.ts
- TypeScript declaration file for the package.dist/
index.js
- Compiled JavaScript file of the package.Pagination.js
- Compiled JavaScript file of the package.src/
index.ts
- Entry point file of the package.Pagination.tsx
- The main implementation of the pagination component..babelrc
- Babel configuration file.jest.config.js
- Jest configuration file.package.json
- Package metadata and dependency information.tsconfig.json
- TypeScript configuration file.import { Pagination } from 'nextjs-pagination';
//...
const handlePageChange = (page: number) => {
setCurrentPage(page);
};
//...
return (
<Pagination
totalItems={500}
itemsPerPage={20}
onPageChange={(page: number) => setCurrentPage(page)}
color="green"
shape="circle"
buttonCount={7}
showNextPrev={true}
showFirstLast={true}
onSuccess={(page) => console.log("Current page: ", page)}
onError={(error) => console.error(error)}
/>
);
import Pagination from 'nextjs-pagination';
//...
const handlePageChange = (page) => {
setCurrentPage(page);
};
//...
return (
<Pagination
totalItems={500}
itemsPerPage={20}
onPageChange={(page) => setCurrentPage(page)}
color="green"
shape="circle"
buttonCount={7}
showNextPrev={true}
showFirstLast={true}
onSuccess={(page) => console.log("Current page: ", page)}
onError={(error) => console.error(error)}
/>
);
We welcome contributions! Whether it's a bug report, feature request, or a code contribution, we greatly appreciate all help to improve Nextjs-Pagination. For major changes, please open an issue first to discuss what you would like to change.
Nextjs-Pagination is MIT licensed.
FAQs
A highly customizable pagination component for Next.js applications. It provides flexible configuration options for page navigation and improves user experience in large scale data environments.
The npm package nextjs-pagination receives a total of 11 weekly downloads. As such, nextjs-pagination popularity was classified as not popular.
We found that nextjs-pagination demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.