New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dtrussia/react-pager

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dtrussia/react-pager

Stateless Pager component

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
2
Weekly downloads
 
Created
Source

Stateless Pager component

NPM version Code Climate Build Status

Getting started

browserify

var Pager = require( 'react-pager' );

Global scripts

dist/pager.min.js is prebuilded for using in global <script> tag. (It's used in JSFiddle demo).

Usage

var Pager = require( 'react-pager' );

var PagerDemo = React.createClass({
    getInitialState: function () {
        return {
            total:        11,
            current:      7,
            visiblePages: 3
        };
    },
    
    handlePageChanged: function ( newPage ) {
        this.setState({ current : newPage });
    },
    
    render: function() {
        return (<Pager total={this.state.total}
                       current={this.state.current}
                       
                       {/* Optional */}
                       titles={{
                           first:   'First',
                           prev:    '\u00AB',
                           prevSet: '...',
                           nextSet: '...',
                           next:    '\u00BB',
                           last:    'Last'
                       }}
                       
                       visiblePages={this.state.visiblePages}
                       onPageChanged={this.handlePageChanged}/>);
    }
});

React.render(<PagerDemo />, document.body);

How it looks like*

First | Prev | ... | 6 | 7 | 8 | 9 | ... | Next | Last

* Bootstrap 3.0 is required by default, but you can replace it with your own css.

Demo

gulp demo -p 8003 

or

./node_modules/.bin/gulp demo -p 8003

JSFiddle

Tests

npm test

Changelog

v1.1.1

  • Updated to React 0.13.
  • Updated local demo.

v1.1.0

  • Added titles property. See demo.
  • Improved building script.

v1.0.6

  • Fixed <li class="undefined" .. in "more" and "less" buttons.
  • Added a few unit-tests.

Keywords

FAQs

Package last updated on 17 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc