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

react-js-paginator

v0.2.1

Published

Simple react JS Paginator component, fully customizable with events callbacks to handle page changes

Downloads

348

Readme

npm npm npm

React-js-paginator

Simple react JS paginator

Description

Simple React JS Pagination component. Can be easily customized with CSS objects

How it looks

alt text

How to thank me? Just click on ⭐️ button :)

Installation

Install it from npm and include it in your React build process (using Webpack, Browserify, etc).

npm i react-js-paginator

Usage

It is really easy to use, just:

Import Paginator in your react component.

import Paginator from 'react-js-paginator';

And then specify the page size, total elements and a callback function.

For example:

<Paginator
  pageSize={10}
  totalElements={64}
  onPageChangeCallback={(e) => {this.pageChange(e)}}
/>

Once the page has changed, will trigger the callback function and send back the current page.

Styles can be customized using pageBoxStyle and activePageBoxStyle props like:

pageBoxStyle={{
	border: 0, 
	color: 'black', 
	padding: 3, 
	fontSize: 16
}}
activePageBoxStyle={{
	fontWeight: 'bolder', 
	color: 'green', 
	backgroundColor: '#d7f7dc'
}}

Giving you as result:

alt text

Props

| Name | Type | Mandatory | Description
| ------------- |:-------------:| -----:|:-----| | pageSize | int | Y |How many elements will compose a page | | totalElements | int | Y | Total elements you have in store | | onPageChangeCallback | function | Y| function to be triggered when a page change happens | | pageBoxStyle | object | N| style object for each pagination box | | activePageBoxStyle | object | N| style object the active page | | maxPagesToDisplay | int | N| how many pages will be displayed at the same time in the paginator (default 6)| |firstArrowAlwaysVisible|present|N|showAlways the first page arrow| |lastArrowAlwaysVisible|present|N|showAlways the first page arrow| |firstArrowSymbol|string|N|customize first page symbol (default <<)| |lastArrowSymbol|string|N|customize last page symbol (default >>)|

What's new

0.2.0

  • Package size optimized

0.2.0

  • Dependencies updated
  • Overall package size optimized

0.1.10

  • Dependencies updated

0.1.9

  • Proptypes added

0.1.8

  • Background updated to be transparent

0.1.7

  • CSS updated to be isolated under paginator class

0.1.5

  • Typecheck added, minor tweaking and styling changes

0.1.3

  • Bug fixing: last page was not always being showed.

0.1.1

  • Fixed issue where maxPagesToDisplay was showing one more page than the prop number

0.1.0

  • New default style (less ugly)
  • Style customization properties enhanced

0.0.8

  • Added props to force first and last arrows
  • Added props to customize first and last symbols

0.0.6

  • Added functionality to hide arrows if first page or last page is visible

License

Licensed under the MIT License © jciccio