Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
react-ultimate-pagination
Advanced tools
React.js pagination component based on ultimate-pagination. It's implemented as a hight-order component that allows easy integration of react-ultimate-pagination with different CSS frameworks or approaches.
To use react-ultimate-pagination in your project, you can write your theme or use one of already existing.
Here is a list of themed versions of react-ultimate-pagination component. To use them you don't need explicitly install this module to your project; it will be installed automatically as a dependency of themed component.
You need to install this module only if you want to write your project or CSS framework specific theme.
You can install this module via npm:
npm install react-ultimate-pagination --save
This module provides createUltimatePagination(options)
method that is a React.js high-order component. It means that you need to call this component with specific options
to create a React.js component.
The options
object contains following properties:
React.DOM.div
)The itemTypeToComponent
object should contains React.js component for each item type:
PAGE
- a link to a pageELLIPSIS
- an item that represents groups of pages that currently are not visible in paginator (can be used to navigate to the page in the group that is the nearest to the current page)FIRST_PAGE_LINK
- a link to the first pagePREVIOUS_PAGE_LINK
- a link to the previous pageNEXT_PAGE_LINK
- a link to the next pageLAST_PAGE_LINK
- a link to the last pageEach of this component receives as a props
following data:
PAGE
it also can be used as a label in UI)currentPage
if the same as value
of an item (can be used to highlight a current page or disable first, previous, next or last page links when user is already on first/last page)Here is an example of basic usage:
var React = require('react');
var ReactUltimatePagination = require('react-ultimate-pagination');
function Page(props) {
return <button style={props.isActive ? {fontWeight: 'bold'} : null} onClick={props.onClick}>{props.value}</button>
}
function Ellipsis(props) {
return <button onClick={props.onClick}>...</button>
}
function FirstPageLink(props) {
return <button onClick={props.onClick}>First</button>
}
function PreviousPageLink(props) {
return <button onClick={props.onClick}>Previous</button>
}
function NextPageLink(props) {
return <button onClick={props.onClick}>Next</button>
}
function LastPageLink(props) {
return <button onClick={props.onClick}>Last</button>
}
function Wrapper(props) {
return <div className="pagination">{props.children}</div>
}
var itemTypeToComponent = {
'PAGE': Page,
'ELLIPSIS': Ellipsis,
'FIRST_PAGE_LINK': FirstPageLink,
'PREVIOUS_PAGE_LINK': PreviousPageLink,
'NEXT_PAGE_LINK': NextPageLink,
'LAST_PAGE_LINK': LastPageLink
};
var UltimatePagination = ReactUltimatePagination.createUltimatePagination({
itemTypeToComponent: itemTypeToComponent,
WrapperComponent: Wrapper
});
Created UltimatePagination
component has the following interface:
FAQs
React.js pagination component based on ultimate-pagination
The npm package react-ultimate-pagination receives a total of 23,975 weekly downloads. As such, react-ultimate-pagination popularity was classified as popular.
We found that react-ultimate-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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.