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.
chakra-paginator
Advanced tools
npm i chakra-paginator
yarn add chakra-paginator
import { ButtonProps } from "@chakra-ui/react";
import {
Paginator,
Previous,
Page,
Next,
PageGroup,
generatePages,
} from "chakra-paginator";
const Component = () => {
// Calculated or obtained from Backend
const pagesQuantity = 6;
// styles
const normalStyles: ButtonProps = {
color: "green.300",
bg: "red.300",
};
const activeStyles: ButtonProps = {
color: "red.300",
bg: "green.300",
};
// handlers
const handlePageChange = (page: number) => {
// Request new data using the page number
};
return (
<Paginator
isDisabled={isPaginatorDisabled}
onPageChange={handlePageChange}
pagesQuantity={pagesQuantity}
>
<Previous>
Previous
{/* i.e. an icon from `react-icons` */}
</Previous>
<PageGroup>
{generatePages(pagesQuantity)?.map((page: number) => (
<Page
key={`paginator_page_${page}`}
activeStyles={activeStyles}
normalStyles={normalStyles}
page={page}
/>
))}
</PageGroup>
<Next>
Next
{/* i.e. an icon from `react-icons` */}
</Next>
</Paginator>
);
};
Prop | Description | Type | Default | Required |
---|---|---|---|---|
pagesQuantity | The total number of pages, calculated based on Backend data | number | 0 | yes |
isDisabled | Disables all of the pagination components. You can always disable each individual component via the isDisabled prop, as the components render HTML buttons | boolean | false | no |
onPageChange | On change handler which returns the last selected page | (currentPage: number) => void | - | yes |
Prop | Description | Type | Default | Required |
---|---|---|---|---|
key | This is not strictly related to the library but never forget to pass it down to the component | string | - | yes |
activeStyles | The styles of the active page button | ButtonProps | - | no |
normalStyles | The styles of the inactive page buttons | ButtonProps | - | no |
page | Number used internally which is returned on the onPageChange handler when selecting the page For now use the generatePages helper with which you shouldn't have any problems. This may change in the future | number | - | yes |
FAQs
## Deprecation notice: this package has been moved to [@ajna/pagination](https://www.npmjs.com/package/@ajna/pagination)
The npm package chakra-paginator receives a total of 494 weekly downloads. As such, chakra-paginator popularity was classified as not popular.
We found that chakra-paginator 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.