Textarea
Multi-line text input for longer form content.
Installation
Add the Textarea component using the CLI:
Textarea
The Textarea component provides a multi-line text input. Use Value and ValueChanged for two-way binding. Set Placeholder, Rows, and Disabled as needed.
Examples
Rows
Use the Rows parameter to control the initial height of the textarea.
ComposableTextArea
The ComposableTextArea extends the textarea pattern with optional Header and Footer slots. Use it when you need to add toolbar buttons, hints, or actions above or below the input. It lives in the same folder as Textarea—shadcnblazor component add textarea adds both.
AI Chat input
The AI Chat sample uses ComposableTextArea for its input bar. The Header holds an "Add Context" button; the Footer has toggles (extended thinking, auto, sources) and a send button. The slots keep the input compact while exposing controls.
ComposableTextArea API
ComposableTextArea
Multi-line text input with optional header and footer slots.
Properties
| Name | Type | Description |
|---|---|---|
AdditionalAttributes |
Dictionary<string, Object> |
|
Class |
string |
|
Disabled |
bool |
Whether the text area is disabled. |
Footer |
RenderFragment |
Optional footer content below the text area. |
FooterContainerClass |
string |
CSS classes for the footer container. |
Header |
RenderFragment |
Optional header content above the text area. |
HeaderContainerClass |
string |
CSS classes for the header container. |
OnChange |
EventCallback<ChangeEventArgs> |
Callback invoked when the input change event fires. |
Placeholder |
string |
Placeholder text when the value is empty. |
Rows |
int |
The number of visible text rows. |
Value |
string |
The current value of the text area. |
ValueChanged |
EventCallback<string> |
Callback invoked when the value changes. |
Events
| Name | Type | Description |
|---|---|---|
OnChange |
EventCallback<ChangeEventArgs> |
Callback invoked when the input change event fires. |
ValueChanged |
EventCallback<string> |
Callback invoked when the value changes. |
Methods
| Method | Returns | Description |
|---|---|---|
Equals |
bool |
|
GetHashCode |
int |
|
GetType |
Type |
|
SetParametersAsync |
Task |
|
ToString |
string |
API Reference
Textarea
Multi-line text input for longer form content.
Properties
| Name | Type | Description |
|---|---|---|
AdditionalAttributes |
Dictionary<string, Object> |
|
Class |
string |
|
Disabled |
bool |
Whether the textarea is disabled. |
Placeholder |
string |
Placeholder text when the value is empty. |
Rows |
int |
The number of visible text rows. |
Value |
string |
The current value of the textarea. |
ValueChanged |
EventCallback<string> |
Callback invoked when the value changes. |
Events
| Name | Type | Description |
|---|---|---|
ValueChanged |
EventCallback<string> |
Callback invoked when the value changes. |
Methods
| Method | Returns | Description |
|---|---|---|
Equals |
bool |
|
GetClass |
string |
Returns the CSS classes for the textarea. |
GetHashCode |
int |
|
GetType |
Type |
|
SetParametersAsync |
Task |
|
ToString |
string |