# `ShadcnUI.Components.Forms.Input`
[🔗](https://github.com/pcharbon70/shadcn_ui/blob/main/lib/shadcn_ui/components/forms/input.ex#L1)

Native text-like input composed through the shared form contract.

Input keeps browser value, focus, autofill, constraint validation, and form
submission behavior intact. The caller owns parsing, validation, pending
lifecycle, duplicate prevention, persistence, authorization, and outcomes.

# `input`

Renders one native text-like input with deterministic field relationships.
## Attributes

* `type` (`:string`) - Defaults to `"text"`. Must be one of `"text"`, `"email"`, `"password"`, `"search"`, `"tel"`, `"url"`, `"number"`, `"date"`, `"datetime-local"`, `"month"`, `"week"`, or `"time"`.
* `size` (`:atom`) - Defaults to `:default`. Must be one of `:small`, `:default`, or `:large`.
* `field` (`:any`) - Defaults to `nil`.
* `id` (`:string`) - Defaults to `nil`.
* `name` (`:string`) - Defaults to `nil`.
* `value` (`:any`) - Defaults to `{:shadcn_ui, :not_provided}`.
* `errors` (`:any`) - Defaults to `{:shadcn_ui, :not_provided}`.
* `error_mode` (`:atom`) - Defaults to `:used_input`. Must be one of `:used_input`, `:always`, or `:hidden`.
* `used` (`:boolean`) - Defaults to `false`.
* `translate_error` (`:any`) - Defaults to `nil`.
* `pending` (`:boolean`) - Defaults to `false`.
* `required` (`:boolean`) - Defaults to `false`.
* `optional` (`:boolean`) - Defaults to `false`.
* `disabled` (`:boolean`) - Defaults to `false`.
* `readonly` (`:boolean`) - Defaults to `false`.
* `autocomplete` (`:string`) - Defaults to `nil`.
* `inputmode` (`:string`) - Defaults to `nil`.Must be one of `nil`, `"none"`, `"text"`, `"decimal"`, `"numeric"`, `"tel"`, `"search"`, `"email"`, or `"url"`.
* `placeholder` (`:string`) - Defaults to `nil`.
* `minlength` (`:integer`) - Defaults to `nil`.
* `maxlength` (`:integer`) - Defaults to `nil`.
* `pattern` (`:string`) - Defaults to `nil`.
* `min` (`:any`) - Defaults to `nil`.
* `max` (`:any`) - Defaults to `nil`.
* `step` (`:any`) - Defaults to `nil`.
* `form` (`:string`) - Defaults to `nil`.
* `describedby` (`:any`) - Defaults to `nil`.
* `class` (`:any`) - Defaults to `nil`.
* `field_class` (`:any`) - Defaults to `nil`.
* Global attributes are accepted. Supports all globals plus: `["autocapitalize", "autofocus", "list", "spellcheck"]`.
## Slots

* `label` (required)
* `help`
* `leading`
* `trailing`

---

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