{"id":3955,"url":"https://github.com/FaridSafi/react-native-gifted-listview","last_synced_at":"2025-08-04T00:30:53.290Z","repository":{"id":38421813,"uuid":"44819457","full_name":"FaridSafi/react-native-gifted-listview","owner":"FaridSafi","description":"✌️ ListView with pull-to-refresh and infinite scrolling for Android and iOS React-Native apps","archived":false,"fork":false,"pushed_at":"2018-06-25T11:50:37.000Z","size":671,"stargazers_count":1620,"open_issues_count":46,"forks_count":291,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-07-30T07:24:30.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FaridSafi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-23T14:50:37.000Z","updated_at":"2025-07-23T15:52:45.000Z","dependencies_parsed_at":"2022-08-18T08:20:20.381Z","dependency_job_id":null,"html_url":"https://github.com/FaridSafi/react-native-gifted-listview","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/FaridSafi/react-native-gifted-listview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaridSafi%2Freact-native-gifted-listview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaridSafi%2Freact-native-gifted-listview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaridSafi%2Freact-native-gifted-listview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaridSafi%2Freact-native-gifted-listview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FaridSafi","download_url":"https://codeload.github.com/FaridSafi/react-native-gifted-listview/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FaridSafi%2Freact-native-gifted-listview/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268633375,"owners_count":24281770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-01-05T20:16:56.461Z","updated_at":"2025-08-04T00:30:52.894Z","avatar_url":"https://github.com/FaridSafi.png","language":"JavaScript","funding_links":[],"categories":["Components","组件","JavaScript","Libraries","Others"],"sub_categories":["UI","ListView\u0026ScrollView"],"readme":"# Gifted ListView\n\nA ListView with pull-to-refresh, infinite scrolling and more for Android and iOS React-Native apps\n\n\n![](https://raw.githubusercontent.com/FaridSafi/react-native-gifted-listview/master/Captures/ios_refresh_page_demo.gif)\n![](https://raw.githubusercontent.com/FaridSafi/react-native-gifted-listview/master/Captures/android_refresh_page_demo.gif)\n\n\n### Changelog\n#### 0.0.13\n- Use RefreshControl instead of own implementation for pull-to-refresh (PR @SpaceK33z)\n\n\n\n### Simple example\n\n\n```js\nvar React = require('react-native');\nvar {\n  StyleSheet,\n  Text,\n  View,\n  TouchableHighlight\n} = React;\n\nvar GiftedListView = require('react-native-gifted-listview');\n\nvar Example = React.createClass({\n\n  /**\n   * Will be called when refreshing\n   * Should be replaced by your own logic\n   * @param {number} page Requested page to fetch\n   * @param {function} callback Should pass the rows\n   * @param {object} options Inform if first load\n   */\n  _onFetch(page = 1, callback, options) {\n    setTimeout(() =\u003e {\n      var rows = ['row '+((page - 1) * 3 + 1), 'row '+((page - 1) * 3 + 2), 'row '+((page - 1) * 3 + 3)];\n      if (page === 3) {\n        callback(rows, {\n          allLoaded: true, // the end of the list is reached\n        });\n      } else {\n        callback(rows);\n      }\n    }, 1000); // simulating network fetching\n  },\n\n\n  /**\n   * When a row is touched\n   * @param {object} rowData Row data\n   */\n  _onPress(rowData) {\n    console.log(rowData+' pressed');\n  },\n\n  /**\n   * Render a row\n   * @param {object} rowData Row data\n   */\n  _renderRowView(rowData) {\n    return (\n      \u003cTouchableHighlight\n        style={styles.row}\n        underlayColor='#c8c7cc'\n        onPress={() =\u003e this._onPress(rowData)}\n      \u003e\n        \u003cText\u003e{rowData}\u003c/Text\u003e\n      \u003c/TouchableHighlight\u003e\n    );\n  },\n\n  render() {\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cView style={styles.navBar} /\u003e\n        \u003cGiftedListView\n          rowView={this._renderRowView}\n          onFetch={this._onFetch}\n          firstLoader={true} // display a loader for the first fetching\n          pagination={true} // enable infinite scrolling using touch to load more\n          refreshable={true} // enable pull-to-refresh for iOS and touch-to-refresh for Android\n          withSections={false} // enable sections\n          customStyles={{\n            paginationView: {\n              backgroundColor: '#eee',\n            },\n          }}\n\n          refreshableTintColor=\"blue\"\n        /\u003e\n      \u003c/View\u003e\n    );\n  }\n});\n\nvar styles = {\n  container: {\n    flex: 1,\n    backgroundColor: '#FFF',\n  },\n  navBar: {\n    height: 64,\n    backgroundColor: '#CCC'\n  },\n  row: {\n    padding: 10,\n    height: 44,\n  },\n};\n```\n\n\n### Advanced example\n\n[See GiftedListViewExample/example_advanced.js](GiftedListViewExample/example_advanced.js)\n\n\n### Installation\n\n```npm install react-native-gifted-listview --save```\n\n\n### Features\n- [x] Pull-to-refresh in iOS\n- [x] Touch-to-refresh in Android\n- [x] Infinite scrolling using touch to load more\n- [x] Loader for first display\n- [x] Default view when no content to display\n- [x] Customizable (see advanced example)\n- [x] Support for section header\n- [x] Pull-to-refresh in Android\n\n\n\n### License\n\n[MIT](LICENSE.md)\n\n\nFeel free to ask me questions on Twitter [@FaridSafi](https://www.twitter.com/FaridSafi) !\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFaridSafi%2Freact-native-gifted-listview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFaridSafi%2Freact-native-gifted-listview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFaridSafi%2Freact-native-gifted-listview/lists"}