Multi-line text inputs.
Ports both Pines textarea (pure Tailwind) and
Pines auto-resize textarea — the
latter via auto_resize, which is the component's only use of Alpine.
<.textarea name="bio" label="Bio" rows={4} />
<.textarea name="note" auto_resize placeholder="Grows as you type…" />
Summary
Forms
Renders a labelled textarea.
Forms
Renders a labelled textarea.
Examples
<.textarea name="bio" label="About you" rows={5}
hint="A short paragraph is plenty." />
<.textarea name="comment" auto_resize rows={1}
placeholder="Write a comment…" phx-change="draft" />Attributes
id(:string) - Defaults tonil.name(:string) (required)value(:string) - Defaults tonil.label(:string) - Defaults tonil.placeholder(:string) - Defaults tonil.rows(:integer) - Defaults to3.hint(:string) - Defaults tonil.error(:string) - Defaults tonil.disabled(:boolean) - Defaults tofalse.readonly(:boolean) - Defaults tofalse.required(:boolean) - Defaults tofalse.auto_resize(:boolean) - Grows the field to fit its content as the user types. Requires Alpine. The height is reset to0and then set toscrollHeighton every input, which is what lets it shrink again as well as grow.Defaults to
false.class(:string) - Defaults tonil.container_class(:string) - Defaults tonil.Global attributes are accepted. Supports all globals plus:
["autocomplete", "autofocus", "maxlength", "minlength", "wrap", "form"].