PhoenixDuskmoon.Component.Form.Textarea (PhoenixDuskmoon v7.2.1)
View SourceTextarea 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 fieldlabel- Textarea label textplaceholder- Placeholder textrows- Number of visible text lines (default: 3)cols- Visible width of the text controlsize- 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 textareareadonly- Make textarea readonlyrequired- Make textarea requiredmaxlength- Maximum number of charactersclass- Additional CSS classeslabel_class- Additional CSS classes for labeltextarea_class- Additional CSS classes for textarea element
Summary
Functions
Attributes
id(:any) - Defaults tonil.name(:any)value(:any)field(Phoenix.HTML.FormField) - a form field struct retrieved from the form.label(:string) - Defaults tonil.placeholder(:string) - Defaults tonil.rows(:integer) - Defaults to3.cols(:integer) - Defaults tonil.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 tofalse.readonly(:boolean) - Defaults tofalse.required(:boolean) - Defaults tofalse.maxlength(:integer) - Defaults tonil.class(:string) - Defaults tonil.label_class(:string) - Defaults tonil.textarea_class(:string) - Defaults tonil.- Global attributes are accepted.