npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-awesome-paginate

v1.1.0

Published

React awesome paginate is a modern, typescript based pagination component. You can use it in your project.

Readme

react-awesome-paginate

React awesome paginate is a modern, lightweight, typescript based pagination component. You can use it in your project very easily. There are some predefined theme you can use it, in your component.

NPM

Installation

Install react-awesome-paginate with npm:

npm i react-awesome-paginate --save

Props & Theme demo: Codesandbox

API demo: Codesandbox

Preview

Default theme

Default Pagination preview

Circular theme

Circular Pagination preview

Classic theme

Classic Pagination preview

Compact theme

Compact Pagination preview

Import and Usage rule in your component

import Pagination from 'react-awesome-paginate'; // Import npm module
import 'react-awesome-paginate/dist/index.css'; // Import CSS (You can override css styling easily.)


// In your page
<Pagination
    currentPage=1
    totalPages=20
    onPageChange={(pageNo: number) => console.log(pageNo)}
/>

Detail Usage

import React, { useState } from "React";
import Pagination from 'react-awesome-paginate';

// For CSS Styling, you have to import this below file (You can override, if you want.)

import 'react-awesome-paginate/dist/index.css';

const ExampleComponent = () => {
    const [currentPage, setCurrentPage] = useState(1);
    const [totalPages, setTotalPages] = useState(1);


    const handlePageChange = (pageNo) => {
        if(pageNo === currentPage)
            return;

        // API Call && Set current page 
    }

    return (
        <Pagination
            currentPage={currentPage}
            totalPages={totalPages}
            onPageChange={(pageNo: number) => handlePageChange(pageNo)}
        />
    )
}

export default ExampleComponent;

Events

| Name | Type | Status | Description | |----------|----------|----------|----------| | onPageChange| Function | Required | onPageChange is a Function. When event is triggerd, it gives triggered page no. as an argument. |

Props

| Name | Type | Status | Description | |----------|----------|----------|----------| | currentPage| Number | Required | currentPage number. Default value 1 | | totalPages| Number | Required | totalPages number. Default value 1 | | previousLabel| String | Optional | previousLabel for previous button. Default value Previous | | nextLabel| String | Optional | nextLabel for next button. Default value Next | | morePagesLabel| String | Optional | morePagesLabel for break level. Default value ... | | paginationTheme| String | Optional | paginationTheme for next button. Default value default. There are four types of theme, you can use, these are default, circular, classic, compact | | activeClassName| String | Optional | activeClassName for active button. Default value active. You can add your own custom class & give custom style in your component | | containerClassName| String | Optional | containerClassName for active button. Default value None. You can add your own custom container class & give custom style in your component | | prevClassName| String | Optional | prevClassName for active button. Default value None. You can add your own custom class & give custom style to previous button in your component | | nextClassName| String | Optional | nextClassName for active button. Default value None. You can add your own custom class & give custom style to next button in your component |

If you like this package please give me a star(*) in my Github Repo

If you find any issue please please report here Github Issues

Awesome React Pagination npm | Easy installation | You can do everything custom