Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/panthershark/form-utils

Elm library for generating forms from json objects
https://github.com/panthershark/form-utils

Last synced: about 2 months ago
JSON representation

Elm library for generating forms from json objects

Awesome Lists containing this project

README

        

# form-utils

Elm library for generating forms from json objects.

This library aims to supply form utility functions that can be mixed into applications without inhibiting UI flexibiklity or being overly prescriptive in how the large page or form is constructed.

The long term goal of this library is to provide is a set of view components and decoders for serializing forms over json. This is nice for doing things like deploying surveys.

Note: Currently, it relies on bulma for CSS. The plan is to replace or abstract this dependency.

### Elements

The library supports the following:

* TextField - can be rendered as either a clear text or password field
* RadioField - a single select field with choices. Supports an other option which allows free form input
* MultiSelectField - same as radio including other option, but allows multiple items to be selected.
* SelectField - a drop down list
* Slider - Works like a radio, but the user can move slider to pick an option. Currently, this is implemeted as a horizontal radio but the plan is to make it better.

### Text Validation

Validating free form test is accomplished with a validator with signature `String -> Result String String`. The validator is not only capable of determining valid or invalid, but it also allows valid values to be re-formatted.