Textarea
beta
The Textarea
component is used to create a multi-line text input field.
Usage
import { Textarea } from '@harnessio/ui/components'
//...
return ( <Textarea label="Textarea label" placeholder="Placeholder" name="textarea-name" onChange={handleChange} />)
API Reference
The Textarea
can be used either controlled or uncontrolled. When controlled, the
Textarea
will use the value
prop as its value and call the onChange
callback whenever
the value changes. When uncontrolled, the Textarea
will use the defaultValue
prop as
its initial value and will call onChange
when its value changes. The Textarea
also supports
all attributes of the textarea
HTML element.
Prop | Required | Default | Type |
---|---|---|---|
name | false | string | |
id | false | string | |
value | false | string | |
onChange | false | (value: string) => void | |
label | false | string | |
caption | false | string | |
error | false | string | |
optional | false | false | boolean |
resizable | false | false | boolean |
disabled | false | false | boolean |