ShadcnUI.Components.Forms.Textarea (shadcn_ui v1.0.0)

Copy Markdown View Source

Native multiline input composed through the shared form contract.

Textarea keeps its normalized value as escaped element content. Native resize remains the fallback; explicit content sizing is a CSS capability enhancement. The caller owns parsing, validation, measurement-driven growth, persistence, submission, and request lifecycle.

Summary

Functions

Renders one native textarea with deterministic field relationships.

Functions

textarea(assigns)

Renders one native textarea with deterministic field relationships.

Attributes

  • 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.
  • rows (:integer) - Defaults to nil.
  • cols (:integer) - Defaults to nil.
  • minlength (:integer) - Defaults to nil.
  • maxlength (:integer) - Defaults to nil.
  • placeholder (:string) - Defaults to nil.
  • autocomplete (:string) - Defaults to nil.
  • form (:string) - Defaults to nil.
  • resize (:atom) - Defaults to :vertical. Must be one of :vertical, :horizontal, :both, or :fixed.
  • sizing (:atom) - Defaults to :fixed. Must be one of :fixed, or :content.
  • 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", "spellcheck", "wrap"].

Slots

  • label (required)
  • help