{"id":15297063,"url":"https://github.com/react-component/m-list-view","last_synced_at":"2025-04-09T13:03:33.437Z","repository":{"id":49054745,"uuid":"59763134","full_name":"react-component/m-list-view","owner":"react-component","description":"ReactNative ListView Web Port","archived":false,"fork":false,"pushed_at":"2021-06-29T21:15:54.000Z","size":3285,"stargazers_count":85,"open_issues_count":21,"forks_count":28,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T12:03:47.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://react-component.github.io/m-list-view/","language":"JavaScript","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/react-component.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-26T15:48:17.000Z","updated_at":"2023-11-29T08:25:22.000Z","dependencies_parsed_at":"2022-07-26T01:02:31.453Z","dependency_job_id":null,"html_url":"https://github.com/react-component/m-list-view","commit_stats":null,"previous_names":["react-component/m-listview"],"tags_count":77,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fm-list-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fm-list-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fm-list-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-component%2Fm-list-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-component","download_url":"https://codeload.github.com/react-component/m-list-view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045230,"owners_count":21038553,"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","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-09-30T19:14:56.485Z","updated_at":"2025-04-09T13:03:33.412Z","avatar_url":"https://github.com/react-component.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rmc-list-view\n---\n\nReact ListView Component, port from [React Native ListView](https://facebook.github.io/react-native/docs/listview.html)\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![gemnasium deps][gemnasium-image]][gemnasium-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: http://img.shields.io/npm/v/rmc-list-view.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/rmc-list-view\n[travis-image]: https://img.shields.io/travis/react-component/m-list-view.svg?style=flat-square\n[travis-url]: https://travis-ci.org/react-component/m-list-view\n[coveralls-image]: https://img.shields.io/coveralls/react-component/m-list-view.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/react-component/m-list-view?branch=master\n[gemnasium-image]: http://img.shields.io/gemnasium/react-component/m-list-view.svg?style=flat-square\n[gemnasium-url]: https://gemnasium.com/react-component/m-list-view\n[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square\n[node-url]: http://nodejs.org/download/\n[download-image]: https://img.shields.io/npm/dm/rmc-list-view.svg?style=flat-square\n[download-url]: https://npmjs.org/package/rmc-list-view\n\nport from [React Native ListView](https://facebook.github.io/react-native/docs/listview.html#content)\n(v0.26)\n\n## Screenshots\n\n\u003cimg src=\"https://os.alipayobjects.com/rmsportal/ddyjYtQFAIywppH.png\" width=\"288\"/\u003e\n\n\n## Development\n\n```\nnpm install\nnpm start\n```\n\n## Example\n\nhttp://localhost:8999/examples/\n\nonline example: http://react-component.github.io/m-list-view/\n\n## install\n\n[![rmc-list-view](https://nodei.co/npm/rmc-list-view.png)](https://npmjs.org/package/rmc-list-view)\n\n## Usage\nsee examples\n\n## API\n\nProperties | Descrition | Type | Default\n-----------|------------|------|--------\n| dataSource | An instance of [ListView.DataSource](http://facebook.github.io/react-native/releases/0.26/docs/listviewdatasource.html) to use | ListViewDataSource | - |\n| initialListSize | How many rows to render on initial component mount. | number | - |\n| onEndReached | Called when all rows have been rendered and the list has been scrolled to within `onEndReachedThreshold` of the bottom. | (event?) =\u003e {} | - |\n| onEndReachedThreshold | Threshold in pixels (virtual, not physical) for calling `onEndReached`. | number | 1000 |\n| pageSize | Number of rows to render per event loop. | number | 1 |\n| renderHeader / renderFooter | The header and footer are always rendered (if these props are provided) on every render pass. If they are expensive to re-render, wrap them in StaticContainer or other mechanism as appropriate. Footer is always at the bottom of the list, and header at the top, on every render pass. | () =\u003e renderable | - |\n| renderRow | Takes a data entry from the data source and its ids and should return a renderable component to be rendered as the row. By default the data is exactly what was put into the data source, but it's also possible to provide custom extractors. ListView can be notified when a row is being highlighted by calling highlightRow function. | (rowData, sectionID, rowID, highlightRow) =\u003e renderable | - |\n| renderScrollComponent | A function that returns the scrollable component in which the list rows are rendered. Defaults to returning a ScrollView with the given props. | (props) =\u003e renderable | - |\n| renderSectionHeader | If provided, a header is rendered for this section. | (sectionData, sectionID) =\u003e renderable | - |\n| renderSeparator | If provided, a renderable component to be rendered as the separator below each row but not the last row if there is a section header below. Take a sectionID and rowID of the row above and whether its adjacent row is highlighted. | (sectionID, rowID, adjacentRowHighlighted) =\u003e renderable | - |\n| scrollRenderAheadDistance | How early to start rendering rows before they come on screen, in pixels. | number | 1000 |\n| contentContainerStyle | These styles will be applied to the scroll view content container which wraps all of the child views. | Object | - |\n| horizontal | When true, the scroll view's children are arranged horizontally in a row instead of vertically in a column. | bool | false |\n| onContentSizeChange | Called when scrollable content view of the ScrollView changes. | (contentWidth, contentHeight) =\u003e {} | - |\n| onScroll | Fires at most once per frame during scrolling. The frequency of the events can be controlled using the `scrollEventThrottle` prop. | e =\u003e {} | - |\n| scrollEventThrottle | This controls how often the scroll event will be fired while scrolling | number | 50 |\n| onLayout | Invoked on mount and layout changes with | ({nativeEvent:{ layout:{ width, height }}}) =\u003e {} | - |\n| ---- |\n| renderBodyComponent (`web only`) | render listview body wrapper component | () =\u003e renderable | - |\n| renderSectionWrapper (`web only`) | | render listview section wrapper component | (sectionID) =\u003e renderable | - |\n| renderSectionBodyWrapper (`web only`) | render listview section body wrapper component | (sectionID) =\u003e renderable | - |\n| useBodyScroll (`web only`) | use html `body`'s scroll | bool | false |\n| pullToRefresh (`web only`) | Whether enable pullToRefresh, you need use it with [rmc-pull-to-refresh](https://github.com/react-component/m-pull-to-refresh) | bool | false |\n\n### Methods\n\n- getMetrics() - Exports some data, e.g. for perf investigations or analytics.\n- scrollTo(...args) - Scrolls to a given x, y offset(not support smooth animation).\n\n\n## ListView.IndexedList\n\nThis component is often used in the \"Contacts\" / \"city list\" scenes, support for index navigation.\n\n\u003e You can use almost all APIs on the ListView.\n\u003e\n\u003e Note: Only two-step rendering is supported, so that the first screen priority display can be achieved, but if the list data volume is too large, the overall performance will still be affected.\n\nProperties | Descrition | Type | Default\n-----------|------------|------|--------\n| quickSearchBarTop | top button object of navigation bar | object{value:string, label:string} | `{ value: '#', label: '#' }` |\n| quickSearchBarStyle |  quickSearchBar's style | object | - |\n| onQuickSearch | fire on clicking navigation bar. | (sectionID: any, topId?:any) =\u003e void | - |\n| showQuickSearchIndicator | whether show quick search indicator | bool | false |\n| delayTime | delay rendering time setting (for the first screen optimization, the initial rendering of the number of `initialListSize` data, after which time rendering the remaining data items, ie `totalRowCount - initialListSize`) | number |`100ms` |\n| delayActivityIndicator | the loading indicator for delayed rendering. | react node | - |\n\n\n## Tips\n\nListView has two types of scroll containers:\n\n1. Partial div container\n    - default, note: **need to manually set the height of the ListView**\n2. html body container\n    - set `useBodyScroll` to take effect (do not need to set height)\n\n\u003e please see [0.11.0 upgrade tips](./HISTORY.md#upgrade-tips).\n\n\n## Test Case\n\n```\nnpm test\n```\n\n## Coverage\n\n```\nnpm run coverage\n```\n\nopen coverage/ dir\n\n## License\n\nrmc-list-view is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Fm-list-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-component%2Fm-list-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-component%2Fm-list-view/lists"}