Textarea

New

Overview

Textarea component for multi-line text fields.

Include the details needed to reproduce the issue.

HEEx
<div class="example-fields w-full">
  <Textarea.textarea
    id="example-message"
    name="message"
    label="Message"
    description="Include the details needed to reproduce the issue."
    placeholder="Describe what happened..."
  />
</div>

Errors

When bound with field, validation errors render beneath the textarea.

can't be blank

HEEx
<.form
  :let={form}
  for={to_form(%{"message" => ""}, errors: [message: {"can't be blank", []}])}
  id="example-textarea-errors-form"
  class="example-fields w-full"
>
  <Textarea.textarea
    field={form[:message]}
    label="Message"
    placeholder="Describe what happened..."
  />
</.form>

Add this module

terminal
mix dizzy.add textarea

Component API

Textarea.textarea

Attributes

Attributes for Textarea.textarea
NameTypeDefault Values
class :any nil โ€”
description :string nil โ€”
disabled :boolean false โ€”
errors :list [] โ€”
field {:struct, Phoenix.HTML.FormField} nil โ€”
id :string nil โ€”
label :string nil โ€”
name :string nil โ€”
required :boolean false โ€”
rest :global nil โ€”
rows :integer 4 โ€”
value :any nil โ€”