Form

Textarea

Multi-line text input with auto-resize option.

Available inreactangular

Preview

Live previewreal component

Install

TerminalBash
npx mcp-elements add textarea

Usage

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

PropTypeDefaultDescription
valuestringControlled value of the textarea
defaultValuestringInitial value when uncontrolled
onChange(e: React.ChangeEvent<HTMLTextAreaElement>) => voidCalled when the value changes
placeholderstringPlaceholder text
rowsnumberNumber of visible text rows
disabledbooleanfalseWhether the textarea is disabled
classNamestringAdditional classes merged onto the textarea