best-react-pagination
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

best-react-pagination

NPM

Simple and stylized react component to render a pagination.

Installation

npm install best-react-pagination --save
import Pagination from "best-react-pagination";

const YourComponent: FC = () => {
  const [index, setIndex] = useState(0);

  return (
    // Your code
    <Pagination
      paginationStart={0}
      currentIndex={index}
      setIndex={setIndex}
      totalPages={10}
    />
  );
};

Example https://codesandbox.io/s/lingering-breeze-gh2dk

Props

Name Type Description
paginationStart Number Required. The number of start pages on your logic (0 or 1).
currentIndex Number Required. The current index from hook useState of pages displayed.
totalPages Number Required. The range of pages displayed.
setIndex React.SetStateAction<number> Required. The dispatch from hook useState
isDefaultStyles Boolean Default true
wrapperClass String Css class
itemListClass String Css class
itemClass String Css class
selectedItemClass String Css class
disableItemClass String Css class
className String Field for styled-component

Remark

For rewrite default styles - use !important in your css

Readme

Keywords

none

Package Sidebar

Install

npm i best-react-pagination

Weekly Downloads

0

Version

0.1.4

License

ISC

Unpacked Size

15.8 kB

Total Files

5

Last publish

Collaborators

  • 97dmitry