Forms.textarea
Server-rendered
Renders a textarea with shadcn classes.
Basic textarea
<.textarea id="bio" name="bio" rows={4} />
With placeholder
<.textarea id="release_notes" name="release_notes" rows={8} placeholder="Summarize what changed in this release..." />
With FormField
Phoenix shim
<.textarea field={@form[:bio]} />
With label
Phoenix shim
<.textarea field={@form[:bio]} label="Bio" />
With explicit errors
Phoenix shimtoo short
<.textarea field={@form[:bio]} label="Bio" errors={["too short"]} />
Inside field composition
Phoenix shimTell us about yourself.
<.field>
<:label for={@form[:bio].id}>Bio</:label>
<.textarea field={@form[:bio]} />
<:description>Tell us about yourself.</:description>
</.field>
Attributes
| Name | Type | Default | Values | Global Includes |
|---|---|---|---|---|
class
|
:string |
— | — | — |
errors
|
:list |
— | — | — |
field
|
{:struct, Phoenix.HTML.FormField} |
— | — | — |
id
|
:string |
— | — | — |
label
|
:string |
— | — | — |
name
|
:string |
— | — | — |
placeholder
|
:string |
— | — | — |
rest
|
:global |
— | — |
disabled
,
maxlength
,
minlength
,
readonly
,
required
|
rows
|
:integer |
4
|
— | — |
value
|
:string |
— | — | — |
Slots
No slots declared.