0.1.4 • Published 2 years ago

best-react-pagination v0.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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

NameTypeDescription
paginationStartNumberRequired. The number of start pages on your logic (0 or 1).
currentIndexNumberRequired. The current index from hook useState of pages displayed.
totalPagesNumberRequired. The range of pages displayed.
setIndexReact.SetStateAction<number>Required. The dispatch from hook useState
isDefaultStylesBooleanDefault true
wrapperClassStringCss class
itemListClassStringCss class
itemClassStringCss class
selectedItemClassStringCss class
disableItemClassStringCss class
classNameStringField for styled-component

Remark

For rewrite default styles - use !important in your css

0.1.0

2 years ago

0.0.1

2 years ago

0.1.2

2 years ago

0.0.3

2 years ago

0.1.1

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.0.1-alpha.1

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago