LanternUI.Components.Textarea (LanternUI v0.8.2)

Copy Markdown View Source

Multi-line text input. Mirrors Fluxon's textarea/1 and matches Form.input chrome (label, description, help, errors).

<.textarea field={@form[:bio]} label="Bio" help_text="A short intro." rows={5} />
<.textarea name="notes" value={@notes} label="Notes" size="lg" />

Summary

Functions

textarea(assigns)

Attributes

  • id (:any) - Element id; derived from field when omitted. Defaults to nil.
  • name (:any) - Form input name; derived from field when omitted. Defaults to nil.
  • value (:any) - Current text content of the textarea. Defaults to nil.
  • label (:string) - Primary label above the control. Defaults to nil.
  • sublabel (:string) - Secondary label line under the primary label. Defaults to nil.
  • description (:string) - Helper text under the label stack. Defaults to nil.
  • help_text (:string) - Trailing help line under the field when no errors. Defaults to nil.
  • errors (:list) - Validation messages; derived from field when used. Defaults to [].
  • rows (:integer) - Visible row count for the textarea. Defaults to 4.
  • size (:string) - Control density / type scale. Defaults to "md". Must be one of "xs", "sm", "md", "lg", or "xl".
  • class (:any) - Extra classes merged onto the root element. Defaults to nil.
  • field (Phoenix.HTML.FormField) - Form field; derives id, name, value, and errors. Defaults to nil.
  • disabled (:boolean) - Render disabled and non-interactive. Defaults to false.
  • Global attributes are accepted. Arbitrary HTML/phx-* attributes passed through. Supports all globals plus: ["placeholder", "autocomplete", "autofocus", "readonly", "required", "minlength", "maxlength", "form", "wrap", "spellcheck", "cols", "phx-change", "phx-blur", "phx-focus", "phx-target"].