Socket
Socket
Sign inDemoInstall

rc-pagination

Package Overview
Dependencies
0
Maintainers
2
Versions
201
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rc-pagination

pagination ui component for react


Version published
Weekly downloads
1.3M
decreased by-2%
Maintainers
2
Install size
26.5 kB
Created
Weekly downloads
 

Package description

What is rc-pagination?

The rc-pagination package is a React component for creating paginated interfaces, allowing users to navigate through pages of items. It provides a range of customization options to tailor the pagination behavior and appearance to the needs of different applications.

What are rc-pagination's main functionalities?

Basic Pagination

This code sample demonstrates how to render a basic pagination component with a total of 50 items.

import Pagination from 'rc-pagination';
import React from 'react';
import ReactDOM from 'react-dom';

ReactDOM.render(
  <Pagination total={50} />, 
  document.getElementById('container')
);

Custom Page Size

This code sample shows how to set a custom page size and enable a size changer dropdown for the user to select how many items to display per page.

import Pagination from 'rc-pagination';
import React from 'react';
import ReactDOM from 'react-dom';

ReactDOM.render(
  <Pagination total={500} defaultPageSize={20} showSizeChanger />, 
  document.getElementById('container')
);

Controlled Component

This code sample illustrates how to create a controlled pagination component where the current page state is managed by the parent component.

import Pagination from 'rc-pagination';
import React, { useState } from 'react';
import ReactDOM from 'react-dom';

const App = () => {
  const [current, setCurrent] = useState(1);
  const onChange = page => {
    setCurrent(page);
  };

  return (
    <Pagination current={current} onChange={onChange} total={100} />
  );
};

ReactDOM.render(<App />, document.getElementById('container'));

Jump to Page

This code sample demonstrates how to enable the 'quick jumper' feature, allowing users to jump to a specific page directly.

import Pagination from 'rc-pagination';
import React from 'react';
import ReactDOM from 'react-dom';

ReactDOM.render(
  <Pagination total={100} showQuickJumper />, 
  document.getElementById('container')
);

Other packages similar to rc-pagination

Readme

Source

rc-pagination


React Pagination Component

NPM version build status Test coverage gemnasium deps node version npm download Sauce Test Status

Sauce Test Status

Development

npm install
npm start

Example

http://localhost:3000/examples/

online example: http://react-component.github.io/pagination/examples/

Feature

  • support ie8,ie8+,chrome,firefox,safari

Keyboard

install

rc-pagination

Usage

var Pagination = require('rc-pagination');
var React = require('react');
React.render(<Pagination />, container);

API

props

Pagination

ParameterDescriptionTypeDefault
currentcurrnt pageNumber1
totalitems total countNumber0
pageSizeitems per pageNumber10
onChangepage change callbackFunctionnoop
showSizeChangershow pageSize changerBoolfalse
showQuickJumpshow quick goto jumperBoolfalse
classNamewhen set "mini", show mini versionStringrc-pagination
simplewhen set, show simple pagerObjectnull

Test Case

http://localhost:3000/tests/runner.html?coverage

Coverage

http://localhost:3000/node_modules/rc-server/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:3000/tests/runner.html?coverage

License

rc-pagination is released under the MIT license.

Keywords

FAQs

Last updated on 15 Jul 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc