Textarea

Retrieve multi-line user input.

General

Basic usage.

Preview
See code

Disabled

Disable interactive textarea.

Preview
See code

Type

Differentiate states by color.

Preview
See code

Get Change

Capture changes in textarea.

Preview
See code

With useInput

Use hooks to capture changes.

Preview
See code

Imperative API

Update component in an uncontrolled way.

Preview
See code

APIs

Textarea.Props[alias: Input.Textarea]

AttributeDescriptionTypeAccepted valuesDefault
valuetextarea valuestring--
initialValuetextarea valuestring--
placeholderplaceholderstring--
typecurrent typeTextareaTypesTextareaTypesdefault
readOnlynative attrboolean-false
disableddisable inputboolean-false
onChangechange event(e: React.ChangeEvent) => void--
resizeCSS attributeCSSResizeCSSResizenone
...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
  }
}

TextareaTypes

type TextareaTypes =
  | 'default'
  | 'primary'
  | 'secondary'
  | 'success'
  | 'warning'
  | 'error'
  | 'info'

CSSResize

type CSSResize =
  | 'none'
  | 'both'
  | 'horizontal'
  | 'vertical'
  | 'initial'
  | 'inherit'
Edit this page on GitHub

Previous

Text

Next

Toggle

MADE & DESIGNED WITHBY BRUNO ANDRADE
docs background gradient blue
docs background gradient violet