{"id":19355631,"url":"https://github.com/ajiew/react-native-tag-group","last_synced_at":"2025-04-23T09:33:13.222Z","repository":{"id":38896541,"uuid":"261769107","full_name":"aJIEw/react-native-tag-group","owner":"aJIEw","description":"A simple Tag component that supports both single and multiple selection.","archived":false,"fork":false,"pushed_at":"2023-01-06T05:22:19.000Z","size":3682,"stargazers_count":13,"open_issues_count":15,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T01:03:49.321Z","etag":null,"topics":["highly-customizable","multiple-selection","react-native","single-selection","tag-group","tags"],"latest_commit_sha":null,"homepage":null,"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/aJIEw.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}},"created_at":"2020-05-06T13:36:14.000Z","updated_at":"2024-08-22T07:09:19.000Z","dependencies_parsed_at":"2023-02-05T10:16:36.432Z","dependency_job_id":null,"html_url":"https://github.com/aJIEw/react-native-tag-group","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aJIEw%2Freact-native-tag-group","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aJIEw%2Freact-native-tag-group/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aJIEw%2Freact-native-tag-group/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aJIEw%2Freact-native-tag-group/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aJIEw","download_url":"https://codeload.github.com/aJIEw/react-native-tag-group/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250407654,"owners_count":21425534,"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":["highly-customizable","multiple-selection","react-native","single-selection","tag-group","tags"],"created_at":"2024-11-10T06:03:06.011Z","updated_at":"2025-04-23T09:33:13.209Z","avatar_url":"https://github.com/aJIEw.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## react-native-tag-group\n\n[![](https://img.shields.io/npm/v/react-native-tag-group)](https://www.npmjs.com/package/react-native-tag-group) [![](https://img.shields.io/npm/l/react-native-tag-group)](https://github.com/aJIEw/react-native-tag-group/blob/master/LICENSE)\n\nA simple Tag component that supports both single and multiple selection.\n\n\u003ca href=\"https://raw.githubusercontent.com/aJIEw/react-native-tag-group/master/assets/screenshot_ios.png\" target=\"_blank\"\u003e\u003cimg src='https://github.com/aJIEw/react-native-tag-group/blob/master/assets/screenshot_ios.png' width='30%'/\u003e\u003c/a\u003e\u003ca href=\"https://raw.githubusercontent.com/aJIEw/react-native-tag-group/master/assets/screenshot_android.png\" target=\"_blank\"\u003e\u003cimg src='https://github.com/aJIEw/react-native-tag-group/blob/master/assets/screenshot_android.png' width='30%'/\u003e\u003c/a\u003e\n\n## Get Started\n\n### Installation\n\n```sh\nnpm i react-native-tag-group --save\n```\n\n### TagGroup Usage\n\n```js\nimport TagGroup from 'react-native-tag-group';\n\n// ...\n\nrender() {\n  return (\n    \u003cTagGroup \n      ref={ref =\u003e this.tagGroup = ref}\n      source={['One', 'Two', 'Three']}\n      onSelectedTagChange={(selected) =\u003e { this.setState({selected}); }}\n    /\u003e\n  );\n}\n```\n\n### TagGroup Props\n\n| Props               | Type       | Description                                                  |\n| :------------------ | :---------------- | ------------------------------------------------------------ |\n| style               | View style | container's style                                            |\n| source              | array      | source array, usually a string array.                       |\n| singleChoiceMode    | bool       | only allow select one Tag at one time. Default `false`.     |\n| onSelectedTagChange | function   | callback after Tag(s) pressed, the parameter is a string array[], or (`stringValue`, `selectedIndex`) when set `singleChoiceMode` to true. |\n| tintColor | string | set the border color and background color when Tag is selected. |\n| tagStyle/activeTagStyle | View style | set the Tag's style before and after selected. |\n| textStyle/activeTextStyle | Text style | set the Tag's text style before and after selected. |\n| touchableOpacity | bool | use TouchableOpacity instead of TouchableWithoutFeedback. |\n\n### Methods\n\n#### select(index)\n\nSelect Tag at the index, this WON'T invoke `onSelectedTagChange` callback.\n\n#### unselect(index)\n\nUnselect Tag at the index, this WON'T invoke `onSelectedTagChange` callback.\n\n#### getSelectedIndex()\n\nGet the index array of the selected Tag(s), return -1 if no Tag is selected.\n\n### Tag Usage\n\n`Tag` can also be used as a simple button, for example:\n\n```js\nimport {Tag} from 'react-native-tag-group';\n\n// ...\n\n\u003cTag \n  text={'Button Text'}\n  tagStyle={styles.buttonContainer}\n  textStyle={styles.buttonText}\n  onPress={this.onTagPress}\n  touchableOpacity\n/\u003e\n\n// ...\n\nonTagPress = () =\u003e {\n console.log('Hello world!')\n}\n```\n\n### Tag Props\n\n| Props               | Type       | Description                                                  |\n| :------------------ | :---------------- | ------------------------------------------------------------ |\n| tintColor | string | Tag's border color, you can also cusotomize it with `tagStyle` prop. |\n| tagStyle | View style | Tag style. |\n| textStyle | Text style | Tag's text style. |\n| onPress | function | callback function when Tag is pressed. |\n| touchableOpacity | bool | use TouchableOpacity instead of TouchableWithoutFeedback. |\n\nFor more information please check the [example](https://github.com/aJIEw/react-native-tag-group/tree/master/example).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajiew%2Freact-native-tag-group","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajiew%2Freact-native-tag-group","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajiew%2Freact-native-tag-group/lists"}