{"id":14962775,"url":"https://github.com/wetix/svelte-reactive-form","last_synced_at":"2026-03-12T17:04:24.020Z","repository":{"id":36974588,"uuid":"315222832","full_name":"wetix/svelte-reactive-form","owner":"wetix","description":"A better version of svelte form validation.","archived":false,"fork":false,"pushed_at":"2024-03-05T08:34:49.000Z","size":240,"stargazers_count":12,"open_issues_count":8,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-18T23:03:13.785Z","etag":null,"topics":["form","form-validation","reactive-form","svelte-form","svelte3","typescript","validation"],"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/wetix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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,"dei":null,"publiccode":null,"codemeta":null},"funding":null},"created_at":"2020-11-23T06:37:06.000Z","updated_at":"2025-01-17T05:56:34.000Z","dependencies_parsed_at":"2024-09-22T15:02:14.370Z","dependency_job_id":"538751a8-0349-42d6-a563-fbc78e860966","html_url":"https://github.com/wetix/svelte-reactive-form","commit_stats":{"total_commits":180,"total_committers":4,"mean_commits":45.0,"dds":0.1611111111111111,"last_synced_commit":"c6be4199f20e0e841871a3013a1166d878428e3f"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"purl":"pkg:github/wetix/svelte-reactive-form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wetix%2Fsvelte-reactive-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wetix%2Fsvelte-reactive-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wetix%2Fsvelte-reactive-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wetix%2Fsvelte-reactive-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wetix","download_url":"https://codeload.github.com/wetix/svelte-reactive-form/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wetix%2Fsvelte-reactive-form/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30434102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["form","form-validation","reactive-form","svelte-form","svelte3","typescript","validation"],"created_at":"2024-09-24T13:30:29.484Z","updated_at":"2026-03-12T17:04:23.986Z","avatar_url":"https://github.com/wetix.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Svelte Reactive Form\n\n\u003e A better version of form validation for [Svelte](https://svelte.dev).\n\n\u003cp\u003e\n\n[![Svelte v3](https://img.shields.io/badge/svelte-v3-orange.svg)](https://svelte.dev)\n[![npm](https://img.shields.io/npm/v/svelte-reactive-form.svg)](https://www.npmjs.com/package/svelte-reactive-form)\n[![Build Status](https://github.com/wetix/svelte-reactive-form/workflows/ci/badge.svg?branch=master)](https://github.com/wetix/svelte-reactive-form)\n[![download](https://img.shields.io/npm/dw/svelte-reactive-form.svg)](https://www.npmjs.com/package/svelte-reactive-form)\n[![Bundle Size](https://badgen.net/bundlephobia/minzip/svelte-reactive-form)](https://bundlephobia.com/result?p=svelte-reactive-form)\n[![LICENCE](https://img.shields.io/github/license/wetix/svelte-reactive-form)](https://github.com/wetix/svelte-reactive-form/blob/master/LICENSE)\n\n[![NPM Stat](https://nodei.co/npm/svelte-reactive-form.png)](https://www.npmjs.com/package/svelte-reactive-form)\n\n\u003c/p\u003e\n\n## Installation and Usage\n\n```console\nnpm install svelte-reactive-form\n```\n\nor\n\n```console\nyarn add svelte-reactive-form\n```\n\n## Features\n\n- Simple\n- No extra dependency\n- TypeScript as first class citizen\n- Custom validation\n- Reactive\n- Flexible \u0026 Configurable\n\n## How to use\n\n[https://svelte.dev/repl/2afb74650f36429fa15871b6998d60c9?version=3.31.0](https://svelte.dev/repl/2afb74650f36429fa15871b6998d60c9?version=3.30.0)\n\n```svelte\n\u003cscript lang=\"ts\"\u003e\n  import { useForm, Field, defineRule } from \"svelte-reactive-form\";\n  import { required, minLength } from \"@svelte-reactive-form/rules\";\n\n  // define the global validation rules\n  defineRule(\"required\", required);\n  defineRule(\"minLength\", minLength);\n  defineRule(\"numeric\", (val: any) =\u003e {\n    return /[0-9]+/.test(val) || \"invalid numeric format\";\n  });\n\n  // initialize the form instance\n  const form$ = useForm\u003c{ name: string; pin: string; description: string }\u003e();\n  const { field, register, setValue, control, onSubmit } = form$;\n\n  // you can register your field manually\n  register(\"pin\", {\n    defaultValue: \"\",\n    rules: [\"required\", \"minLength:4\", \"numeric\"]\n  });\n\n  const submitCallback = onSubmit((data, e) =\u003e {\n    console.log(\"Data =\u003e\", data);\n    console.log(\"Event =\u003e\", e);\n  }, (err, e) =\u003e {\n    console.log(\"Error =\u003e\", err);\n    console.log(\"Event =\u003e\", e);\n  });\n\u003c/script\u003e\n\n\u003cform on:submit={submitCallback}\u003e\n  \u003cField {control} name=\"name\" rules=\"required\" let:errors let:onChange\u003e\n    \u003cComponent {onChange} /\u003e\n    {#each errors as item}\n        \u003cdiv\u003e{item}\u003c/div\u003e\n    {/each}\n  \u003c/Field\u003e\n  \u003c!-- manually handle set value --\u003e\n  \u003cinput type=\"text\" on:input={(e) =\u003e setValue(\"pin\", e.target.value)} /\u003e\n  \u003c!-- register field using svelte actions --\u003e\n  \u003cinput name=\"description\" type=\"text\" use:field={{ rules: [\"required\"] }}\u003e\n  \u003cbutton disabled={!$form$.valid}\u003e\n    {#if $form$.submitting}Submit{:else}Submiting...{/if}\n  \u003c/button\u003e\n\u003c/form\u003e\n```\n\n## API\n\nCheck out the [API](https://github.com/wetix/svelte-reactive-form/blob/master/docs/API.md) documentation.\n\nFor advanced usage, you may refer to [Advanced API](https://github.com/wetix/svelte-reactive-form/blob/master/docs/ADVANCED_USAGE.md).\n\n## Sponsors\n\n\u003cimg src=\"https://asset.wetix.my/images/logo/wetix.png\" alt=\"WeTix\" width=\"240px\"\u003e\n\n## License\n\n[svelve-reactive-form](https://github.com/wetix/svelte-reactive-form) is 100% free and open-source, under the [MIT license](https://github.com/wetix/svelte-reactive-form/blob/master/LICENSE).\n\n## Big Thanks To\n\nThanks to these awesome companies for their support of Open Source developers ❤\n\n[![GitHub](https://jstools.dev/img/badges/github.svg)](https://github.com/open-source)\n[![NPM](https://jstools.dev/img/badges/npm.svg)](https://www.npmjs.com/)\n\nInspired by [react-hook-form](https://react-hook-form.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwetix%2Fsvelte-reactive-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwetix%2Fsvelte-reactive-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwetix%2Fsvelte-reactive-form/lists"}