1.0.2 • Published 8 months ago

reactpagetastic v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

ReactPageTastic

NPM

A simple pagination component for React.

Installation

npm i reactpagetastic

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import ReactPageTastic from 'reactpagetastic';
import "reactpagetastic/dist/pagetastic.css"; // Import the CSS

const [currentPage, setCurrentPage] = React.useState(1);

const App = () => {
  return (
    <div>
      <ReactPageTastic
        totalCount={100}
        pageSize={10}
        currentPage={currentPage}
        onPageChange={(page) => setCurrentPage(page)}
      />
    </div>
  );
};

ReactDOM.render(<App />, document.querySelector('#root'));

Props

PropTypeDescription
onPageChangeFunctionFunction to call when page is changed
totalCountNumberTotal number of items
siblingCountNumberNumber of siblings to show (optional, default is 1)
currentPageNumberCurrent page
pageSizeNumberNumber of items per page
classNamePrefixStringTo override all pagination styling (optional, default is empty string)
leftArrowJSX.ElementTo override left arrow (optional)
rightArrowJSX.ElementTo override right arrow (optional)
1.0.2

8 months ago

1.0.1

8 months ago

0.1.13

8 months ago

0.1.14

8 months ago

0.1.15

8 months ago

0.1.12

8 months ago

0.1.11

8 months ago

0.1.10

8 months ago

0.1.9

8 months ago

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago

1.0.0

8 months ago