The Textarea is a multi-line text input control allows users to enter any combination of letters, numbers, or symbols. It adds default styles to the native
<textarea> HTML tag, providing a consistent and visually appealing appearance out of the box. The component supports autoresizing based on the content entered by the user and provides the option to display a character count.
SfTextarea comes with out-of-the-box styles for a disabled Textarea.
SfTextarea comes with out-of-the-box styles for a readonly Textarea.
If you pass the
invalid prop, the Textarea will be styled to indicate an invalid state.
The Textarea component provides the option to display a character count, allowing users to track the number of characters they have entered. This feature can be helpful when there are character limits or restrictions for the input.
The Textarea component supports autoresizing based on the content entered by the user. As the user types or deletes text, the height of the textarea adjusts automatically to fit the content, eliminating the need for scrollbars. In the example below we use
@frsource/autoresize-textarea (opens new window) library to provide this feature.
Textarea is multi-line input, so Return or Enter key inserts a line break.