{"id":25177510,"url":"https://github.com/jazibjafri/inputs-react-native","last_synced_at":"2025-08-22T05:41:42.449Z","repository":{"id":38868885,"uuid":"276922728","full_name":"jazibjafri/inputs-react-native","owner":"jazibjafri","description":"Inputs for react native with easy built-in validations.","archived":false,"fork":false,"pushed_at":"2023-01-06T10:33:46.000Z","size":1104,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T15:42:46.033Z","etag":null,"topics":["hacktoberfest","inputs","react-native","typescript","validations"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jazibjafri.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-03T14:45:41.000Z","updated_at":"2021-10-03T19:26:00.000Z","dependencies_parsed_at":"2023-02-05T21:46:29.661Z","dependency_job_id":null,"html_url":"https://github.com/jazibjafri/inputs-react-native","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazibjafri%2Finputs-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazibjafri%2Finputs-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazibjafri%2Finputs-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazibjafri%2Finputs-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jazibjafri","download_url":"https://codeload.github.com/jazibjafri/inputs-react-native/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247112739,"owners_count":20885605,"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":["hacktoberfest","inputs","react-native","typescript","validations"],"created_at":"2025-02-09T14:25:39.242Z","updated_at":"2025-04-04T02:40:36.883Z","avatar_url":"https://github.com/jazibjafri.png","language":"TypeScript","readme":"# Inputs React Native\nInputs for react native with easy built-in validations.\n\n\u003e **For a complete example, see below**\n\n## Installation\n\n```\nnpm install inputs-react-native\n```\n\n## Basic Usage\n\n```js\nimport TextInput from 'inputs-react-native'\n\nconst Component = () =\u003e {\n  \u003c\u003e\n      \u003cTextInput validators={['basic', 'email']} /\u003e\n  \u003c/\u003e\n}\n\n```\n\nAnd that's it! Your text input is now complete with email validation.\n\n\u003cimg src=\"img/example-1.png\" width=\"250\"\u003e\n\n## All Accepted Props\n\nIn addition to all props accepted by `TextInput` from `react-native`, following props are accepted:\n\nProperty name | Type | Values | Default | Description\n--- | --- | --- | --- | --- |\n`onChangeText` | optional | `(val: string, error: boolean) =\u003e void` | `undefined` | returns input text and error status\n`validators` | optional | `Array\u003c'basic' \\| 'email \\| 'password' \\| 'phone'\u003e` | `[]` | validations to apply.\n`validateOn` | optional | `start-editing`, `end-editing`, `never` | `end-editing` | when to run validation\n`errorMessage` | optional | `any` | (separate defaults for each validation type) | custom error message to display when validation fails\n`errorViewStyles` | optional | `ViewStyle` | (some basic styles) | styles for view component of error message\n`errorTextStyles` | optional | `TextStyle` | (some basic styles) | styles for text component of error message\n\nAll other props are passed down to react-native's `TextInput`\n\n## Example\n\n```js\nimport React, { useState } from 'react';\nimport { StyleSheet } from 'react-native';\nimport TextInput from 'inputs-react-native';\n\nconst Input = () =\u003e {\n    const [email, setEmail] = useState('');\n    \n    const handleOnChange = (val, err) =\u003e {\n        if(err) {\n            // handle error\n        }\n        //handle change\n        setEmail(val);\n    }\n  \n    return (\n        \u003cTextInput\n            validators={['basic', 'email']}\n            onChangeText={(val, err) =\u003e handleOnChange(val, err)}\n            value={email}\n            validateOn=\"start-editing\"\n            errorMessage=\"Invalid email format\"\n            errorViewStyles={styles.errorViewStyles}\n            errorTextStyles={styles.errorTextStyles}\n        /\u003e\n    );\n}\n\nconst styles = StyleSheet.create({\n  errorTextStyles: {\n    color: 'red',\n  },\n  errorViewStyles: {\n    borderColor: 'red',\n    borderWidth: 2,\n  },\n});\n```\n\u003cimg src=\"img/example-2.png\" width=\"250\"\u003e\n\n## License\n\n[MIT](https://github.com/JazibJafri/inputs-react-native/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazibjafri%2Finputs-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjazibjafri%2Finputs-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazibjafri%2Finputs-react-native/lists"}