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't be blank</div>
</div>
Summary
Functions
Render a checkbox with label
Render text input using bootstrap tags
Render a submit button
Render textarea input using bootstrap tags
Functions
checkbox(form, field, label \\ false, opts \\ [])
checkbox(Phoenix.HTML.Form.t, Atom.t, String.t, List.t) :: {:safe, String.t}
Render a checkbox with label
input(form, field, label, opts)
input(Phoenix.HTML.Form.t, Atom.t, String.t, List.t) :: {:safe, String.t}
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
textarea(form, field, label \\ false, opts \\ [])
textarea(Phoenix.HTML.Form.t, Atom.t, String.t, List.t) :: {:safe, String.t}
Render textarea input using bootstrap tags