DaisyUIComponents.Input (DaisyUIComponents v0.8.6)

View Source

Generic Input component

Summary

Functions

Renders a generic input based on type.

Functions

input(assigns)

Renders a generic input based on type.

Examples

<.input type="email" />
<.input name="my-input" type="checkbox" value="false" />

Attributes

  • id (:any) - Defaults to nil.
  • name (:any)
  • label (:string)
  • value (:any)
  • type (:string) - Defaults to "text". Must be one of "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "month", "number", "password", "range", "radio", "search", "select", "tel", "text", "textarea", "time", "url", or "week".
  • color (:string) - Defaults to nil.Must be one of nil, "primary", "secondary", "accent", "info", "success", "warning", or "error".
  • field (Phoenix.HTML.FormField) - a form field struct retrieved from the form, for example: @form[:email].
  • class (:any) - Defaults to nil.
  • ghost (:boolean) - Defaults to nil.
  • errors (:list) - Defaults to [].
  • checked (:boolean) - the checked flag for checkbox inputs.
  • prompt (:string) - the prompt for select inputs. Defaults to nil.
  • options (:list) - the options to pass to Phoenix.HTML.Form.options_for_select/2.
  • multiple (:boolean) - the multiple flag for select inputs. Defaults to false.
  • Global attributes are accepted. Supports all globals plus: ["autocomplete", "cols", "disabled", "form", "list", "max", "maxlength", "min", "minlength", "pattern", "placeholder", "readonly", "required", "rows", "size", "step"].

Slots

  • inner_block