Textarea

Retrieve multi-line user input.

Default

Basic usage.

width

Specify width manually.

disabled

Disable interactive textarea.

status

Differentiate states by color.

get change

Capture changes in textarea.

With useInput

Use hooks to capture changes.

Imperative API

Update component in an uncontrolled way.

APIs

Textarea.Props[alias: Input.Textarea]

AttributeDescriptionTypeAccepted valuesDefault
valuetextarea valuestring--
initialValuetextarea valuestring--
placeholderplaceholderstring--
statuscurrent statusNormalTypes'default', 'secondary', 'success', 'warning', 'error'default
readOnlynative attrboolean-false
disableddisable inputboolean-false
widthset width stringstring-initial
minHeightset min-height stringstring--
onChangechange event(e: React.ChangeEvent) => void--
...native propsTextareaHTMLAttributes'form', 'id', 'className', ...-

useInput

type useInput = (
  initialValue: string,
) => {
  state: string
  setState: Dispatch<SetStateAction<string>>
  currentRef: MutableRefObject<string>
  reset: () => void
  bindings: {
    value: string
    onChange: (event: React.ChangeEvent<HTMLInputElement>) => void
  }
}