Textarea
Multi-line text input with auto-resize, constraints, and model binding.
<rhx-textarea>
Examples
Basic
<rhx-textarea rhx-label="Notes"
rhx-placeholder="Enter your notes..."
name="notes" />
Hint and Maxlength
Max 500 characters
<rhx-textarea rhx-label="Bio" rhx-rows="5"
rhx-placeholder="Tell us about yourself..."
rhx-maxlength="500"
rhx-hint="Max 500 characters"
name="bio" />
Auto-resize
<rhx-textarea rhx-label="Auto-resize"
rhx-resize="auto" rhx-rows="2"
rhx-placeholder="Type here and watch the textarea grow..."
name="auto" />
Sizes
<rhx-textarea rhx-label="Small" rhx-size="small" name="ta-sm" />
<rhx-textarea rhx-label="Medium (default)" name="ta-md" />
<rhx-textarea rhx-label="Large" rhx-size="large" name="ta-lg" />
States
<rhx-textarea rhx-label="Disabled" rhx-disabled="true"
value="Cannot edit" name="ta-dis" />
<rhx-textarea rhx-label="Readonly" rhx-readonly="true"
value="This content is read-only" name="ta-ro" />
htmx Integration
Write a comment and click submit...
<rhx-textarea rhx-label="Leave a Comment" name="comment"
rhx-rows="3"
rhx-placeholder="Write your comment here..." />
<rhx-button rhx-variant="brand"
hx-post="/Docs/Components/Textarea?handler=Comment"
hx-include="[name='comment']"
hx-target="#comment-result">
Submit Comment
</rhx-button>
<div id="comment-result">Write a comment and click submit...</div>
Properties
| Property | Type | Default | Description |
|---|---|---|---|
rhx-for |
ModelExpression |
- |
ASP.NET Core model expression for two-way binding |
name |
string |
- |
The form field name |
value |
string |
- |
The current value |
rhx-label |
string |
- |
Label text displayed above the textarea |
rhx-hint |
string |
- |
Hint text displayed below the textarea |
rhx-size |
string |
medium |
Textarea size: small, medium, large |
rhx-disabled |
bool |
false |
Whether the textarea is disabled |
rhx-readonly |
bool |
false |
Whether the textarea is read-only |
rhx-required |
bool |
false |
Whether the field is required |
rhx-placeholder |
string |
- |
Placeholder text |
rhx-rows |
int? |
- |
Number of visible text rows |
rhx-resize |
string |
vertical |
Resize behavior: vertical, horizontal, auto, none |
rhx-maxlength |
int? |
- |
Maximum character length |
rhx-filled |
bool |
false |
Use filled appearance |
Accessibility
- Renders a native
<textarea>element with associated<label>. rhx-hintis linked viaaria-describedby.- Required state is conveyed with
aria-required. - Disabled state sets
aria-disabled.