{"id":13452049,"url":"https://github.com/peterp/react-native-tags","last_synced_at":"2025-03-23T19:33:30.369Z","repository":{"id":11092438,"uuid":"68322117","full_name":"peterp/react-native-tags","owner":"peterp","description":"Tag input component for React Native","archived":true,"fork":false,"pushed_at":"2023-03-05T11:47:25.000Z","size":2063,"stargazers_count":287,"open_issues_count":20,"forks_count":74,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-16T00:02:07.273Z","etag":null,"topics":["react-native","tags"],"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/peterp.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-09-15T18:52:11.000Z","updated_at":"2025-02-11T15:48:49.000Z","dependencies_parsed_at":"2024-01-16T03:46:14.703Z","dependency_job_id":"dec70950-ccb6-454a-9e7c-23c456626860","html_url":"https://github.com/peterp/react-native-tags","commit_stats":{"total_commits":87,"total_committers":7,"mean_commits":"12.428571428571429","dds":"0.25287356321839083","last_synced_commit":"268e83b19851f372f3344f834d0f04a6a979504e"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterp%2Freact-native-tags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterp%2Freact-native-tags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterp%2Freact-native-tags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterp%2Freact-native-tags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterp","download_url":"https://codeload.github.com/peterp/react-native-tags/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245158930,"owners_count":20570289,"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":["react-native","tags"],"created_at":"2024-07-31T07:01:11.260Z","updated_at":"2025-03-23T19:33:29.886Z","avatar_url":"https://github.com/peterp.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# React-Native-Tags\n\n[![Build Status](https://travis-ci.org/peterp/react-native-tags.svg?branch=master)](https://travis-ci.org/peterp/react-native-tags)\n[![npm](https://img.shields.io/npm/dt/express.svg)](https://www.npmjs.com/package/react-native-tags)\n[![npm version](https://badge.fury.io/js/react-native-tags.svg)](https://badge.fury.io/js/react-native-tags)\n\nA React Native component that allows you to input text and formats the text\ninto a tag when a space or comma is entered. Tapping on the tag will remove it.\n\n![Demo](https://camo.githubusercontent.com/e3d6f3f87e625ad787bda1e7b518307d29d21a23/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f6c34394a5036786c6847723138795a46652f67697068792e676966)\n\n## Installation\n\n```terminal\nnpm install --save react-native-tags\n```\n\n```terminal\nyarn add react-native-tags\n```\n\n## Usage\n\n```jsx\nimport React from \"react\";\nimport { TouchableOpacity, Text } from \"react-native\";\nimport Tags from \"react-native-tags\";\n\nconst MyTagInput = () =\u003e (\n  \u003cTags\n    initialText=\"monkey\"\n    textInputProps={{\n      placeholder: \"Any type of animal\"\n    }}\n    initialTags={[\"dog\", \"cat\", \"chicken\"]}\n    onChangeTags={tags =\u003e console.log(tags)}\n    onTagPress={(index, tagLabel, event, deleted) =\u003e\n      console.log(index, tagLabel, event, deleted ? \"deleted\" : \"not deleted\")\n    }\n    containerStyle={{ justifyContent: \"center\" }}\n    inputStyle={{ backgroundColor: \"white\" }}\n    renderTag={({ tag, index, onPress, deleteTagOnPress, readonly }) =\u003e (\n      \u003cTouchableOpacity key={`${tag}-${index}`} onPress={onPress}\u003e\n        \u003cText\u003e{tag}\u003c/Text\u003e\n      \u003c/TouchableOpacity\u003e\n    )}\n  /\u003e\n);\n```\n\n## Render Props\n\n### `renderTag`\n\nIf you would like to add new functionality or modify the way that the tags are\nrendered then pass in a renderTag prop.\n\n| PropName | Description                                                  |\n| -------- | ------------------------------------------------------------ |\n| tag      | text of the tag                                              |\n| index    | position in the array of tags                                |\n| onPress  | Removes the tag if `deleteTagsOnPress` and readonly is false |\n\n## Props\n\n| PropName          | Description                                                                                    | Default         |\n| ----------------- | ---------------------------------------------------------------------------------------------- | --------------- |\n| initialText       | The input element's text                                                                       |                 |\n| textInputProps    | [forward props to the textInput](https://facebook.github.io/react-native/docs/textinput#props) |                 |\n| initialTags       | ['the', 'initial', 'tags']                                                                     |                 |\n| createTagOnString | Triggers new tag creation                                                                      | [\",\", \".\", \" \"] |\n| onChangeTags      | Fires when tags are added or removed                                                           |                 |\n| maxNumberOfTags   | The max number of tags that can be entered                                                     | infinity        |\n| onTagPress        | Fires when tags are pressed                                                                    |                 |\n| readonly          | Tags cannot be modified                                                                        | false           |\n| deleteTagOnPress  | Remove the tag when pressed                                                                    | true            |\n| renderTag         | Manage the rendering of your own `Tag`                                                         |                 |\n\n## Style modification props\n\n| PropName            | Description                    | Default |\n| ------------------- | ------------------------------ | ------- |\n| style               | Style (`containerStyle` alias) |         |\n| containerStyle      | Style                          |         |\n| inputContainerStyle | Style                          |         |\n| inputStyle          | Style                          |         |\n| tagContainerStyle   | Style                          |         |\n| tagTextStyle        | Style                          |         |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterp%2Freact-native-tags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterp%2Freact-native-tags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterp%2Freact-native-tags/lists"}