1.0.2 • Published 8 months ago
reactpagetastic v1.0.2
ReactPageTastic
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
Prop | Type | Description |
---|---|---|
onPageChange | Function | Function to call when page is changed |
totalCount | Number | Total number of items |
siblingCount | Number | Number of siblings to show (optional, default is 1) |
currentPage | Number | Current page |
pageSize | Number | Number of items per page |
classNamePrefix | String | To override all pagination styling (optional, default is empty string) |
leftArrow | JSX.Element | To override left arrow (optional) |
rightArrow | JSX.Element | To 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