2.1.4 • Published 3 years ago

dsimms-react-pagination v2.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

React Pagination

Paginates an array of data then passes it, through props, to a component which you will kindly provide via render prop.

This package is my first ever package! ✨ ✨ ✨ ✨ It is also in very early stages of development, so if you have any feedback, please don't hesitate to contact me

Installation

npm

npm i dsimms-react-pagination

index.js

Wrap your <App /> with <PaginationProvider> as React.Context is used under the hood.

import { PaginationProvider } from "dsimms-react-pagination";
<PaginationProvider>
  <App />
</PaginationProvider>

YourComponent.js

You need to provide a component as a render prop so the pagination can work it's magic, making sure to pass in data={data}.

import Pagination from "dsimms-react-pagination";
export YourComponent = () => {
    return (
        <Pagination
          data={dataToBePaginated}
          itemsPerPage={12}
          pageLinksAmount={5}
          currentPage={1}
          render={(data) => <YourOtherComponent data={data} />}
        />
    )
}

Props

PropType (Required)
dataArray
itemsPerPageInt
pageLinksAmountInt
currentPageInt
renderFunction: Component
2.1.2

3 years ago

2.1.1

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

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.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago