TextArea
A custom HTML TextArea component with number of characters validation.
0 / 120
Props:
showsCharactersCounting
Description: Display characters length validation if true. Type: Boolean. Default: true.
currentLength
Description: A number to show the current characters length. Type: Number.
maxCharacters
Description: Maximum text length allowed. Type: Number. Default: 120.
labelValidationStyle
Description: Characters length LabelValidation style. Type: CSS Properties.
labelValidationClassName
Description: Characters length LabelValidation className. Type: String.
Code
const [text, setText] = useState('') <TextArea onChange={(e: ChangeEvent<HTMLTextAreaElement>) => setText(e.target.value)} showsCharactersCounting currentLength={text.length} />