{"id":18386481,"url":"https://github.com/stemmlerjs/react-joi-forms","last_synced_at":"2025-04-12T02:09:35.311Z","repository":{"id":107362603,"uuid":"186718232","full_name":"stemmlerjs/react-joi-forms","owner":"stemmlerjs","description":"Model-based React form validation with Joi","archived":false,"fork":false,"pushed_at":"2019-05-15T00:12:37.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T02:09:31.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/stemmlerjs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-15T00:05:23.000Z","updated_at":"2022-03-27T22:51:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"f27d79de-5981-414f-86b4-b56a7b5bf6d2","html_url":"https://github.com/stemmlerjs/react-joi-forms","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/stemmlerjs%2Freact-joi-forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stemmlerjs%2Freact-joi-forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stemmlerjs%2Freact-joi-forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stemmlerjs%2Freact-joi-forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stemmlerjs","download_url":"https://codeload.github.com/stemmlerjs/react-joi-forms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505931,"owners_count":21115354,"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-06T01:22:12.444Z","updated_at":"2025-04-12T02:09:35.289Z","avatar_url":"https://github.com/stemmlerjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Form Validation\n\n\u003e A way to do clean form validation and validate an entire model or attributes on that model! This small lib is currently how I do form validation onBlur and onChange with React + Redux applications.\n\n_This isn't quite ready yet! Just FYI, but feel free to have a peek_\n\n## Creating a new form!\n\nYou can create a new form by using the Form class like this:\n\n```typescript\nlet form = new Form([\n  { fieldName: 'jobTitle', validator: Joi.string().min(2).max(60).required(), type: ValidatorType.JOI },\n  { fieldName: 'isPayingJob', validator: Joi.bool().required(), type: ValidatorType.JOI },\n  { fieldName: 'paidJobDetails', validator: paidJobDetailsValidator, type: ValidatorType.CUSTOM },\n])\n```\n\nA form takes in an array of ```Field``` objects like so!\n\n## Usage\n\n+ Form\n  + validateForm (formData: any) : boolean\n  + validateFormField (field: string, value: any) : boolean\n\nThese are the two most important methods on the form class. With this, we can validate the entire form, \nor we can just validate a specific form field.\n\n### Validator Types\n\nWe have two types of validators.\n\n1. JOI validator\n2. Custom validator\n\n#### Joi Validator\n\nTo validate a field using the Joi Validator, create a Joi validation chain on the ```validator``` key for the field.\n\n#### Custom Validator\n\nWe can also create our own custom validator. Custom validators need to implement the ```ICustomValidator``` interface.# react-joi-forms\n\n## Example\n\nComing soon","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstemmlerjs%2Freact-joi-forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstemmlerjs%2Freact-joi-forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstemmlerjs%2Freact-joi-forms/lists"}