Form
Textarea
Multi-line text input with auto-resize option.
Available in
reactangularPreview
Live previewreal component
Install
TerminalBash
npx mcp-elements add textareaUsage
textarea-example.tsxTSX
import { Textarea } from '@mcp-elements/react'
import { useState } from 'react'
export function Example() {
const [value, setValue] = useState('')
return (
<Textarea
placeholder="Describe the tool you want to call…"
rows={4}
value={value}
onChange={(e) => setValue(e.target.value)}
/>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled value of the textarea |
defaultValue | string | — | Initial value when uncontrolled |
onChange | (e: React.ChangeEvent<HTMLTextAreaElement>) => void | — | Called when the value changes |
placeholder | string | — | Placeholder text |
rows | number | — | Number of visible text rows |
disabled | boolean | false | Whether the textarea is disabled |
className | string | — | Additional classes merged onto the textarea |