{"id":15390913,"url":"https://github.com/natemoo-re/stencil-forms","last_synced_at":"2025-04-15T21:44:25.092Z","repository":{"id":34235315,"uuid":"166050834","full_name":"natemoo-re/stencil-forms","owner":"natemoo-re","description":"📝🤯 Stencil component to automatically manage form state","archived":false,"fork":false,"pushed_at":"2023-01-04T22:39:31.000Z","size":1123,"stargazers_count":14,"open_issues_count":19,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T12:45:42.565Z","etag":null,"topics":["form","forms","state-management","stencil","stenciljs"],"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/natemoo-re.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-16T14:08:57.000Z","updated_at":"2022-03-27T17:59:57.000Z","dependencies_parsed_at":"2023-01-15T05:29:12.446Z","dependency_job_id":null,"html_url":"https://github.com/natemoo-re/stencil-forms","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natemoo-re%2Fstencil-forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natemoo-re%2Fstencil-forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natemoo-re%2Fstencil-forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natemoo-re%2Fstencil-forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/natemoo-re","download_url":"https://codeload.github.com/natemoo-re/stencil-forms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240347765,"owners_count":19787231,"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":["form","forms","state-management","stencil","stenciljs"],"created_at":"2024-10-01T15:09:09.243Z","updated_at":"2025-02-28T17:31:09.143Z","avatar_url":"https://github.com/natemoo-re.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D\u0026colorA=16161d\u0026style=flat-square)\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"https://raw.githubusercontent.com/natemoo-re/stencil-forms/master/.github/assets/logo.svg?sanitize=true\" width=\"128\"\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eStencil Forms\u003c/h1\u003e\n\u003cp align=\"center\"\u003eStencil Forms is a tool for managing complex form state in \u003ca href=\"https://stenciljs.com\"\u003eStencil\u003c/a\u003e projects.\u003c/p\u003e\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n\u003e 🚨 This component is built for Stencil apps, not vanilla Web Component projects. It might be possible to use it in vanilla projects, but I wouldn't recommend it. 🚨\n\n`\u003cstencil-form /\u003e` is heavily inspired by [Formik](https://github.com/jaredpalmer/formik) and [react-beautiful-dnd](https://github.com/atlassian/react-beautiful-dnd) (both React-based solutions), except relying Web Components and standard, built-in browser features.\n\n## Example Usage\n\n```tsx\nimport { FormRenderProps } from \"stencil-form\";\ninterface FormValues {\n  demo: string;\n}\n\n// In the `your-component` render function\n\u003cstencil-form\n  initialValues={{ demo: \"Hello world!\" }}\n  renderer={(props: FormRenderProps\u003cFormValues\u003e) =\u003e {\n    const { errors, groupProps, labelProps, inputProps, formProps } = props;\n    return (\n      \u003cform {...formProps}\u003e\n        \u003cdiv {...groupProps(\"demo\")}\u003e\n          \u003clabel {...labelProps(\"demo\")}\u003e Demo \u003c/label\u003e\n          \u003cinput {...inputProps(\"demo\")} type=\"text\" required /\u003e\n          {errors.demo \u0026\u0026 (\n            \u003clabel class=\"error\" {...labelProps(\"demo\")}\u003e\n              {errors.demo}\n            \u003c/label\u003e\n          )}\n        \u003c/div\u003e\n      \u003c/form\u003e\n    );\n  }}\n/\u003e;\n```\n\n## Styling\n\nStyling is entirely up to you! The component provides minimal, mildly opinionated resets for `input` and `select` elements but stops short of removing things like `::-webkit-inner-spin-button` or `::-ms-clear`. If you'd like to ensure cross-browser consistency, I'd highly reccommend reading [TJ VanToll's pseudo-element list](https://www.tjvantoll.com/2013/04/15/list-of-pseudo-elements-to-style-form-controls/).\n\nIn order to allow maximum flexibility, `\u003cstencil-form /\u003e` does not use Shadow DOM. If the [`::part` and `::theme`](https://drafts.csswg.org/css-shadow-parts-1/) proposal is rolled out, that might change\u0026mdash;for now, Shadow DOM makes it too difficult for developers to implement custom styles.\n\n## Installation\n\nThis package in unpublished at the moment. It will be available on NPM soon.\n\nTo build locally, just clone this monorepo.\n\n```bash\nlerna bootstrap\ncd packages/demo\nnpm start\n```\n\n\u003c!-- ### Script tag\n\n- Put a script tag similar to this `\u003cscript src='https://unpkg.com/stencil-form@0.0.1/dist/stencil-form.js'\u003e\u003c/script\u003e` in the head of your index.html\n- Then you can use the element anywhere in your template, JSX, html etc\n\n### In a stencil-starter app\n- Run `npm install stencil-form --save`\n- Add an import to the npm packages `import 'stencil-form';` --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatemoo-re%2Fstencil-forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatemoo-re%2Fstencil-forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatemoo-re%2Fstencil-forms/lists"}