1.3.1 • Published 4 years ago

react-pagination-lite v1.3.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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.

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago