{"id":18333127,"url":"https://github.com/candycoded/forms","last_synced_at":"2026-03-10T04:33:51.504Z","repository":{"id":54964996,"uuid":"278490553","full_name":"CandyCoded/Forms","owner":"CandyCoded","description":"📄 Components used to simplify the handling of form inputs in Unity.","archived":false,"fork":false,"pushed_at":"2023-12-04T03:23:57.000Z","size":106,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T16:58:25.634Z","etag":null,"topics":["forms","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","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/CandyCoded.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2020-07-09T23:13:47.000Z","updated_at":"2023-08-16T15:19:31.000Z","dependencies_parsed_at":"2024-11-05T20:06:28.189Z","dependency_job_id":null,"html_url":"https://github.com/CandyCoded/Forms","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CandyCoded%2FForms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CandyCoded%2FForms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CandyCoded%2FForms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CandyCoded%2FForms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CandyCoded","download_url":"https://codeload.github.com/CandyCoded/Forms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430838,"owners_count":20937873,"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":["forms","unity"],"created_at":"2024-11-05T19:41:23.442Z","updated_at":"2026-03-10T04:33:51.468Z","avatar_url":"https://github.com/CandyCoded.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Forms\n\n\u003e Components used to simplify the handling of form inputs in Unity.\n\n[![npm](https://img.shields.io/npm/v/xyz.candycoded.forms)](https://www.npmjs.com/package/xyz.candycoded.form)\n\n## Installation\n\n### Unity Package Manager\n\n\u003chttps://docs.unity3d.com/Packages/com.unity.package-manager-ui@2.0/manual/index.html\u003e\n\n#### Git\n\n```json\n{\n  \"dependencies\": {\n    \"xyz.candycoded.forms\": \"https://github.com/CandyCoded/Forms.git#v3.1.0\",\n    ...\n  }\n}\n```\n\n#### Scoped UPM Registry\n\n```json\n{\n  \"dependencies\": {\n    \"xyz.candycoded.forms\": \"3.1.0\",\n    ...\n  },\n  \"scopedRegistries\": [\n    {\n      \"name\": \"candycoded\",\n      \"url\": \"https://registry.npmjs.com\",\n      \"scopes\": [\"xyz.candycoded\"]\n    }\n  ]\n}\n```\n\n## Usage\n\nFirst create a class with the same field names (and data types) as the form.\n\n```csharp\npublic class Profile\n{\n    public bool active;\n    public string firstName;\n    public string lastName;\n    public int age;\n}\n```\n\nAdd a `Form` property to a MonoBehaviour for storing a reference to the `Form` component.\n\n```csharp\n[SerializeField]\nprivate Form _form;\n```\n\nPopulate the fields with exisiting values (if applicable).\n\n```csharp\npublic void Start()\n{\n\n    _form.LoadFormValues(new Profile\n    {\n        active = true,\n        firstName = \"Scott\",\n        lastName = \"Doxey\",\n        age = 36\n    });\n\n}\n```\n\nData can also be loaded via a JSON `string` object.\n\n```csharp\npublic void Start()\n{\n\n    _form.LoadFromJSON\u003cProfile\u003e(jsonString);\n\n}\n```\n\nData can also be loaded via a `Dictionary\u003cstring, object\u003e` object.\n\n```csharp\npublic void Start()\n{\n\n    _form.LoadFormRawValues(new Dictionary\u003cstring, object\u003e\n      {\n          { \"active\", true },\n          { \"firstName\", \"Scott\" },\n          { \"lastName\", \"Doxey\" },\n          { \"age\", 36 },\n      });\n\n}\n```\n\nCreate a submit event handler that takes `Dictionary\u003cstring, object\u003e` as it's only property.\n\n```csharp\npublic void SubmitFormObject(Dictionary\u003cstring, object\u003e formRawValues)\n{\n\n    Debug.Log(formRawValues);\n    Debug.Log(JsonConvert.SerializeObject(formRawValues));\n\n}\n```\n\nOr a submit event handler that takes `string` as it's only property.\n\n```csharp\npublic void SubmitFormJSON(string json)\n{\n\n    Debug.Log(json);\n\n}\n```\n\nAttach that method to the form submitted event handler on the `Form` component (see screenshot below).\n\n**Note:** A button can also be assigned to the form as the primary submit button (also see screenshot below).\n\n\u003cimg src=\"Screenshots/submit-form.png\" width=\"400\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandycoded%2Fforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcandycoded%2Fforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandycoded%2Fforms/lists"}