View Source ZoonkWeb.Components.Form (Zoonk v0.2.0-alpha)
Form components.
Link to this section Summary
Functions
Renders a simple form.
Link to this section Functions
Renders a simple form.
examples
Examples
<.simple_form for={@form} phx-change="validate" phx-submit="save">
<.input field={@form[:email]} label="Email"/>
<.input field={@form[:username]} label="Username" />
<:actions>
<.button>Save</.button>
</:actions>
</.simple_form>
attributes
Attributes
for
(:any
) (required) - the datastructure for the form.as
(:any
) - the server side parameter to collect all input under. Defaults tonil
.title
(:string
) - the form title displayed before the form. Defaults tonil
.subtitle
(:string
) - the form subtitle displayed before the form. Defaults tonil
.class
(:string
) - the form class. Defaults tonil
.- Global attributes are accepted.
slots
Slots
inner_block
(required)actions
- the slot for form actions, such as a submit button.