2.0.1 • Published 7 months ago

@alwaan/react-pagination v2.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago
# @alwaan/react-pagination

A flexible and customizable pagination component for React applications.

## Installation

You can install this package via npm:

```bash
npm install @alwaan/react-pagination

Usage

To use the Pagination component in your React application, follow these steps:

  1. Import the component into your application:

    import React from 'react';
    import Pagination from '@alwaan/react-pagination';
  2. Include the Pagination component in your component's JSX code. You can customize the component by passing the necessary props.

    const App = () => {
      // Your component logic here
    
      return (
        <div>
          {/* Your content goes here */}
          <Pagination
            page={currentPage} // The current page number
            limit={itemsPerPage} // Items per page
            total={totalItems} // Total number of items
            displayPageRange={pagesToDisplayEachSide} // Page numbers displayed on each side (Default 2)
            onPageChange={handlePageChange} // Function to handle page changes
          />
        </div>
      );
    };
    
    export default App;
  3. Customize the Pagination component by passing the required props:

    • page: The current page number.
    • limit: The number of items to display per page.
    • total: The total number of items.
    • displayPageRange: Number of page numbers to display on each side of the current page. (Default 2)
    • onPageChange: A callback function to handle page changes.

Props

page (Number)

The current page number.

limit (Number)

The number of items to display per page.

total (Number)

The total number of items.

displayPageRange (Number)

Number of page numbers to display on each side of the current page. (Default 2).

onPageChange (Function)

A callback function to handle page changes. It receives the new page number as an argument.

Issues

If you encounter any issues or have suggestions for improvements, please email us at support@alwaantechnology.com.

2.0.1

7 months ago

2.0.0

8 months ago

1.1.0

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago