
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
@etchteam/next-pagination
Advanced tools
The best damn pagination component. For Next.js
TL;DR Just show me the DEMO
npm install --save @etchteam/next-pagination
This component is fairly self contained. You will need to pass the total number of potential results in order to calculate the number of pages to show.
import React, { Component } from 'react'
import Pagination from '@etchteam/next-pagination'
class Example extends Component {
render() {
return <Pagination total={1000} />
}
}
You will need to import the CSS, either in your _app.js
, or in your Sass build.
import '@etchteam/next-pagination/dist/index.css'
When used, the pagination component will reload the same route with added pagination query params.
page
for the page number the user is on.size
for the number of results per page.e.g. ?page=4&size=20
The default page is 1. The default size is 20.
You'll need to load the actual data from your API yourself. We're only here for the front-end!
Name | Type | Description |
---|---|---|
total | Number | Required. The total number of pages. |
theme | Object | A CSS modules style object. |
sizes | Array | An array of page size numbers |
perPageText | String | Label for the page size dropdown |
setPageSizeText | String | Label for the invisible page size button |
linkProps | Object | Extra props to pass to the next.js links |
Next.js natively supports CSS modules, so this component supports injecting CSS module styles.
Import the styles as you would for a normal component, but pass them as props.
[...]
import styles from '/my/path/to/styles.module.css'
class Example extends Component {
render() {
return <Pagination total={1000} theme={styles} />
}
}
The theme uses BEM class naming with the base class next-pagination
. The file /src/index.module.scss
should give you a solid idea of what's needed.
This package was created with create-react-library.
To get set up you'll need to run npm install && cd example && npm install
In the root folder, run npm run start
At the same time, in the example folder, run npm run dev
Then head over to localhost:3000
to see the example running.
In the root folder run npm run deploy
to deploy the example to github pages on the gh-pages
branch of your repo.
Feeling confident? Run npm publish
to send the latest version to npm.
MIT © etchteam
FAQs
Pagination component for Next.js apps
The npm package @etchteam/next-pagination receives a total of 369 weekly downloads. As such, @etchteam/next-pagination popularity was classified as not popular.
We found that @etchteam/next-pagination demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.