Skip to main content

TextArea

The TextArea widget provides a multi-line text input field for entering longer text content.

States

StateTypeDefaultDescription
valuestringNoneCurrent text content of the textarea

Properties

PropertyTypeDefaultDescription
labelstring""Label text displayed above the textarea
placeholderstring""Placeholder text displayed when the textarea is empty
default_valuestringNoneInitial value of the textarea
requiredboolFalseWhether the textarea input is required
disabledboolFalseWhether the textarea is disabled
max_lengthint32NoneMaximum number of characters allowed
min_lengthint32NoneMinimum number of characters allowed
max_linesint32NoneMaximum number of lines allowed
min_linesint32NoneMinimum number of lines allowed
auto_resizeboolFalseWhether the textarea should automatically resize based on content

Examples

Basic TextArea

package main

import (
"github.com/sourcetool/sourcetool-go"
"github.com/sourcetool/sourcetool-go/textarea"
)

func main() {
func page(ui sourcetool.UIBuilder) error {
// Create a basic textarea
textarea := ui.TextArea("Comments", textarea.Placeholder("Enter your comments here"))
}
}

Disabled TextArea

// Create a disabled textarea
disabledTextarea := ui.TextArea("System Log", textarea.Placeholder("System log content that cannot be edited"), textarea.Disabled(true))
  • TextInput - For single-line text input
  • Markdown - For displaying formatted text content