Input

Renders a form input field or a component that looks like an input field.

Read more Read less

Options

  • :id - The id to use for the input
  • :name - The name to use for the input
  • :value - The value to pre-populate the input with
  • :type - The type of input (text, email, password, etc.)
  • :default-value - The default value of the input
  • :field - A form field struct to build the input from
  • :class - Additional CSS classes to apply
  • :placeholder - Placeholder text (passed through as rest)
  • :disabled - Whether the input is disabled (passed through as rest)
  • :required - Whether the input is required (passed through as rest)
  • :readonly - Whether the input is readonly (passed through as rest)
  • :autocomplete - Hints for form autofill feature (passed through as rest)
Attribute Type Documentation Default Value
id :any
name :any
value :any
type :string "text"
default-value :any
field %FormField{}

a form field struct retrieved from the form, for example: @form[:email]

class :any
rest :global