Pagination
Installation
- yarn
- pnpm
- npm
yarn add @mercell/pagination-react
pnpm add @mercell/pagination-react
npm install --save @mercell/pagination-react
The Pagination has necessary peerDependencies, please make sure that you have them in your project
"@carbon/icons-react": "^10.49.0",
"@mercell/button-react": "^5.0.0",
"@mercell/icon-button-react": "^undefined",
"@mercell/tailwind": "^6.0.1",
"@mercell/use-media-query-react-hook": "^3.0.5",
"classnames": "^2.3.1",
"react": "^17.0.2"
Usage
Using the Pagination component is as simple as importing it like this.
import { Pagination } from '@mercell/pagination-react';
Types, definitions, etc.
- Types
- Changelog
- Figma
PaginationProps
interface PaginationProps {
totalCount: number;
currentPage: number;
pageSize: number;
onPageChange: (currentPage: number) => void;
siblingCount?: number;
ariaLabels?: {
prevPageButton?: string;
nextPageButton?: string;
pageButton?: string;
};
} & JSX.IntrinsicElements['nav']
Name | Type | Default | Required | Description |
---|---|---|---|---|
totalCount | number | - | yes | Array length of data |
currentPage | number | - | yes | Current page |
pageSize | number | - | yes | Item per page |
onPageChange | function | - | yes | Action on page change |
siblingCount | number | 1 | no | Calculating how many elements should be in between e.g. 1 ... 4 5 6 ... or 1 ... 5 ... |
ariaLabels | object | - | no | Object containing aria labels for prev, next and page button |
prevPageButton | string | - | no | Prev button aria label, part of ariaLabel object |
nextPageButton | string | - | no | Next button aria label, part of ariaLabel object |
pageButton | string | - | no | Page button aria label, part of ariaLabel object |
Change Log - @mercell/pagination-react
This log was last generated on Fri, 11 Nov 2022 09:18:57 GMT and should not be manually modified.
6.0.0
Fri, 11 Nov 2022 09:18:57 GMT
Breaking changes
- New styling approach - use only tailwind classes, add tailwind-merge library
5.0.0
Thu, 15 Sep 2022 06:07:41 GMT
Breaking changes
- Migration to Tailwind3, React 18 and ViteJS from webpack.
4.0.8
Thu, 14 Jul 2022 14:09:47 GMT
Patches
- Fix not consistent key in array render of page buttons
4.0.7
Thu, 14 Jul 2022 13:28:46 GMT
Patches
- Updated hover state to remove sticky hover on mobile
4.0.6
Thu, 30 Jun 2022 10:57:49 GMT
Patches
- Package.json refactor, add test suite, more tests soon
4.0.5
Fri, 08 Apr 2022 10:19:50 GMT
Patches
- Bump dependencies
4.0.4
Mon, 28 Feb 2022 12:45:49 GMT
Patches
- Dependency update
4.0.3
Mon, 28 Feb 2022 10:55:32 GMT
Patches
- Bump typescript
4.0.2
Wed, 26 Jan 2022 16:19:19 GMT
Patches
- Move dependencies to peerDependencies to avoid duplication in installation process in project
- Adding the same peerDependencies to devDependencies
4.0.1
Tue, 18 Jan 2022 14:33:13 GMT
Version update only
4.0.0
Wed, 15 Dec 2021 22:20:34 GMT
Breaking changes
- Update to match figma design
3.0.5
Fri, 12 Nov 2021 13:08:30 GMT
Patches
- Add @mercell/tailwind to devDeps to be always up to date
3.0.4
Fri, 05 Nov 2021 11:10:13 GMT
Patches
- Bump peerDependency
3.0.3
Thu, 04 Nov 2021 10:10:16 GMT
Patches
- Tailwind type fix
- Revert tailwind version
3.0.2
Wed, 03 Nov 2021 15:28:42 GMT
Patches
- react types >=17
3.0.1
Wed, 27 Oct 2021 12:53:13 GMT
Patches
- Gitignore fix
3.0.0
Mon, 18 Oct 2021 07:16:21 GMT
Breaking changes
- New local build process with webpack without storybook, add npmignore and update dependencies
2.0.0
Mon, 12 Jul 2021 13:42:57 GMT
Breaking changes
- Rebuilding pagination
1.0.9
Mon, 12 Jul 2021 10:50:09 GMT
Patches
- Updating dependencies
- Updating dependencies
1.0.8
Wed, 24 Mar 2021 10:17:01 GMT
Patches
- Enabling eslint
1.0.7
Tue, 23 Mar 2021 13:40:42 GMT
Patches
- Adding esm module export
1.0.6
Wed, 17 Mar 2021 10:01:28 GMT
Patches
- Adding readme
1.0.5
Wed, 24 Feb 2021 11:34:29 GMT
Patches
- Button scheme now corrected
1.0.4
Fri, 19 Feb 2021 10:19:48 GMT
Patches
- Added pagination plugin
1.0.3
Fri, 19 Feb 2021 09:41:17 GMT
Patches
- bump
1.0.2
Thu, 11 Feb 2021 10:24:45 GMT
Patches
- Make sure all pagination elements have a key property
1.0.1
Fri, 05 Feb 2021 09:50:54 GMT
Patches
- target es5
1.0.0
Thu, 04 Feb 2021 08:46:45 GMT
Breaking changes
- Adding component
Sometimes it can take some time until Figma will render component inside embed iframe. Try to click plus icon to 'reset' initial loader. (Works only in Chrome)
Click me to open figma in the new card