Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/panthershark/form-utils
- Owner: panthershark
- License: bsd-3-clause
- Created: 2019-12-18T04:16:04.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-13T02:43:40.000Z (almost 3 years ago)
- Last Synced: 2024-04-15T14:27:04.178Z (9 months ago)
- Language: Elm
- Size: 104 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.