Textarea
A multi-line text input for longer content — comments, messages, descriptions. Supports validation states, disabled, and an actions variant.
@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.
@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.
@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.
@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.
@textarea.TextareaWithActions(textarea.Config{
ID: "message",
Name: "message",
Placeholder: "Type your message here...",
Rows: 6,
})API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
ID | string | "" | Unique id for the textarea (and label's for target). |
Name | string | "" | Form field name. |
Label | string | "" | Label above the textarea. |
Placeholder | string | "" | Placeholder when empty. |
Value | string | "" | Current value. |
Rows | int | 0 | Visible rows (height). |
Disabled | bool | false | Disable the textarea. |
ReadOnly | bool | false | Non-editable but submittable. |
State | State | StateDefault | Validation state: "" (default), "error", "success". |
HelperText | string | "" | Text below the field, recolored by State. |
RootClass | string | "" | Extra classes on the container. |