Basic Usage
Controlled State
With Label
Disabled State
With Character Count
Form Integration
Props Reference
The controlled value of the textarea
Event handler called when the value changes
Placeholder text shown when textarea is empty
Disables the textarea when True
Makes the textarea required in forms
Name attribute for form submission
Number of visible text rows
Maximum number of characters allowed
Additional CSS classes for styling
Styling
From source code atreflex_ui/components/base/textarea.py:9-12:
- Focus state: Blue ring and border color from primary scale
- Border: Secondary color with hover state
- Disabled state: Muted colors and not-allowed cursor
- Height: Minimum 24 units (6rem), maximum 60rem
- Resize: Disabled by default
- Scrollbar: Auto appears when content exceeds max height
- Font: Medium weight for better readability
Default Attributes
From source code atreflex_ui/components/base/textarea.py:21-28:
The textarea automatically sets these attributes for better UX:
autoComplete="off"- Disables browser autocompleteautoCapitalize="none"- Disables auto-capitalizationautoCorrect="off"- Disables auto-correctionspellCheck="false"- Disables spell checking (can be overridden)
Implementation Details
From source code atreflex_ui/components/base/textarea.py:15-35:
- Extends Reflex’s base
Textareaelement - Automatically applies consistent styling
- Custom attributes for better user experience
- Supports all standard HTML textarea attributes
- Focus management with visible focus ring