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 🙏

© 2024 – Pkg Stats / Ryan Hefner

chakra-pagination

v1.0.3

Published

This is a pagination UI component designed for the popular [Chakra UI](https://github.com/chakra-ui/chakra-ui) component library. The library provides an easy-to-use and customizable pagination component that can be integrated seamlessly into your React a

Downloads

18

Readme

Chakra UI Pagination Component

This is a pagination UI component designed for the popular Chakra UI component library. The library provides an easy-to-use and customizable pagination component that can be integrated seamlessly into your React applications.

Features

  • Simple and intuitive pagination UI.
  • Adaptable design and appearance to match ChakraProvider theme.
  • Flexible configuration options.
  • Lightweight and optimized for performance.
  • Accessibility-friendly design.

Installation

To install the React Pagination UI Component Library, you can use npm or yarn:

npm install chakra-pagination

or

yarn add chakra-pagination

Usage

  1. Import the Pagination component from the library:
import { Pagination } from 'chakra-pagination';
  1. Render the Pagination component in your React component, passing the required props:
<Pagination
  currentPage={currentPage}
  onPageChange={handlePageChange}
  total={total}
  colorScheme={'cyan'}
  perPage={10}
/>

Props

The Pagination component accepts the following props:

  1. currentPage (number, required): The current active page number.
  2. onPageChange (function, required): A callback function triggered when the page changes. It receives the new page number as an argument.
  3. total (number, optional): Total number of items.
  4. perPage (number, optional): Specifies how many items are shown in each page to determine page numbers. Default: 10.
  5. colorScheme (string, optional): Set the theme color of the buttons and text of pagination component. Default: blackAlpha.

Examples

Here are a few examples demonstrating how to use the Pagination component:

Basic usage:

... 
const [currentPage, setCurrentPage] = useState<number>(1);

<Pagination
  currentPage={currentPage}
  totalPages={10}
  onPageChange={setCurrentPage}
/>
...

Screenshots

alt Pagination

Contributing

Contributions are welcome! If you'd like to contribute to the Chakra Pagination Component, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make the necessary changes and commit them.
  4. Push the changes to your forked repository.
  5. Submit a pull request with a detailed description of your changes.

License

This project is licensed under the MIT License.

Acknowledgments

If you have any questions, feature requests, or issues, please don't hesitate to open an issue on the project repository.