bsr-paginator
TypeScript icon, indicating that this package has built-in type declarations

2.0.23 • Public • Published

bsr-paginator

React component paginator

NPM JavaScript Style Guide

Install

npm install --save bsr-paginator

Usage

import {useEffect, useRef, useState} from "react";
import {Paginator} from 'bsr-paginator'
import 'bsr-paginator/dist/index.css'

export function App() {
    const [myState, setMyState] = useState('');
    const refPaginator = useRef<Paginator>(null)
    useEffect(() => {
        /*fetching SetState(totalRows, pageSize,currentPage)*/
        refPaginator.current!.SetState(500, 10, 1)
    }, [])

    return (
        <div>
            <div>{myState}</div>
            <Paginator
                range={10}
                ref={refPaginator}
                previous={'<'}
                next={'>'}
                first={'<<'}
                last={'>>'}
                onChange={(page) => {
                    setMyState(page + " page of " + refPaginator.current!.State.PagesCount)
                }}
            />
        </div>
    )
}

License

MIT © ionson100

Examples, Help pages.

Package Sidebar

Install

npm i bsr-paginator

Weekly Downloads

0

Version

2.0.23

License

MIT

Unpacked Size

52.9 kB

Total Files

12

Last publish

Collaborators

  • ionson100