Usage
No props are required to display <TextArea>
, but it’s recommended to provide a label
for accessibility.
Help text
To display additional info beneath the input, pass in helpText
.
Tell teammates what you do.
Sizing
When displaying an input in a space-constrained location, you can pass small
, which decreases the padding and font size and sets a smaller minimum height.
Tell teammates what you do.
Dark mode
To display the textarea on a dark background, pass darkMode
.
Tell teammates what you do.
Errors
When displaying an error message, pass error
to highlight the input in red.
Tell teammates what you do.
Placeholders
Placeholder text may be used to provide an example of input to the user.
Disabled
Resizing
By default, <TextArea>
can be dragged from the corner to vertically resize the input. To disable this, pass resize={false}
. Notice the lack of a drag handle in the bottom right.
API Reference
TextArea
Inherits properties from HTMLTextAreaElement
.
Prop | Type | Default |
---|---|---|
darkMode | boolean | false |
disabled | boolean | false |
error | boolean | false |
helpText | string | |
label | string | |
resize | boolean | true |
small | boolean | false |