{"id":15059465,"url":"https://github.com/hecrj/composable-form","last_synced_at":"2025-05-07T17:49:47.582Z","repository":{"id":41103071,"uuid":"129457128","full_name":"hecrj/composable-form","owner":"hecrj","description":"Build type-safe composable forms in Elm","archived":false,"fork":false,"pushed_at":"2022-08-21T22:31:35.000Z","size":869,"stargazers_count":198,"open_issues_count":11,"forks_count":20,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-31T12:39:00.783Z","etag":null,"topics":["composable","elm","form","form-validation","forms","type-safe"],"latest_commit_sha":null,"homepage":"http://package.elm-lang.org/packages/hecrj/composable-form/latest","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hecrj.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}},"created_at":"2018-04-13T21:52:27.000Z","updated_at":"2025-03-04T10:15:37.000Z","dependencies_parsed_at":"2022-09-09T02:32:16.923Z","dependency_job_id":null,"html_url":"https://github.com/hecrj/composable-form","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecrj%2Fcomposable-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecrj%2Fcomposable-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecrj%2Fcomposable-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hecrj%2Fcomposable-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hecrj","download_url":"https://codeload.github.com/hecrj/composable-form/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931386,"owners_count":21827104,"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":["composable","elm","form","form-validation","forms","type-safe"],"created_at":"2024-09-24T22:44:11.226Z","updated_at":"2025-05-07T17:49:47.563Z","avatar_url":"https://github.com/hecrj.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# composable-form [![Build Status](https://travis-ci.org/hecrj/composable-form.svg?branch=master)](https://travis-ci.org/hecrj/composable-form)\n\nThis package allows you to build forms that are\n\n  * **Composable**: they can be extended and embedded in other forms.\n  * **Type-safe**: everything is safely tied together with compiler guarantees.\n  * **Maintainable**: you do not need `view` code nor a `msg` for each form field.\n  * **Concise**: field validation and update logic are defined in a single place.\n  * **Consistent**: validation errors are always up-to-date with the current field values.\n  * **Extensible**: you can create your own custom fields and write custom view code.\n\nHere is an example that defines a login form:\n\n```elm\nmodule Form.Login exposing (Output, Values, form)\n\nimport EmailAddress exposing (EmailAddress)\nimport Form exposing (Form)\n\n\ntype alias Values =\n    { email : String\n    , password : String\n    , rememberMe : Bool\n    }\n\n\ntype alias Output =\n    { email : EmailAddress\n    , password : String\n    , rememberMe : Bool\n    }\n\n\nform : Form Values Output\nform =\n    let\n        emailField =\n            Form.emailField\n                { parser = EmailAddress.parse\n                , value = .email\n                , update = \\value values -\u003e { values | email = value }\n                , error = always Nothing\n                , attributes =\n                    { label = \"E-Mail\"\n                    , placeholder = \"some@email.com\"\n                    }\n                }\n\n        passwordField =\n            Form.passwordField\n                { parser = Ok\n                , value = .password\n                , update = \\value values -\u003e { values | password = value }\n                , error = always Nothing\n                , attributes =\n                    { label = \"Password\"\n                    , placeholder = \"Your password\"\n                    }\n                }\n\n        rememberMeCheckbox =\n            Form.checkboxField\n                { parser = Ok\n                , value = .rememberMe\n                , update = \\value values -\u003e { values | rememberMe = value }\n                , error = always Nothing\n                , attributes =\n                    { label = \"Remember me\" }\n                }\n    in\n    Form.succeed Output\n        |\u003e Form.append emailField\n        |\u003e Form.append passwordField\n        |\u003e Form.append rememberMeCheckbox\n```\n\nRead the [`Form` module documentation][form-docs] to understand how this code works.\n\n[form-docs]: http://package.elm-lang.org/packages/hecrj/composable-form/latest/Form\n[ellie-example]: https://ellie-app.com/3Q3ydLznQRra1\n\n## Demo / Examples\n\nTry out the [live demo](https://hecrj.github.io/composable-form) and/or\n[check out the examples](https://github.com/hecrj/composable-form/tree/master/examples/src/Page).\n\nAlso, feel free to play with the package using [this Ellie snippet][ellie-example].\n\n## Contributing / Feedback\n\nFeel free to fork and open issues or pull requests. You can also come to chat in\nthe #forms channel on the [Elm Slack][elm-slack], feel free to contact me (@hecrj) there!\n\n[elm-slack]: https://elmlang.herokuapp.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhecrj%2Fcomposable-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhecrj%2Fcomposable-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhecrj%2Fcomposable-form/lists"}