Default#
Textarea default example rendered by the production Go component.
f.Textarea(components.TextareaSnapshot{
ID: tree.ID(page, "description"), Label: "Project description", Hint: "Supports multiple lines",
Value: value, DisplayValue: value,
}).Height(142)Grow#
Textarea grow example rendered by the production Go component.
width := min(size.Width-48, float32(540))
height := min(layout.ContentHeight(canvas, theme, value, width, false), float32(5)*20+16)
f.Textarea(components.TextareaSnapshot{
ID: tree.ID(page, "notes"), Label: "Project description", Value: value,
DisplayValue: value, Layout: layout,
}).Height(height)Selection#
Textarea selection example rendered by the production Go component.
value := "Select this text\nComposition text"
f.Textarea(components.TextareaSnapshot{
ID: tree.ID(page, "selection"), Value: value, DisplayValue: value,
ReadOnly: true, Focused: true, ShowCaret: true, Caret: 16,
SelectionStart: 0, SelectionEnd: 6,
CompositionStart: 17, CompositionEnd: len(value),
}).Height(142)States#
Textarea states example rendered by the production Go component.
f.Row().Gap(12).Children(func() {
f.Textarea(components.TextareaSnapshot{
ID: tree.ID(page, "invalid"), Label: "Invalid field", Invalid: true, ReadOnly: true,
Value: "Too short", DisplayValue: "Too short",
}).Grow(1).Basis(0).Height(104)
f.Textarea(components.TextareaSnapshot{
ID: tree.ID(page, "read-only"), Label: "Read-only field", ReadOnly: true,
Value: "Generated by the system\nNot editable", DisplayValue: "Generated by the system\nNot editable",
}).Grow(1).Basis(0).Height(104)
})
f.Textarea(components.TextareaSnapshot{
ID: tree.ID(page, "disabled"), Label: "Disabled field", Disabled: true,
Placeholder: "Currently unavailable",
}).Height(72)Installation
Copy the recipe into your own project.
go run ./cmd/viva add --out ./components/local textareaSource-owned usage#
This preview calls the production Go component directly. Stable IDs, values and open state remain owned by the application; the component only paints and declares interaction semantics.
- Read the linked component source for every option and visual decision.
- Use the native command to verify system text, focus, accessibility and platform integration.
- The browser preview validates shared layout and scene behavior, not native performance.
Verification boundary#
The examples cover representative states supported by the current API. They do not imply that every desktop backend has completed hardware validation.
Keyboard
Use Tab to move between controls and Ctrl/⌘ K to search the catalog. Inside a preview, the Go runtime handles keyboard input.