{"id":21383045,"url":"https://github.com/devshivamthakur/react-native-paginated-flatlist","last_synced_at":"2026-04-13T23:02:35.493Z","repository":{"id":262301357,"uuid":"886822335","full_name":"devshivamthakur/react-native-paginated-flatlist","owner":"devshivamthakur","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-11T17:11:45.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T23:55:09.389Z","etag":null,"topics":["flatlist","react","react-native","react-native-flatist-pagination"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-paginated-flatlist","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devshivamthakur.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-11T17:04:53.000Z","updated_at":"2024-11-12T09:21:57.000Z","dependencies_parsed_at":"2024-11-11T18:34:42.928Z","dependency_job_id":null,"html_url":"https://github.com/devshivamthakur/react-native-paginated-flatlist","commit_stats":null,"previous_names":["devshivamthakur/react-native-flatlist-pagination","devshivamthakur/react-native-paginated-flatlist"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devshivamthakur/react-native-paginated-flatlist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devshivamthakur%2Freact-native-paginated-flatlist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devshivamthakur%2Freact-native-paginated-flatlist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devshivamthakur%2Freact-native-paginated-flatlist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devshivamthakur%2Freact-native-paginated-flatlist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devshivamthakur","download_url":"https://codeload.github.com/devshivamthakur/react-native-paginated-flatlist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devshivamthakur%2Freact-native-paginated-flatlist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31774547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flatlist","react","react-native","react-native-flatist-pagination"],"created_at":"2024-11-22T11:19:31.149Z","updated_at":"2026-04-13T23:02:35.473Z","avatar_url":"https://github.com/devshivamthakur.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native Paginated FlatList\n\nA customizable and optimized paginated FlatList component for React Native, designed to handle large lists efficiently with infinite scrolling and optional animation.\n\n## Features\n\n- **Pagination**: Automatically handles pagination with configurable page size and current page.\n- **Infinite Scroll**: Loads more data as you scroll to the end of the list.\n- **Customizable**: Customize the `renderItem`, `keyExtractor`, and `fetchMoreData` functions.\n- **Animation**: Optional fade-in animation for list items on load.\n- **Typescript Support**: Fully typed for better development experience.\n\n## Installation\n\nTo install the package, run the following command:\n\n```bash\nnpm install react-native-paginated-flatlist\n\n```\n\nor if you're using Yarn:\n\n```bash\nyarn add react-native-paginated-flatlist\n```\n\n## Usage\n\n### Basic Example\n\n```tsx\nimport React, { useState, useCallback } from 'react';\nimport { View, Text, StyleSheet } from 'react-native';\nimport { PaginatedFlatList } from 'react-native-paginated-flatlist';\n\nconst App = () =\u003e {\n  const [data, setData] = useState\u003cnumber[]\u003e(Array.from({ length: 50 }, (_, i) =\u003e i + 1));\n\n  const fetchMoreData = useCallback(() =\u003e {\n    // Simulate fetching more data\n    setTimeout(() =\u003e {\n      setData(prevData =\u003e [...prevData, ...Array.from({ length: 50 }, (_, i) =\u003e i + prevData.length + 1)]);\n    }, 1000);\n  }, []);\n\n  const renderItem = useCallback(({ item }: { item: number }) =\u003e (\n    \u003cView style={styles.item}\u003e\n      \u003cText style={styles.text}\u003e{item}\u003c/Text\u003e\n    \u003c/View\u003e\n  ), []);\n\n  return (\n    \u003cPaginatedFlatList\n      data={data}\n      isPagination={true}\n      perPage={10}\n      fetchMoreData={fetchMoreData}\n      renderItem={renderItem}\n      keyExtractor={(item) =\u003e item.toString()}\n    /\u003e\n  );\n};\n\nconst styles = StyleSheet.create({\n  item: {\n    padding: 20,\n    borderBottomWidth: 1,\n    borderBottomColor: '#ddd',\n  },\n  text: {\n    fontSize: 18,\n  },\n});\n\nexport default App;\n```\n\n### Properties\n\n| Prop              | Type                                      | Description                                                                                                                                                  |\n|-------------------|-------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `data`            | `Array\u003cT\u003e`                                 | The data array to be displayed in the list.                                                                                                                   |\n| `isPagination`    | `boolean`                                  | Enables pagination when set to `true`. Default is `true`.                                                                                                    |\n| `perPage`         | `number`                                   | The number of items to display per page. Default is `10`.                                                                                                    |\n| `currentPage`     | `number`                                   | The current page to display. Default is `1`.                                                                                                                 |\n| `fetchMoreData`   | `function` (optional)                     | A function to fetch more data when the end of the list is reached.                                                                                           |\n| `renderItem`      | `function` (required)                     | A function to render each item in the list.                                                                                                                   |\n| `keyExtractor`    | `function` (required)                     | A function to extract a unique key for each item in the list.                                                                                               |\n| `isAnimated`      | `boolean` (optional)                      | When `true`, the list items will fade in with animation. Default is `false`.                                                                                 |\n| `onPageChange`    | `function` (optional)                     | A callback function that is invoked whenever the current page changes.                                                                                       |\n\n### Pagination Behavior\n\n- By default, the component will only show `perPage` items on the screen and load more as you scroll down.\n- Once the end of the list is reached, the `fetchMoreData` function will be triggered to load more items.\n- The `currentPage` will update accordingly, and the `onPageChange` callback (if provided) will notify the parent component.\n\n### Customizing List Items\n\nYou can pass a custom `renderItem` function to customize the appearance of each list item. Make sure to pass a `keyExtractor` for performance optimization.\n\nExample:\n\n```tsx\nconst renderItem = useCallback(({ item }: { item: number }) =\u003e (\n  \u003cView style={styles.item}\u003e\n    \u003cText style={styles.text}\u003e{item}\u003c/Text\u003e\n  \u003c/View\u003e\n), []);\n```\n\n### Handling Data Fetching\n\nYou can provide a `fetchMoreData` function to load more data when the user reaches the end of the list. This function can return a promise or be a synchronous function.\n\nExample:\n\n```tsx\nconst fetchMoreData = useCallback(() =\u003e {\n  setTimeout(() =\u003e {\n    setData(prevData =\u003e [...prevData, ...Array.from({ length: 50 }, (_, i) =\u003e i + prevData.length + 1)]);\n  }, 1000);\n}, []);\n```\n\n## Optional Fade-in Animation\n\nTo add a fade-in animation when the items are rendered, set the `isAnimated` prop to `true`.\n\nExample:\n\n```tsx\n\u003cPaginatedFlatList\n  data={data}\n  isPagination={true}\n  perPage={10}\n  fetchMoreData={fetchMoreData}\n  renderItem={renderItem}\n  keyExtractor={(item) =\u003e item.toString()}\n  isAnimated={true}\n/\u003e\n```\n\nThis will trigger a fade-in effect when the list items are first rendered.\n\n## Contributing\n\nWe welcome contributions to this package. If you find any bugs or have suggestions for improvements, feel free to open an issue or submit a pull request.\n\n## License\n\nMIT © [Your Name]\n```\n\n\n### Explanation of Sections:\n\n- **Features**: A short overview of the features of your component.\n- **Installation**: Instructions for installing the package via npm or yarn.\n- **Usage**: Code examples demonstrating how to use the component with a React Native application.\n- **Properties**: A detailed table of all the props with their descriptions and default values.\n- **Pagination Behavior**: Explanation of how pagination works in the component.\n- **Customizing List Items**: How to customize the `renderItem` function for item display.\n- **Handling Data Fetching**: How to use the `fetchMoreData` function to load more data as the user scrolls.\n- **Optional Fade-in Animation**: How to enable item animations.\n- **Contributing**: How others can contribute to the project.\n- **License**: Open-source license (MIT).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevshivamthakur%2Freact-native-paginated-flatlist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevshivamthakur%2Freact-native-paginated-flatlist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevshivamthakur%2Freact-native-paginated-flatlist/lists"}