Releases: shakibdshy/react-pagination-pro
Releases · shakibdshy/react-pagination-pro
v1.1.0
- Reduced the bundle size by removing the Button Component dependency and use
ul
,li
tag instead. - Added new props to the API Reference table:
isDisabled
- To disable all pagination actionsisDisabledPrevious
- To disable only the previous page buttonisDisabledNext
- To disable only the next page button
- Added a new "Accessibility" section highlighting the accessibility features you've implemented:
- Full keyboard navigation support
- ARIA labels and roles
- Proper tab indexing
- Disabled states communication
- Semantic HTML structure
v1.0.0
Features
- 🚀 Modern React Hooks API
- 🎨 Highly customizable UI
- 🔄 Client & Server-side pagination
- 📱 Fully responsive
- 🎯 TypeScript support
- 🎨 Built with Tailwind CSS
- 🔌 Powered by @shakibdshy/react-button-pro
- 🎭 Flexible styling with class-variance-authority
- 🔧 Controlled & Uncontrolled components
Installation
npm install react-pagination-pro
# or
yarn add react-pagination-pro
# or
pnpm add react-pagination-pro
Quick Start
Basic Usage
import { Pagination } from 'react-pagination-pro';
function MyComponent() {
return (
<Pagination
totalItems={100}
defaultPageSize={10}
onChange={({ currentPage, pageSize }) => {
// Handle page change
}}
/>
);
}
Using the Hook (Custom UI)
import { usePagination } from 'react-pagination-pro';
function CustomPagination() {
const [
{ currentPage, totalPages, pageSize, startIndex, endIndex },
actions
] = usePagination({
totalItems: 100,
defaultPageSize: 10
});
return (
<div>
<div>
Showing {startIndex + 1} to {endIndex} of {totalItems} items
</div>
<div>
<button onClick={actions.previousPage}>Previous</button>
<span>Page {currentPage} of {totalPages}</span>
<button onClick={actions.nextPage}>Next</button>
</div>
</div>
);
}
Full Changelog: https://github.com/shakibdshy/react-pagination-pro/commits/v1.0.0