Skip to content

TextArea

pywry.toolbar.TextArea

Bases: ToolbarItem

A multi-line text area that supports resizing and paste.

Emits {value: ..., componentId: ...} on input change.

The textarea is resizable in all directions by default. Use the resize attribute to control resize behavior.

ATTRIBUTE DESCRIPTION
value

Initial text content (default: "").

TYPE: str

placeholder

Placeholder text shown when empty (default: "").

TYPE: str

debounce

Milliseconds to debounce input events (default: 300).

TYPE: int

rows

Initial number of visible text rows (default: 3).

TYPE: int

cols

Initial number of visible columns (default: 40).

TYPE: int

resize

CSS resize behavior: "both", "horizontal", "vertical", or "none" (default: "both").

TYPE: str

min_height

Minimum height CSS value (e.g., "50px").

TYPE: str

max_height

Maximum height CSS value (e.g., "500px").

TYPE: str

min_width

Minimum width CSS value (e.g., "100px").

TYPE: str

max_width

Maximum width CSS value (e.g., "100%").

TYPE: str

Examples:

>>> TextArea(
...     label="Notes:",
...     event="notes:update",
...     placeholder="Enter your notes here...",
...     rows=5,
...     resize="vertical",
... )

Functions

build_html

build_html() -> str

Build textarea HTML.

auto_generate_component_id

auto_generate_component_id() -> ToolbarItem

Auto-generate component_id based on type if not provided.

validate_event_name classmethod

validate_event_name(v: str) -> str

Validate event follows namespace:event-name pattern.