{"id":18369820,"url":"https://github.com/cawfree/react-native-segmented-text-input","last_synced_at":"2025-07-22T23:33:05.619Z","repository":{"id":38865142,"uuid":"280548368","full_name":"cawfree/react-native-segmented-text-input","owner":"cawfree","description":"A wickedly customizable \u003cTextInput /\u003e for React Native. Useful for tags, spellchecking, whatever.","archived":false,"fork":false,"pushed_at":"2023-01-06T11:48:30.000Z","size":1953,"stargazers_count":140,"open_issues_count":29,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-04T04:09:16.893Z","etag":null,"topics":["highlighter","input","mention","react-native","regexp","tag","twitter"],"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/cawfree.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-07-18T00:04:46.000Z","updated_at":"2024-12-31T21:45:21.000Z","dependencies_parsed_at":"2023-02-06T00:30:38.674Z","dependency_job_id":null,"html_url":"https://github.com/cawfree/react-native-segmented-text-input","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cawfree/react-native-segmented-text-input","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-native-segmented-text-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-native-segmented-text-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-native-segmented-text-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-native-segmented-text-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cawfree","download_url":"https://codeload.github.com/cawfree/react-native-segmented-text-input/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Freact-native-segmented-text-input/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266590535,"owners_count":23952955,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["highlighter","input","mention","react-native","regexp","tag","twitter"],"created_at":"2024-11-05T23:32:21.070Z","updated_at":"2025-07-22T23:33:05.583Z","avatar_url":"https://github.com/cawfree.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-segmented-text-input\nA wickedly customizable \u0026lt;TextInput /\u003e for React Native. Useful for tags, spellchecking, whatever.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./public/logo.gif\" /\u003e\n\u003c/p\u003e\n\n## 🚀 Getting Started\n\nUsing [npm](https://www.npmjs.com/):\n\n```bash\nnpm install --save react-native-segmented-text-input\n```\n\n## ✍️ Usage\n\n```javascript\nimport SegmentedTextInput from \"react-native-segmented-text-input\";\n\nexport default () =\u003e {\n  const [value, onChange] = useState(['', []]);\n  return (\n    \u003cSegmentedTextInput\n      value={value}\n      onChange={onChange}\n    /\u003e\n  );\n};\n```\n\nTo initialize the view, you can supply the input text and corresponding pattern:\n\n```javascript\nimport { PATTERN_MENTION } from \"react-native-segmented-text-input\";\nconst [value, onChange] = useState(['', [[\"@cawfree\", PATTERN_MENTION]]]);\n```\n\n## 🤔 Prop Types\n\n| Prop Name               | Type Struc                                                                     | Required | Default                                      | Description                                                                                                                     |\n|-------------------------|--------------------------------------------------------------------------------|----------|----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|\n| value                   | [string, [string, matchingRegExp]]                                             | false    | ['', []]                                     | The current state of the input. Array of the string being typed, and array of previous regexp matches relating to match string. |\n| onChange                | ([string, [[string, matchingRegExp]]) =\u003e undefined                             | false    | Promise.resolve                              | Called when the segments or input text has changed.                                                                             |\n| patterns                | {[regExpString]: React.ElementType, ...}                                       | false    | {[\"(^\\|\\s)@[a-z\\d-]+\"] =\u003e Mention            | Maps a to a React component to render them. Is passed an onRequestDelete prop used to delete the segment.                       |\n| placeholder             | string                                                                         | false    | \"Add some @mentions...\"                      | Placeholder for the text input.                                                                                                 |\n| disabled                | boolean                                                                        | false    | false                                        | Prevent the user from typing.                                                                                                   |\n| textStyle               | styles                                                                         | false    | {fontSize: 28}                               | Style the text. (Inherited for both Text and InputText).                                                                        |\n| textInputStyle          | styles                                                                         | false    | {}                                           | Specific additional styling for the TextInput.                                                                                  |\n| invalidTextStyle        | styles                                                                         | false    | {color: \"red\"}                               | Specific additional styling for the TextInput when in error.                                                                    |\n| segmentContainerStyle        | styles                                                                         | false    | {}                               | Additional styling for segment container.                                                                    |\n| suggestionsContainerStyle        | styles                                                                         | false    | {}                               | Styling to apply to the container of the Suggestions.                                                                    |\n| shouldRenderInvalid     | currentTextString =\u003e boolean                                                   | false    | str =\u003e !str.startsWith(\"@\")                  | Determines whether a particular string should be rendered using invalidTextStyle.                                               |\n| max                     | number                                                                         | false    | 3                                            | Maximum number of segments.                                                                                                     |\n| onSuggest               | currentTextString =\u003e Promise([any])                                              | false    | Promise.resolve([])                          | A call which is made when the user is mid-typing. The string is passed to ask the parent to provide possible suggestions.       |\n| minSuggestionLength     | number                                                                         | false    | 2                                            | The minimum number of characters a user should have typed before attempting to make a suggestion.                               |\n| debounce                | number                                                                         | false    | 250                                          | The number of milliseconds to throttle attempts at querying for a suggestion.                                                   |\n| renderSuggestions       | ({suggestions:[any], pickSuggestion: () =\u003e undefined, loadingSuggestions: boolean}) =\u003e \u003cSomeReactComponent /\u003e | false    | () =\u003e \u003cBunchOfSuggestionsThatCanBeDeleted /\u003e | Used to render suggestions. This function must understand the specific format of returned suggestion data.                      |\n\n## ✌️ Licence\n[**MIT**](./LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcawfree%2Freact-native-segmented-text-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcawfree%2Freact-native-segmented-text-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcawfree%2Freact-native-segmented-text-input/lists"}