View Source Torch.Component (Torch v5.0.0-rc.3)
Provides Phoenix.Components for use in Torch views
Link to this section Summary
Functions
Renders generic error message
Renders an Torch form input with label and error messages.
Renders a label
Translates an error message using gettext.
Translates the errors for a field from a keyword list of errors.
Link to this section Functions
Renders generic error message
attributes
Attributes
for(:string) - Defaults tonil.
slots
Slots
inner_block(required)
Renders an Torch form input with label and error messages.
A %Phoenix.HTML.Form{} and field name may be passed to the input
to build input names and error messages, or all the attributes and
errors may be passed explicitly.
examples
Examples
<.torch_input field={@form[:email]} type="email" />
<.torch_input name="my-input" errors={["oh no!"]} />
attributes
Attributes
id(:any) - Defaults tonil.type(:string) - Defaults to"text".value(:any)name(:any)label(:string) - Defaults tonil.field(Phoenix.HTML.FormField) - a form field struct retrieved from the form, for example: @form[:email].errors(:list) - Defaults to[].checked(:boolean) - the checked flag for checkbox inputs.prompt(:string) - the prompt for select inputs. Defaults tonil.options(:list) - the options to pass to Phoenix.HTML.Form.options_for_select/2.multiple(:boolean) - the multiple flag for select inputs. Defaults tofalse. Global attributes are accepted.
slots
Slots
inner_block
Renders a label
attributes
Attributes
for(:string) - Defaults tonil.
slots
Slots
inner_block(required)
Translates an error message using gettext.
Translates the errors for a field from a keyword list of errors.