Textarea
Retrieve multi-line user input.
General
Basic usage.
disabled
Disable interactive textarea.
Type
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
]
Attribute | Description | Type | Accepted values | Default |
---|---|---|---|---|
value | textarea value | string | - | - |
initialValue | textarea value | string | - | - |
placeholder | placeholder | string | - | - |
type | current type | TextareaTypes | TextareaTypes | default |
readOnly | native attr | boolean | - | false |
disabled | disable input | boolean | - | false |
onChange | change event | (e: React.ChangeEvent) => void | - | - |
resize | CSS attribute | CSSResize | CSSResize | none |
... | native props | TextareaHTMLAttributes | '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' | 'secondary' | 'success' | 'warning' | 'error'
CSSResize
type CSSResize = 'none' | 'both' | 'horizontal' | 'vertical' | 'initial' | 'inherit'
Contributors