Socket
Socket
Sign inDemoInstall

react-pagination-lite

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-pagination-lite

A light weight react pagination component built using react hooks and styled using flex layout.It comes with minimal pagination,css configuration.


Version published
Weekly downloads
1
decreased by-92.86%
Maintainers
1
Weekly downloads
 
Created
Source

react-pagination-lite

Description

A light weight react pagination component built using react hooks and styled using flex layout.It comes with minimal pagination, css configuration.

Features

  • Customizable
  • Responsive
  • SSR support
  • Does not rely on additional css reference other than configuration

Demo

https://hdhami.github.io/react-pagination-lite.html

Installing as a package

npm install react-pagination-lite --save

Usage

import React, { useState } from 'react';
import { render } from 'react-dom';
import Pagination from 'react-pagination-lite';

const PaginationDemo = () => {
    const [activePage, setActivePage] = useState(1);

    return (
        <Pagination
            range={3}
            activePage={activePage}
            totalCount={27}
            itemsPerPage={5}
            onPaginate={pageId => {
                setActivePage(pageId);
            }}
            styles={{
                navigationBtns: {
                    activeIconColor: '#000',
                    inactiveIconColor: '#b5b5b5',
                    borderColor: '#eeeeee'
                },
                paginationCells: {
                    padding: '0 12px',
                    activeBgColor: '#92a772',
                    inactiveBgColor: '#f2f2f2',
                    textColor: '#000000'
                }
            }}
        />
    );
};

render(<PaginationDemo />, document.getElementById('root'));
AttributesTypeDefaultDescription
rangenumber3number of pagination blocks to be shown at a time
activePagenumber1active page id
totalCountnumber``total number of records to be shared across pages
itemsPerPagenumber5records to be shown on a page
onPaginatefunction``callback to be invoked on page change
stylesobject``styles for pagination cell, next, prev navigation

=======================

Contributing

=======================

Raising issues

=======================

License

Please see LICENSE for details.

Keywords

FAQs

Package last updated on 11 Feb 2020

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