dillonkearns / elm-form

Standalone version of the elm-pages Form API.
Other
19 stars 6 forks source link

dillonkearns/elm-form Build Status

Live Ellie demo: https://ellie-app.com/mzjFg6BWmMta1

elm-form is built around the idea of managing a single Form.Model value as an unparsed set of raw field values and FieldStatus (blurred, changed, etc.). This Form.Model can even handle form state of more than one form on a page, or even across multiple pages. The package manages all of the unparsed state for you with a single Msg, a single Model entry, and then uses your Form definition to run its validations against the unparsed values (Model), and to render the form fields along with any validation errors.

If you use elm-form with elm-pages, the wiring is built into the framework so you don't need to wire in update or Model yourself, and the framework manages additional Form state for you such as in-flight form submissions. The ideas in this package originally came from elm-pages, but they are useful in a standalone context as well so this was split into a separate package.

Some of these underlying ideas were discussed in the Elm Radio episode Exploring a New Form API Design.

Core Values

Core Ideas

Opinions