Skip to main content
K
Last modified: 24/Jun/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
false
#isReadOnly
boolean
Set the readonly state of textarea
false
#isBorderless
boolean
false
#hasAutoFocus
boolean
Set that the textarea should be focused when rendered
false
#hasAutoGrow
boolean
Set that the textarea should grow when content exceeds set number of rows
false
#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 the Textarea component processed by stratus
  • TextareaInterface: TextareaProps extended by TextareaHTMLAttributes<HTMLTextAreaElement>

Read more about types here