erikvullings / mithril-ui-form

Convert a (JSON) object to a dynamic (materialize-css) form.

Home Page:https://erikvullings.github.io/mithril-ui-form

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mithril-ui-form

A component for the Mithril framework, which allows you to convert an object (or JSON file) to a dynamic form.

When dealing with complex forms, I noticed that I often needed to implement the same logic and code, over and over again. Therefore, I looked for an approach to avoid repeating code (and making similar mistakes), and this library was born. It allows you to create dynamic forms based on a JSON object as input. The JSON file is converted to a materialized-css form. The entered data is returned as an object.

The form supports markdown input, repeating elements, and conditionally displaying certain elements. For an example of a project implementing this approach, have a look here. It is a small project consisting of an in-memory database (lokijs), a REST interface (rest-easy-loki), and a dynamic form to enter lesson's learned. As the form is dynamic, it is easy to tune it into a specific one more appropriate to your customer's needs.

Installation

npm i -S mithril-ui-form

Development

npm i
npm start

Deployment to GitHub pages (via the doc folder)

npm run build:domain

About

Convert a (JSON) object to a dynamic (materialize-css) form.

https://erikvullings.github.io/mithril-ui-form

License:MIT License


Languages

Language:TypeScript 95.6%Language:JavaScript 3.8%Language:CSS 0.6%