SutraUI.Textarea (Sutra UI v0.2.0)
View SourceDisplays a multi-line text input field.
Examples
# Basic textarea
<.textarea name="bio" placeholder="Tell us about yourself" />
# Textarea with custom rows
<.textarea name="description" rows={6} />
# Disabled textarea
<.textarea name="readonly_content" disabled />
# Textarea with form field
<.textarea field={@form[:message]} />
# Textarea with character limits
<.textarea name="summary" minlength="10" maxlength="500" />
# Textarea with ARIA attributes
<.textarea
name="feedback"
aria-label="Your feedback"
aria-describedby="feedback-help"
/>Accessibility
aria-label- Label for the textarea when no visible label is presentaria-describedby- References helper text or error messagesaria-invalid- Indicates validation state
Summary
Functions
Renders a textarea component.
Functions
Renders a textarea component.
Examples
<.textarea name="bio" placeholder="Tell us about yourself" />
<.textarea name="bio" rows={6} />
<.textarea name="bio" disabled />
<.textarea field={@form[:message]} />Attributes
field(Phoenix.HTML.FormField) - A form field struct retrieved from the form.id(:string) - The id attribute. Defaults tonil.name(:string) - The name attribute. Defaults tonil.value(:string) - The value. Defaults tonil.placeholder(:string) - Placeholder text. Defaults tonil.rows(:integer) - Number of visible text lines. Defaults to3.class(:string) - Additional CSS classes. Defaults tonil.- Global attributes are accepted. Additional HTML attributes. Supports all globals plus:
["disabled", "required", "readonly", "autofocus", "minlength", "maxlength", "aria-label", "aria-describedby", "aria-invalid"].