{"id":13462862,"url":"https://github.com/robcalcroft/react-native-multiselect","last_synced_at":"2025-04-10T19:50:33.926Z","repository":{"id":51530957,"uuid":"77093613","full_name":"robcalcroft/react-native-multiselect","owner":"robcalcroft","description":":ballot_box_with_check: A simple RN component that allows row selection","archived":false,"fork":false,"pushed_at":"2023-04-17T19:00:39.000Z","size":101,"stargazers_count":19,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T17:21:53.242Z","etag":null,"topics":["multiselect","react-native"],"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/robcalcroft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-21T23:27:01.000Z","updated_at":"2023-09-04T20:38:11.000Z","dependencies_parsed_at":"2024-01-29T07:28:16.602Z","dependency_job_id":"fafef5d4-67f6-4a48-8dd4-b136015ced9f","html_url":"https://github.com/robcalcroft/react-native-multiselect","commit_stats":{"total_commits":31,"total_committers":6,"mean_commits":5.166666666666667,"dds":0.4516129032258065,"last_synced_commit":"65edd7e7efdafb2a633723e7ff673878ac1c79ba"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robcalcroft%2Freact-native-multiselect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robcalcroft%2Freact-native-multiselect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robcalcroft%2Freact-native-multiselect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robcalcroft%2Freact-native-multiselect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robcalcroft","download_url":"https://codeload.github.com/robcalcroft/react-native-multiselect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199247,"owners_count":21063641,"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":["multiselect","react-native"],"created_at":"2024-07-31T13:00:38.825Z","updated_at":"2025-04-10T19:50:33.899Z","avatar_url":"https://github.com/robcalcroft.png","language":"JavaScript","readme":"# react-native-multiselect\n\u003e A simple RN component that allows row selection\n\n## Install\n`yarn add react-native-multiselect` or `npm install react-native-multiselect --save`\n\n### 3.0.0\n`3.0.0` swaps out `ListView` for `FlatList` or `SectionList`. This gives a huge performance increase for larger lists. This is a **breaking change** so you might need to modify your implementation of `react-native-multiselect` for this to work. Don't worry though, its not a massive change.\n\n### 2.0.0\n**If you used `\u003c2.0.0` the `renderRow` API has changed and you'll need to do a small rewrite**\n\n`2.0.0` brings some major performance enhancements and removes the dependancy on `react-native-vector-icons`, you are now just given an `isSelected` parameter which you can use to style the `renderRow`. Thanks to [@indesignlatam](https://github.com/indesignlatam) for proposing a fix to performance issues with large datasets.\n\n\n## API\n### `options[]` `required`\nAn array of values for the list to display. Each item in the array should be an\nobject that looks like this:\n```javascript\n{\n  // A unique identifier for the row\n  key: Number || String\n  // The name displayed in the row\n  name: String\n  // This namespace can also be used to store custom props\n  ...customProps\n}\n```\n\n### `renderRow` `(row, isSelected)` `required`\nA function that renders each row. The current row object is passed to it to\nallow dynamic rows. This is where you could use the `customProps` mentioned\nabove. You can use the `isSelected` parameter to decide how to style your row when its selected\n\n### `onSelectionChange` `(selectedRow, allSelectedRows)`\nA callback that is fired when a row is clicked. It is passed the row that was\njust selected as well as an array of all the currently selected rowStyle.\n\n### `selectedOptions[]`\nAn array of `keys` that match those in `options` that will be preselected on the\nlist.\n\n### `rowStyle{}`\nA React Native style object, you can also pass StyleSheet styles to this; they\nwill be flattened.\n\n### `listProps{}`\nAn object of props that are given to the FlatList or SectionList, this for things like `ListHeaderComponent`\n\n### `activeOpacity` `Number`\nProxied to the TouchableHighlight component when you click the row\n\n### `underlayColor` `String`\nProxied to the TouchableHighlight component when you click the row\n\n### `useSections` `Boolean`\nUse this to render a `SectionList` instead of a `FlatList`. Your `options` prop needs to looks like the one seen here: https://facebook.github.io/react-native/docs/sectionlist.html\n\n\n## Usage\n```javascript\nimport MultiSelect from 'react-native-multiselect';\n\nconst MyComponent = ({\n  // [{id: 1, name: 'Thing 1', data: [...]}, {id: 2, name: 'Thing 2', data: [...]} ...]\n  listOfThings,\n  // [0, 4]\n  preselectedThings,\n  // (selectedRows) =\u003e this.setState({ selectedRows })\n  updateListOfSelectedThings,\n}) =\u003e (\n  \u003cView\u003e\n    \u003cText\u003eSelect some items from the list\u003c/Text\u003e\n    \u003cMultiSelect\n      options={listOfThings.map(thing =\u003e ({ key: thing.id, name: thing.name }) )}\n      renderRow={(row, isSelected) =\u003e \u003cText\u003e{row.name} {isSelected ? 'I am selected' : 'I am not selected'}\u003c/Text\u003e}\n      onSelectionChange={\n        (selectedRow, allSelectedRows) =\u003e updateListOfSelectedThings(allSelectedRows)\n      }\n      selectedOptions={[]}\n      rowStyle={{ backgroundColor: 'skyblue' }}\n    /\u003e\n  \u003c/View\u003e\n);\n```\n","funding_links":[],"categories":["Components","Others"],"sub_categories":["UI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobcalcroft%2Freact-native-multiselect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobcalcroft%2Freact-native-multiselect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobcalcroft%2Freact-native-multiselect/lists"}