Component size, gzipped: 26kb

Textarea

API

Examples

Basic usage

States



Sizes



Allow the user to resize

By default, Textarea is not resizeable. However, you can use overrides as in the example above to supply minimum and maximum dimensions for the component. This will allow users to resize the Textarea within the boundaries you define.

Focus and ref


Stateful (uncontrolled) usage

As with many of our components, there is also an uncontrolled version, StatefulTextarea, which manages its own state.

API

Textarea props

NameTypeDescription
adjoined
enum
Defines styles for inputs that are grouped with other controls.
aria-describedby
string
Sets aria-describedby attribute.
aria-label
string
Sets aria-label attribute.
aria-labelledby
string
Sets aria-labelledby attribute.
autoComplete
string
Determines if browser should provide value suggestions.
autoFocus
boolean
If true the input will be focused on the first mount.
clearable
boolean
If true, adds a clear value icon button to the end of the input container.
disabled
boolean
Renders component in disabled state.
error
boolean
Renders component in error state.
id
string
Id attribute value to be added to the input element and as a label's for attribute value.
inputMode
string
A hint as to the type of data that might be entered by the user while editing the element or its contents.
inputRef
ref
A ref to access an input element.
max
string
max value when used as input type=number
min
string
min value when used as input type=number
name
string
Name attribute.
onBlur
function
Called the onBlur event triggers.
onChange
function
Called when input value is changed.
onFocus
function
Called the onFocus event triggers.
onKeyDown
function
Called the onKeyDown event triggers.
onKeyPress
function
Called the onKeyPress event triggers.
onKeyUp
function
Called the onKeyUp event triggers.
overrides
custom
Lets you customize all aspects of the component.
pattern
string
A regex that is used to validate the value of the input on form submission.
placeholder
string
Input's placeholder.
positive
boolean
Renders component in positive state.
required
boolean
Renders component in required state.
size
enum
Renders component in provided size.
value
string
Input value attribute.

Textarea exports

You can import this module like so:

import {Textarea} from 'baseui/textarea'

It exports the following components or utility functions: