0.1.8 • Published 6 months ago

react-pagination-ts v0.1.8

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

React Pagination TS

Installation

Install react-pagination-ts with npm:

npm install react-pagination-ts --save

Usage

import { useEffect, useState } from "react";
import { Pagination } from "react-pagination-ts";

function App() {
  const [page, setPage] = useState(1);
  const handlePageClick = (_, newPage: number) => {
    setPage(newPage);
  };

  return (
    <>
      <Pagination
        currentPage={page}
        defaultPage={1}
        onPageChange={handlePageClick}
        pageCount={30}
      />
    </>
  );
}

export default App;

Props

NameTypedefaultDescription
totalPageNumber1Required. The total number of pages.
defaultPageNumber1The page selected by default when the component is uncontrolled.
currentPageNumber1The current page.
siblingCountNumber1Number of always visible pages before and after the current page.
boundaryCountNumber1Number of always visible pages at the beginning and end.
disabledBooleanfalseIf true, the component is disabled.
hideNextButtonBooleanfalseIf true, hide the next-page button.
hidePrevButtonBooleanfalseIf true, previous-page button.
0.1.8

6 months ago

0.1.7

6 months ago

0.1.6

6 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago