PhoenixDuskmoon.Component.Form.Textarea (PhoenixDuskmoon v7.2.1)

View Source

Textarea component for multi-line text input.

Examples

<.dm_form for={@form} phx-submit="save">
  <.dm_textarea field={@form[:description]} label="Description" />
  <.dm_textarea field={@form[:notes]} label="Notes" rows="5" color="success" />
  <.dm_textarea field={@form[:comment]} label="Comment" size="lg" resize="none" />
</.dm_form>

Attributes

  • field - Phoenix form field
  • label - Textarea label text
  • placeholder - Placeholder text
  • rows - Number of visible text lines (default: 3)
  • cols - Visible width of the text control
  • size - Textarea size: xs, sm, md, lg (default: md)
  • color - Textarea color: primary, secondary, accent, info, success, warning, error (default: primary)
  • resize - Resize behavior: none, vertical, horizontal, both (default: vertical)
  • disabled - Disable the textarea
  • readonly - Make textarea readonly
  • required - Make textarea required
  • maxlength - Maximum number of characters
  • class - Additional CSS classes
  • label_class - Additional CSS classes for label
  • textarea_class - Additional CSS classes for textarea element

Summary

Functions

dm_textarea(assigns)

Attributes

  • id (:any) - Defaults to nil.
  • name (:any)
  • value (:any)
  • field (Phoenix.HTML.FormField) - a form field struct retrieved from the form.
  • label (:string) - Defaults to nil.
  • placeholder (:string) - Defaults to nil.
  • rows (:integer) - Defaults to 3.
  • cols (:integer) - Defaults to nil.
  • size (:string) - Defaults to "md". Must be one of "xs", "sm", "md", or "lg".
  • color (:string) - Defaults to "primary". Must be one of "primary", "secondary", "accent", "info", "success", "warning", or "error".
  • resize (:string) - Defaults to "vertical". Must be one of "none", "vertical", "horizontal", or "both".
  • disabled (:boolean) - Defaults to false.
  • readonly (:boolean) - Defaults to false.
  • required (:boolean) - Defaults to false.
  • maxlength (:integer) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • label_class (:string) - Defaults to nil.
  • textarea_class (:string) - Defaults to nil.
  • Global attributes are accepted.