PetalComponents.Input (petal_components v3.0.0)
View SourceRenders pure inputs (no label or errors).
Summary
Functions
Attributes
id
(:any
) - Defaults tonil
.name
(:any
)label
(:string
)value
(:any
)type
(:string
) - Defaults to"text"
.size
(:string
) - the size of the switch. Defaults to"md"
.viewable
(:boolean
) - If true, adds a toggle to show/hide the password text. Defaults tofalse
.copyable
(:boolean
) - If true, adds a copy button to the field and disables the input. Defaults tofalse
.clearable
(:boolean
) - If true, adds a clear button to clear the field value. Defaults tofalse
.field
(Phoenix.HTML.FormField
) - a form field struct retrieved from the form, for example: @form[:email].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
.class
(:any
) - the class to add to the input. Defaults tonil
.- Global attributes are accepted. Supports all globals plus:
["autocomplete", "autocorrect", "autocapitalize", "disabled", "form", "max", "maxlength", "min", "minlength", "list", "pattern", "placeholder", "readonly", "required", "size", "step", "value", "name", "multiple", "prompt", "selected", "default", "year", "month", "day", "hour", "minute", "second", "builder", "options", "layout", "cols", "rows", "wrap", "checked", "accept"]
.
Functions
Attributes
id
(:any
) - Defaults tonil
.name
(:any
)label
(:string
)value
(:any
)type
(:string
) - Defaults to"text"
.size
(:string
) - the size of the switch. Defaults to"md"
.viewable
(:boolean
) - If true, adds a toggle to show/hide the password text. Defaults tofalse
.copyable
(:boolean
) - If true, adds a copy button to the field and disables the input. Defaults tofalse
.clearable
(:boolean
) - If true, adds a clear button to clear the field value. Defaults tofalse
.field
(Phoenix.HTML.FormField
) - a form field struct retrieved from the form, for example: @form[:email].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
.class
(:any
) - the class to add to the input. Defaults tonil
.- Global attributes are accepted. Supports all globals plus:
["autocomplete", "autocorrect", "autocapitalize", "disabled", "form", "max", "maxlength", "min", "minlength", "list", "pattern", "placeholder", "readonly", "required", "size", "step", "value", "name", "multiple", "prompt", "selected", "default", "year", "month", "day", "hour", "minute", "second", "builder", "options", "layout", "cols", "rows", "wrap", "checked", "accept"]
.