{"_id":"@ahmedamin20/pagination","_rev":"5-fa725bdcc0c63a6282f4d29603364cb1","name":"@ahmedamin20/pagination","description":"this Package Generates an array on of number for pagination","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@ahmedamin20/pagination","version":"1.0.0","author":{"name":"ahmedamin.work24@gmail.com"},"license":"MIT","_id":"@ahmedamin20/pagination@1.0.0","homepage":"https://github.com/ahmedamin20/-ahmedamin20-pagination#readme","bugs":{"url":"https://github.com/ahmedamin20/-ahmedamin20-pagination/issues"},"dist":{"shasum":"e205a18b4144f8e3d1343803e5a755eb25ee1ee3","tarball":"https://registry.npmjs.org/@ahmedamin20/pagination/-/pagination-1.0.0.tgz","fileCount":7,"integrity":"sha512-73JOk6SmmPKIQpP0KuIL6cKRQHElZsyInzFmCE7oAf8FUPi4i1a8+IeCbvLtSOcKEZPl/g/865ivB/DGBIOc+Q==","signatures":[{"sig":"MEQCIE4M7YVHDqznmgjaMMiF9tJ4AxxN/P/L3QymY1ooKmdpAiB8xTkw2Lg6zPQeOC1bC4PFKY0151vu4PThHqnfYqhbag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4874},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","scripts":{"build":"tsup"},"_npmUser":{"name":"ahmedamin20","email":"tc.supply6@gmail.com"},"repository":{"url":"git+https://github.com/ahmedamin20/-ahmedamin20-pagination.git","type":"git"},"_npmVersion":"9.9.3","description":"this Package Generates an array on of number for pagination","directories":{},"_nodeVersion":"20.12.0","dependencies":{"react":"^18.3.1","react-dom":"^18.3.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","typescript":"^5.5.2","@types/react":"^18.3.3"},"_npmOperationalInternal":{"tmp":"tmp/pagination_1.0.0_1719437339955_0.6031269536141108","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@ahmedamin20/pagination","version":"1.0.1","author":{"name":"ahmedamin.work24@gmail.com"},"license":"MIT","_id":"@ahmedamin20/pagination@1.0.1","homepage":"https://github.com/ahmedamin20/-ahmedamin20-pagination#readme","bugs":{"url":"https://github.com/ahmedamin20/-ahmedamin20-pagination/issues"},"dist":{"shasum":"d8145b930e182ff92597610d86b5f92e815bf5a6","tarball":"https://registry.npmjs.org/@ahmedamin20/pagination/-/pagination-1.0.1.tgz","fileCount":7,"integrity":"sha512-15H5TSmiOuxYvVUhStjtGi0P+hfqSku2jAmYu+Yldqfj33Axy/HjHWKfSddnB07LqJFv5gUF3wNZK0rAY3unPQ==","signatures":[{"sig":"MEUCIQDgmXb4VcQSCFmd28cfAQq4LVY7w9tP8lZqONJ2MeCU+QIgNtGGPdFaOW/P9BuiUgiaowRA8+dx6wKUc/x20ABBpP4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6422},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"b7666da7c33323a91a721f5f311bd3608507ca9a","scripts":{"build":"tsup"},"_npmUser":{"name":"ahmedamin20","email":"tc.supply6@gmail.com"},"repository":{"url":"git+https://github.com/ahmedamin20/-ahmedamin20-pagination.git","type":"git"},"_npmVersion":"9.9.3","description":"this Package Generates an array on of number for pagination","directories":{},"_nodeVersion":"20.12.0","dependencies":{"react":"^18.3.1","react-dom":"^18.3.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","typescript":"^5.5.2","@types/react":"^18.3.3"},"_npmOperationalInternal":{"tmp":"tmp/pagination_1.0.1_1719438029565_0.2709180238580444","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@ahmedamin20/pagination","version":"1.0.2","keywords":["ahmedamin.work24@gmail.com","@ahmedamin20/pagination"],"author":{"name":"ahmedamin.work24@gmail.com"},"license":"MIT","_id":"@ahmedamin20/pagination@1.0.2","homepage":"https://github.com/ahmedamin20/-ahmedamin20-pagination#readme","bugs":{"url":"https://github.com/ahmedamin20/-ahmedamin20-pagination/issues"},"dist":{"shasum":"17d78e2fb47694e60b64c8b0bb9bb6614a151790","tarball":"https://registry.npmjs.org/@ahmedamin20/pagination/-/pagination-1.0.2.tgz","fileCount":7,"integrity":"sha512-1r4jhfI6atNflc6+mvlVVxj3xtY2QNBNyoSgiTWIuHfaVq82Yon82bMz6xK3oH9RFUdSsQXBn90R8kLDz05Ppg==","signatures":[{"sig":"MEUCIQCy5JQIccjb9Yz2qqwVEW+/Ftv9P/gAV3X2J8Xbw+HzzAIgBLOsHbsDdHDoWTGK+2Qoh4e7EuL5tcgsDcq27AGZ7h8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6495},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"82192eab03cb17616fd4b6a1c00f80cbcc153cfe","scripts":{"build":"tsup"},"_npmUser":{"name":"ahmedamin20","email":"tc.supply6@gmail.com"},"repository":{"url":"git+https://github.com/ahmedamin20/-ahmedamin20-pagination.git","type":"git"},"_npmVersion":"9.9.3","description":"this Package Generates an array on of number for pagination","directories":{},"_nodeVersion":"20.12.0","dependencies":{"react":"^18.3.1","react-dom":"^18.3.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","typescript":"^5.5.2","@types/react":"^18.3.3"},"_npmOperationalInternal":{"tmp":"tmp/pagination_1.0.2_1719438411692_0.16030900965163375","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@ahmedamin20/pagination","version":"1.0.3","keywords":["ahmedamin.work24@gmail.com","@ahmedamin20/pagination"],"author":{"name":"ahmedamin.work24@gmail.com"},"license":"MIT","_id":"@ahmedamin20/pagination@1.0.3","homepage":"https://github.com/ahmedamin20/-ahmedamin20-pagination#readme","bugs":{"url":"https://github.com/ahmedamin20/-ahmedamin20-pagination/issues"},"dist":{"shasum":"0435ae3a77e535fa8c2d5bfe1531fafe87749902","tarball":"https://registry.npmjs.org/@ahmedamin20/pagination/-/pagination-1.0.3.tgz","fileCount":7,"integrity":"sha512-I5k784WjoXxtJW6JVexvbihn1S06tm5gKtEM/c0PDK0E8T3l0wot9LyAgKleYb4UaSa8sIXeRYVN7TVz+uABfQ==","signatures":[{"sig":"MEUCIQDGYQw0J6dYnSyrrVxGy1XDXncivmx4A17+KDZky/BU1gIgcfdBsxPP05EUPsItXeyzRUhQZZFFXXdtKYr5+Y7S7OQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6474},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"82192eab03cb17616fd4b6a1c00f80cbcc153cfe","scripts":{"build":"tsup"},"_npmUser":{"name":"ahmedamin20","email":"tc.supply6@gmail.com"},"repository":{"url":"git+https://github.com/ahmedamin20/-ahmedamin20-pagination.git","type":"git"},"_npmVersion":"9.9.3","description":"this Package Generates an array on of number for pagination","directories":{},"_nodeVersion":"20.12.0","dependencies":{"react":"^18.3.1","react-dom":"^18.3.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","typescript":"^5.5.2","@types/react":"^18.3.3"},"_npmOperationalInternal":{"tmp":"tmp/pagination_1.0.3_1719439233615_0.504896018815225","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@ahmedamin20/pagination","version":"1.0.4","keywords":["ahmedamin.work24@gmail.com","@ahmedamin20/pagination"],"author":{"name":"ahmedamin.work24@gmail.com"},"license":"MIT","_id":"@ahmedamin20/pagination@1.0.4","homepage":"https://github.com/ahmedamin20/-ahmedamin20-pagination#readme","bugs":{"url":"https://github.com/ahmedamin20/-ahmedamin20-pagination/issues"},"dist":{"shasum":"158ce2c1e7c467bc87d48915265e738b684ddc64","tarball":"https://registry.npmjs.org/@ahmedamin20/pagination/-/pagination-1.0.4.tgz","fileCount":7,"integrity":"sha512-EqrRu++4dGAeU2LkQRsziMnreMzL3Ymxu1hC4SXnJSlp5BOH72ZZmOX9wkC/oAOSV7uaqcrP1OCBDlmx5Sn29g==","signatures":[{"sig":"MEQCIBzzjJstdhaY9gIjG9+ExcJjCU5uYYT9IVZ6aRTC3wlMAiB1xgscJZiwMzgHNWB7K6Dhw7Jubl1SJQLlYuyXp6E6SA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6466},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"27fc42d1a4c00603d606172604bfd54c3cc1d44a","scripts":{"build":"tsup"},"_npmUser":{"name":"ahmedamin20","email":"tc.supply6@gmail.com"},"repository":{"url":"git+https://github.com/ahmedamin20/-ahmedamin20-pagination.git","type":"git"},"_npmVersion":"9.9.3","description":"this Package Generates an array on of number for pagination","directories":{},"_nodeVersion":"20.12.0","dependencies":{"react":"^18.3.1","react-dom":"^18.3.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","typescript":"^5.5.2","@types/react":"^18.3.3"},"_npmOperationalInternal":{"tmp":"tmp/pagination_1.0.4_1719439460170_0.8393750926286692","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"@ahmedamin20/pagination","version":"1.0.5","description":"this Package Generates an array on of number for pagination","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/ahmedamin20/-ahmedamin20-pagination.git"},"scripts":{"build":"tsup"},"keywords":["ahmedamin.work24@gmail.com","@ahmedamin20/pagination","React","Next","React-Paginate","pagination"],"author":{"name":"ahmedamin.work24@gmail.com"},"license":"MIT","devDependencies":{"@types/react":"^18.3.3","tsup":"^8.1.0","typescript":"^5.5.2"},"dependencies":{"react":"^18.3.1","react-dom":"^18.3.1"},"_id":"@ahmedamin20/pagination@1.0.5","gitHead":"ede4a92a6b3ec83b375f65a48f46f3448527ad40","bugs":{"url":"https://github.com/ahmedamin20/-ahmedamin20-pagination/issues"},"homepage":"https://github.com/ahmedamin20/-ahmedamin20-pagination#readme","_nodeVersion":"20.12.0","_npmVersion":"9.9.3","dist":{"integrity":"sha512-faXG+gUPEA+Ji2h6Ve0O3kGqZllbvmD6tRCXS38jRjGjXyR5xuYZIbrtvrggobi2pWKm6zHndWxIBc9A1JsOqQ==","shasum":"edcbb101be4f6a1778f1a28a20f161b4f5d52f8b","tarball":"https://registry.npmjs.org/@ahmedamin20/pagination/-/pagination-1.0.5.tgz","fileCount":7,"unpackedSize":6515,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvqCPwCxchV6/f9SOwk7IKabcPxMaeZE0bBB8tksxuSQIgUBfM/R/LaqG+qqIJ4A4TtELXUmXBlkRWvJvaruKxz9E="}]},"_npmUser":{"name":"ahmedamin20","email":"tc.supply6@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pagination_1.0.5_1719526544295_0.08707266915729295"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-26T21:28:59.847Z","modified":"2024-06-27T22:15:44.673Z","1.0.0":"2024-06-26T21:29:00.204Z","1.0.1":"2024-06-26T21:40:29.722Z","1.0.2":"2024-06-26T21:46:51.857Z","1.0.3":"2024-06-26T22:00:33.740Z","1.0.4":"2024-06-26T22:04:20.377Z","1.0.5":"2024-06-27T22:15:44.494Z"},"maintainers":[{"name":"ahmedamin20","email":"tc.supply6@gmail.com"}],"author":{"name":"ahmedamin.work24@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/ahmedamin20/-ahmedamin20-pagination.git"},"keywords":["ahmedamin.work24@gmail.com","@ahmedamin20/pagination","React","Next","React-Paginate","pagination"],"license":"MIT","homepage":"https://github.com/ahmedamin20/-ahmedamin20-pagination#readme","bugs":{"url":"https://github.com/ahmedamin20/-ahmedamin20-pagination/issues"},"readme":"# usePaginationHook\r\n\r\nA custom React hook for handling pagination logic in your applications.\r\n\r\n## Installation\r\n\r\nTo install the hook, you can use npm or yarn:\r\n\r\n```bash\r\nnpm install @ahmedamin20/pagination\r\n# or\r\nyarn add @ahmedamin20/pagination\r\n```\r\n\r\n## Usage\r\nTo use the usePaginationHook, you can import it into your component and use it as shown below:\r\n\r\n```javascript\r\nimport React from 'react';\r\nimport usePaginationHook from '@ahmedamin20/pagination';\r\n\r\nconst PaginationComponent = ({ totalCount, items }) => {\r\n  const { pagesCount, hasMore, page, setPage } = usePaginationHook({\r\n    count: totalCount, //count of all records in Your db\r\n    dataLength: items.length,\r\n    limit: 5 // Optional, defaults to 5 if not provided\r\n  });\r\n\r\n  const handlePageChange = (newPage) => {\r\n    setPage(newPage);\r\n    // Fetch new data based on newPage\r\n  };\r\n\r\n  return (\r\n    <div>\r\n      <div>\r\n        {items.map(item => (\r\n          <div key={item.id}>{item.name}</div>\r\n        ))}\r\n      </div>\r\n      {hasMore && (\r\n        <div>\r\n          {pagesCount.map(pageNumber => (\r\n            <button\r\n              key={pageNumber}\r\n              onClick={() => handlePageChange(pageNumber)}\r\n              disabled={page === pageNumber}\r\n            >\r\n              {pageNumber}\r\n            </button>\r\n          ))}\r\n        </div>\r\n      )}\r\n    </div>\r\n  );\r\n};\r\n\r\nexport default PaginationComponent;\r\n\r\n```\r\n\r\n## License\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\n","readmeFilename":"README.md"}