bootform v0.1.2 Bootform

Bootform is inspired by simple_form from rails and allow an easier way to render form using bootstrap 4 semantic.

input form, :email, "Your email", type: :email

will render

<div class="form-group has-danger">
    <label for="helloEmail">Your email</label>
    <input class="form-control" id="helloEmail" name="hello[email]" type="text">
    <div class="form-control-feedback">can&#39;t be blank</div>
</div>

Summary

Functions

Render text input using bootstrap tags

Render a submit button

Render textarea input using bootstrap tags

Functions

checkbox(form, field, label \\ false, opts \\ [])

Render a checkbox with label

input(form, field)
input(form, field, opts)
input(form, field, label, opts)

Render text input using bootstrap tags

Examples

You can use it this way

input form, :email, "Your email", type: :email

You can ommit label and options

input form, :email
submit(label)
submit(String.t) :: {:safe, String.t}

Render a submit button

textarea(form, field, label \\ false, opts \\ [])

Render textarea input using bootstrap tags