# `PetalComponents.Input`
[🔗](https://github.com/petalframework/petal_components/blob/v3.2.0/lib/petal_components/input.ex#L1)

Renders pure inputs (no label or errors).

# `input`

## 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"`, `"switch"`, `"tel"`, `"text"`, `"textarea"`, `"time"`, `"url"`, or `"week"`.
* `size` (`:string`) - the size of the switch. Defaults to `"md"`. Must be one of `"xs"`, `"sm"`, `"md"`, `"lg"`, or `"xl"`.
* `viewable` (`:boolean`) - If true, adds a toggle to show/hide the password text. Defaults to `false`.
* `copyable` (`:boolean`) - If true, adds a copy button to the field and disables the input. Defaults to `false`.
* `clearable` (`:boolean`) - If true, adds a clear button to clear the field value. Defaults to `false`.
* `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 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`.
* `class` (`:any`) - the class to add to the input. Defaults to `nil`.
* 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"]`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
