Textarea

A multi-line text input for longer content — comments, messages, descriptions. Supports validation states, disabled, and an actions variant.

Usage Example
@textarea.Textarea(textarea.Config{
    ID:          "comment",
    Name:        "comment",
    Label:       "Comment",
    Placeholder: "We'd love to hear from you...",
    Rows:        3,
})

Error State

State: textarea.StateError recolors the border and HelperText for validation errors.

Error: Please add some comments to your evaluation
Error State
@textarea.Textarea(textarea.Config{
    ID:         "comment-error",
    Name:       "comment",
    Label:      "Comment",
    State:      textarea.StateError,
    HelperText: "Error: Please add some comments to your evaluation",
    Rows:       3,
})

Success State

State: textarea.StateSuccess applies the success styling.

Success State
@textarea.Textarea(textarea.Config{
    ID:    "comment-success",
    Name:  "comment",
    Label: "Comment",
    State: textarea.StateSuccess,
    Rows:  3,
})

Disabled

Disabled: true blocks editing and dims the field.

Disabled
@textarea.Textarea(textarea.Config{
    ID:          "comment-disabled",
    Name:        "comment",
    Label:       "Comment",
    Placeholder: "This textarea is disabled",
    Disabled:    true,
})

With Actions

textarea.TextareaWithActions wraps the field with a toolbar/footer for inline actions.

With Actions
@textarea.TextareaWithActions(textarea.Config{
    ID:          "message",
    Name:        "message",
    Placeholder: "Type your message here...",
    Rows:        6,
})

API Reference

PropTypeDefaultDescription
IDstring""Unique id for the textarea (and label's for target).
Namestring""Form field name.
Labelstring""Label above the textarea.
Placeholderstring""Placeholder when empty.
Valuestring""Current value.
Rowsint0Visible rows (height).
DisabledboolfalseDisable the textarea.
ReadOnlyboolfalseNon-editable but submittable.
StateStateStateDefaultValidation state: "" (default), "error", "success".
HelperTextstring""Text below the field, recolored by State.
RootClassstring""Extra classes on the container.