{"id":19559087,"url":"https://github.com/dijs/validated-input","last_synced_at":"2025-02-26T08:22:45.693Z","repository":{"id":57390299,"uuid":"167679238","full_name":"dijs/validated-input","owner":"dijs","description":"Input validation made easy","archived":false,"fork":false,"pushed_at":"2019-01-28T18:30:57.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-08T22:10:27.813Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dijs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-26T11:03:53.000Z","updated_at":"2019-01-28T18:30:58.000Z","dependencies_parsed_at":"2022-09-12T22:44:16.933Z","dependency_job_id":null,"html_url":"https://github.com/dijs/validated-input","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dijs%2Fvalidated-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dijs%2Fvalidated-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dijs%2Fvalidated-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dijs%2Fvalidated-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dijs","download_url":"https://codeload.github.com/dijs/validated-input/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240815945,"owners_count":19862178,"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":[],"created_at":"2024-11-11T04:50:01.219Z","updated_at":"2025-02-26T08:22:45.650Z","avatar_url":"https://github.com/dijs.png","language":"JavaScript","readme":"[![NPM Version](https://img.shields.io/npm/v/validated-input.svg)](https://www.npmjs.com/package/validated-input)\n[![Build Status](https://travis-ci.org/dijs/validated-input.svg)](https://travis-ci.org/dijs/validated-input)\n[![Coverage Status](https://coveralls.io/repos/dijs/validated-input/badge.svg)](https://coveralls.io/r/dijs/validated-input)\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=richard%2evanderdys%40gmail%2ecom\u0026lc=US\u0026item_name=ValidatedInput\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)\n\n# ValidatedInput\n\nA React Component which makes input validation really easy.\n\n## Install\n\n```bash\nnpm install --save validated-input\n```\n\n[![validated-input](https://nodei.co/npm/validated-input.png)](https://npmjs.org/package/validated-input)\n\n## Usage\n\nAll props are mapped to an input, so just treat the component like a regular input element.\n\nYou will need to tell the component how to `validate` the given value. To make this easy, we have\nproxied all the validation methods from the amazing [validator](https://www.npmjs.com/package/validator) module.\n\nHere is a couple examples:\n\n````js\nimport React from 'react';\nimport ValidatedInput from 'validated-input';\n\nexport default function FormExample({ phone, updatePhone, email, updateEmail }) {\n  return \u003cdiv className=\"form\"\u003e\n    \u003cValidatedInput\n      validate={v =\u003e v.isMobilePhone('en-US')}\n      type=\"tel\"\n      placeholder=\"Phone Number\"\n      value={phone}\n      onChange={e =\u003e updatePhone(e.target.value)}\n    /\u003e\n    \u003cValidatedInput\n      validate={v =\u003e v.isEmail()}\n      type=\"email\"\n      placeholder=\"Email Address\"\n      value={email}\n      onChange={e =\u003e updateEmail(e.target.value)}\n      required\n    /\u003e\n  \u003c/div\u003e\n};\n`````\n\n## Props for `ValidatedInput`\n\nAll other props are automatically mapped to the inner input element.\n\n| Name         | Type    | Default | Description |\n| ------------ | ------- | ------- | ----------- |\n| validate | Function | `validator =\u003e true` | A function to validate the current value |\n| containerClassName | String | `validation-container` | class of input container div |\n| errorClassName | String | `error` | class for error |\n","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=richard%2evanderdys%40gmail%2ecom\u0026lc=US\u0026item_name=ValidatedInput\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdijs%2Fvalidated-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdijs%2Fvalidated-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdijs%2Fvalidated-input/lists"}