RUI.next

Data-Entry
TextArea

TextArea

The TextArea component is layout-independent, that means it only includes the most basic TextArea box part. If you want to add borders, titles, or some operation buttons with it, you can combine with the List or Form components.

In addition, the following native attributes are supported: autoComplete autoFocus disabled readOnly onFocus onBlur onCompositionStart onCompositionEnd onClick.

<TextArea placeholder="please input content" />
<TextArea placeholder="please input content" />

Example

Basic usage of TextArea component.

TextArea autoSize feature - Boolean autoSize (start from 2 rows)
TextArea autoSize feature - Customize autoSize config (minRows: 3, maxRows: 6)
TextArea with 3 rows
TextArea showCount feature
45/50
TextArea with disabled mode
TextArea with readonly mode

API

PropertiesDescriptionTypeDefault
idThe id of the TextArea element, usually used with labelstring-
valueThe input valuestring-
defaultValueThe default valuestring-
placeholderThe hint textstring-
disabledWhether it is disabled or notbooleanfalse
readOnlyWhether it is readonly or notbooleanfalse
onChangeTriggered when the TextArea content is changed(value: string) => void-
autoSizeAdaptive content heightboolean | { minRows?: number, maxRows?: number }false
rowsThe number of rowsnumber2
maxLengthThe maximum number of charactersnumber-
showCountDisplays the number of words, supports custom render countboolean | ((length: number, maxLength?: number) => ReactNode)false