Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ebazhanov/pagination-react
Pagination simple example
https://github.com/ebazhanov/pagination-react
demo pagination reactjs
Last synced: about 1 month ago
JSON representation
Pagination simple example
- Host: GitHub
- URL: https://github.com/ebazhanov/pagination-react
- Owner: Ebazhanov
- Created: 2020-03-12T11:22:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-05T22:10:47.000Z (about 4 years ago)
- Last Synced: 2024-10-14T22:43:49.538Z (3 months ago)
- Topics: demo, pagination, reactjs
- Language: JavaScript
- Homepage:
- Size: 2.22 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Pagination with [tutorial](https://www.youtube.com/watch?v=IYCa1F-OWmk)
This repo about simple example of pagination
```javascript
const Pagination = ({postsPerPage, totalPosts, paginate}) => {
const pageNumbers = [];for (let i = 1; i <= Math.ceil(totalPosts / postsPerPage); i++) {
pageNumbers.push(i);
}return (
-
paginate(number)} href='!#' className='page-link'>
{number}
{pageNumbers.map(number => (
))}
);
};
export default Pagination;
```
Demo
----
```console
$ yarn start
```
Open your browser and go to [http://localhost:3000/](http://localhost:3000/)
or here [https://pagination-basic.netlify.com/](https://pagination-basic.netlify.com/)
![Pagination Demo](Pagination.gif)