2.0.1 • Published 3 years ago

paginoid v2.0.1

Weekly downloads
-
License
CC0-1.0
Repository
github
Last release
3 years ago

Paginoid

npm version npm.io Package Quality

npm.io

A ReactJS dumb component to render a pagination.

  • a small function
  • implemented in typescript
  • no dependencies

Installation

    #npm
    $ npm install paginoid
    
    #yarn
    $ yarn add paginoid

Usage

import React from 'react';
import Paginoid from 'paginoid';

export const App = (): JSX.Element => {
  const [currentPage, setCurrentPage] = useState(1);
  const handleChange = (page: number) => setCurrentPage(page);

  return (
    <div className='app'>
      <Paginiod
        currentPage={currentPage}
        total={150}
        perPage={3}
        handleChange={handleChange}

        prevButtonTitle={<span>{'<'}</span>}
        nextButtonTitle={<span>{'>'}</span>}

        containerClassName={'pagination'}
        arrowsClassName={'pagination_arrows'}
        itemsClassName={'pagination_item'}
        activeItemClassName={'pagination_item__active'}
        disabledArrowClassName={'pagination_arrows__disable'}
      />
    </div>
  );
};

Params

  • currentPage: number (required);
  • total: number (required) - total items;
  • perPage: number (required) - items per page;
  • handleChange: (currentPage: number) => void (required);
  • prevButtonTitle?: ReactNode;
  • nextButtonTitle?: ReactNode;
  • containerClassName?: string;
  • arrowsClassName?: string;
  • itemsClassName?: string;
  • activeItemClassName?: string;
  • disabledArrowClassName?: string;

Watch Demo

2.0.1

3 years ago

2.0.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.10

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago