bsr-paginator
v2.0.23
Published
React component paginator
Downloads
75
Maintainers
Readme
bsr-paginator
React component paginator
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