Last modified: 4/Oct/2024
Textarea
Textarea component provides a simple way to write multi-line text inputs.
#Usage
import { Textarea } from '@kinsta/stratus'
const MyComponent = () => (
<Textarea placeholder="Type here..." hasAutoGrow />
)
#Props
The Textarea
components interface extends the
HTMLTextAreaElement
interface. So you can use any props which documented there. Also, you can utilize all the React Synthetic events (on*
),
and props related to styling (className
, style
).
#placeholder
string
Content for the placeholder
#isDisabled
boolean
Set the disabled state of textarea
#isReadOnly
boolean
Set the readonly state of textarea
#isBorderless
boolean
#hasAutoFocus
boolean
Set that the textarea should be focused when rendered
#hasAutoGrow
boolean
Set that the textarea should grow when content exceeds set number of rows
#hasError
boolean
Set the error state of the input
#label
string | ReactElement<any, string | JSXElementConstructor<any>>
Content of the label
#description
string | ReactElement<any, string | JSXElementConstructor<any>>
Content of the description
#errorMessage
string | ReactElement<any, string | JSXElementConstructor<any>>
Content of the error message
#Types
TextareaProps
: props of theTextarea
component processed by stratusTextareaInterface
:TextareaProps
extended byTextareaHTMLAttributes<HTMLTextAreaElement>
Read more about types here