1.0.1 • Published 8 months ago
react-tailwind-pagination v1.0.1
React Tailwind Pagination
A customizable pagination component for React, styled with Tailwind CSS.
Installation
Install via npm:
npm install react-tailwind-pagination
Usage
1. Import the Pagination Component
import Pagination from 'react-tailwind-pagination';
2. Use the Pagination Component
import React, { useState } from 'react';
import Pagination from 'react-tailwind-pagination';
const MyComponent = () => {
const [currentPage, setCurrentPage] = useState(1);
const handlePageChange = (pageNumber: number) => {
setCurrentPage(pageNumber);
};
return (
<Pagination
currentPage={currentPage}
totalPages={10}
onPageChange={handlePageChange}
pageRange={3}
siblingRange={1}
/>
);
};
export default MyComponent;
Props
currentPage
(number
): The current page (required).totalPages
(number
): Total number of pages (required).onPageChange
(function
): Callback function for page change (required).pageRange
(number
): Number of pages to display before/after the current page (default:3
).siblingRange
(number
): Number of pages to display around the current page (default:1
).
License
ISC License.
### Key Changes:
- Removed detailed customization options and advanced examples.
- Focused on core usage and minimal configuration.
- Simplified props section and example.
This version provides only the essentials for installing and using the package, ensuring a straightforward implementation.