{"id":16009708,"url":"https://github.com/jackmerrill/astroforms","last_synced_at":"2025-03-17T16:30:27.887Z","repository":{"id":44370068,"uuid":"511371772","full_name":"jackmerrill/AstroForms","owner":"jackmerrill","description":"Forms in Astro made easy.","archived":false,"fork":false,"pushed_at":"2022-07-18T17:29:14.000Z","size":398,"stargazers_count":30,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T15:57:36.837Z","etag":null,"topics":["astro","json-forms","jsonforms","tailwindcss"],"latest_commit_sha":null,"homepage":"","language":"Astro","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/jackmerrill.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":"2022-07-07T03:39:10.000Z","updated_at":"2025-03-08T22:06:59.000Z","dependencies_parsed_at":"2022-09-26T21:21:58.795Z","dependency_job_id":null,"html_url":"https://github.com/jackmerrill/AstroForms","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmerrill%2FAstroForms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmerrill%2FAstroForms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmerrill%2FAstroForms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmerrill%2FAstroForms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackmerrill","download_url":"https://codeload.github.com/jackmerrill/AstroForms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243606822,"owners_count":20318312,"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":["astro","json-forms","jsonforms","tailwindcss"],"created_at":"2024-10-08T13:03:47.099Z","updated_at":"2025-03-17T16:30:27.450Z","avatar_url":"https://github.com/jackmerrill.png","language":"Astro","readme":"🚧 **Under Development** 🚧\n\nThis component is under construction! It does work, however, bugs may be present.\n\nPull requests are appreciated!\n\n# Astro Forms\n\nA Dynamic form component for Astro.\n\nUses a JSON schema to generate a form.\n\n## Themes\n\nThere are currently two themes available:\n\n- `default`\n- `tailwind` [(View README)](/packages/astro-forms/themes/tailwind/README.md)\n\n## Usage\n\n### Installation\n\n```bash\nyarn add astro-forms\n```\n\nor\n\n```bash\nnpm install astro-forms\n```\n\n### Setup\n\n```astro\n---\nimport { Form } from \"astro-forms\";\nconst schema = {\n  type: \"object\",\n  properties: {\n    name: {\n      type: \"string\",\n      title: \"Name\",\n    },\n    email: {\n      type: \"string\",\n      title: \"Email\",\n    },\n    password: {\n      type: \"string\",\n      title: \"Password\",\n    },\n    submit: {\n      type: \"submit\",\n      title: \"Submit\",\n    },\n  },\n}; // Or whatever you want it to be, must be an object.\n---\n\n\u003cForm schema={schema} action=\"/post\" method=\"post\" /\u003e\n```\n\n## Schema\n\nThe JSON schema for this form component has a single type that can repeat itself.\n\n```ts\nexport type InputType =\n  | \"string\"\n  | \"email\"\n  | \"password\"\n  | \"search\"\n  | \"url\"\n  | \"number\"\n  | \"boolean\"\n  | \"array\"\n  | \"object\"\n  | \"date\"\n  | \"submit\";\n\nexport interface FormSchema {\n  type: InputType;\n  title: string;\n  subtitle?: string;\n  properties: {\n    [key: string]: FormSchema;\n  };\n  items?: FormSchema;\n}\n```\n\nThese types may be updated and will be marked as a breaking change if done so.\n\nSchema example:\n\n```json\n{\n  \"type\": \"object\",\n  \"title\": \"Form\",\n  \"properties\": {\n    \"name\": {\n      \"type\": \"string\",\n      \"title\": \"Name\",\n      \"subtitle\": \"Alphanumeric characters only!!!!\"\n    },\n    \"email\": {\n      \"type\": \"string\",\n      \"title\": \"Email\",\n      \"subtitle\": \"Don't worry, we'll spam you every day!\"\n    },\n    \"password\": {\n      \"type\": \"password\",\n      \"title\": \"Password\",\n      \"subtitle\": \"We didn't invest much into security, choose wisely.\"\n    },\n    \"personalInfo\": {\n      \"type\": \"object\",\n      \"title\": \"Personal Info\",\n      \"properties\": {\n        \"age\": {\n          \"type\": \"number\",\n          \"title\": \"Age\",\n          \"subtitle\": \"How old are you?\"\n        },\n        \"birthday\": {\n          \"type\": \"date\",\n          \"title\": \"Birthday\",\n          \"subtitle\": \"So we can send you a cake, duh.\"\n        },\n        \"misc\": {\n          \"type\": \"object\",\n          \"title\": \"Misc. Stuff\",\n          \"properties\": {\n            \"isScary\": {\n              \"type\": \"boolean\",\n              \"title\": \"Sus?\",\n              \"subtitle\": \"Are you known by the FBI, CIA, or any governmental body?\"\n            }\n          }\n        },\n        \"acceptsTerms\": {\n          \"type\": \"boolean\",\n          \"title\": \"Accept Terms of Service\",\n          \"subtitle\": \"We're not responsible for your actions.\"\n        }\n      }\n    },\n    \"submit\": {\n      \"type\": \"submit\",\n      \"title\": \"Submit\"\n    }\n  }\n}\n```\n\nInput names are tokenized and have a `.` delimiter, so they can be used with HTML forms with ease.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackmerrill%2Fastroforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackmerrill%2Fastroforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackmerrill%2Fastroforms/lists"}