yarn add @twilio-paste/textarea - or - yarn add @twilio-paste/core
import {TextArea} from '@twilio-paste/core/textarea';
import {Label} from '@twilio-paste/core/label';
import {HelpText} from '@twilio-paste/core/help-text';
const Component = () => (
<>
<Label htmlFor="foo" required>
foo
</Label>
<TextArea onChange={() => {}} aria-describedby="foo_text" id="foo" name="foo" placeholder="foo" required />
<HelpText id="foo_text">Enter some text.</HelpText>
</>
);
disabled
Disables the textarea.
- Type
boolean
element
Overrides the default element name to apply unique styles with the Customization Provider.
- Type
string
- Default
TEXTAREA
hasError
Sets the textarea to an error state.
- Type
boolean
height
The height of the textarea is strictly controlled by the component
- Type
never
id
Sets the id of the textarea. Should match the htmlFor of Label
.
- Type
string
insertAfter
Ability to insert icon or other element to the left of the textarea.
- Type
| string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
insertBefore
Ability to insert icon or other element to the right of the textarea.
- Type
| string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
name
Sets the name of the textarea.
- Type
string
placeholder
Sets the placeholder of the textarea.
- Type
string
readOnly
Sets the input to readonly.
- Type
boolean
required
Sets the input as required.
- Type
boolean
resize
Sets the resize property of the textarea. We only support vertical resizing.
- Type
"none" | "vertical"
- Default
none
size
The size of the textarea is strictly controlled by the component
- Type
never
variant
Choose between default or inverse styles for the textarea.
- Type
TextAreaVariants
- Default
default
width
The width of the textarea is strictly controlled by the component
- Type
never
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
about
- Type
string
accessKey
- Type
string
aria-activedescendant
Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
- Type
string
aria-atomic
Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.
- Type
Booleanish
aria-autocomplete
Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.
- Type
"none" | "list" | "inline" | "both"
aria-busy
Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.
- Type
Booleanish
aria-checked
Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
- Type
boolean | "true" | "false" | "mixed"
aria-colcount
Defines the total number of columns in a table, grid, or treegrid.
- Type
number
aria-colindex
Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
- Type
number
aria-colspan
Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
- Type
number
aria-controls
Identifies the element (or elements) whose contents or presence are controlled by the current element.
- Type
string
aria-current
Indicates the element that represents the current item within a container or set of related elements.
- Type
| boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date"
aria-describedby
Identifies the element (or elements) that describes the object.
- Type
string
aria-details
Identifies the element that provides a detailed, extended description for the object.
- Type
string
aria-disabled
Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
- Type
Booleanish
aria-dropeffect
Indicates what functions can be performed when a dragged object is released on the drop target.
- Type
"link" | "none" | "copy" | "execute" | "move" | "popup"
aria-errormessage
Identifies the element that provides an error message for the object.
- Type
string
aria-expanded
Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
- Type
Booleanish
aria-flowto
Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.
- Type
string
aria-grabbed
Indicates an element's "grabbed" state in a drag-and-drop operation.
- Type
Booleanish
aria-haspopup
Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
- Type
| boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree"
aria-hidden
Indicates whether the element is exposed to an accessibility API.
- Type
Booleanish
aria-invalid
Indicates the entered value does not conform to the format expected by the application.
- Type
boolean | "true" | "false" | "grammar" | "spelling"
aria-keyshortcuts
Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
- Type
string
aria-label
Defines a string value that labels the current element.
- Type
string
aria-labelledby
Identifies the element (or elements) that labels the current element.
- Type
string
aria-level
Defines the hierarchical level of an element within a structure.
- Type
number
aria-live
Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
- Type
"off" | "assertive" | "polite"
aria-modal
Indicates whether an element is modal when displayed.
- Type
Booleanish
aria-multiline
Indicates whether a text box accepts multiple lines of input or only a single line.
- Type
Booleanish
aria-multiselectable
Indicates that the user may select more than one item from the current selectable descendants.
- Type
Booleanish
aria-orientation
Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
- Type
"vertical" | "horizontal"
aria-owns
Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
- Type
string
aria-placeholder
Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.
- Type
string
aria-posinset
Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
- Type
number
aria-pressed
Indicates the current "pressed" state of toggle buttons.
- Type
boolean | "true" | "false" | "mixed"
aria-readonly
Indicates that the element is not editable, but is otherwise operable.
- Type
Booleanish
aria-relevant
Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
- Type
| "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals"
aria-required
Indicates that user input is required on the element before a form may be submitted.
- Type
Booleanish
aria-roledescription
Defines a human-readable, author-localized description for the role of an element.
- Type
string
aria-rowcount
Defines the total number of rows in a table, grid, or treegrid.
- Type
number
aria-rowindex
Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
- Type
number
aria-rowspan
Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
- Type
number
aria-selected
Indicates the current "selected" state of various widgets.
- Type
Booleanish
aria-setsize
Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
- Type
number
aria-sort
Indicates if items in a table or grid are sorted in ascending or descending order.
- Type
"none" | "ascending" | "descending" | "other"
aria-valuemax
Defines the maximum allowed value for a range widget.
- Type
number
aria-valuemin
Defines the minimum allowed value for a range widget.
- Type
number
aria-valuenow
Defines the current value for a range widget.
- Type
number
aria-valuetext
Defines the human readable text alternative of aria-valuenow for a range widget.
- Type
string
autoCapitalize
- Type
string
autoComplete
- Type
string
autoCorrect
- Type
string
autoFocus
- Type
boolean
autoSave
- Type
string
cols
- Type
number
contentEditable
- Type
Booleanish | "inherit"
contextMenu
- Type
string
dangerouslySetInnerHTML
- Type
{ __html: string }
datatype
- Type
string
defaultChecked
- Type
boolean
defaultValue
- Type
string | number | readonly string[]
dir
- Type
string
dirName
- Type
string
draggable
- Type
Booleanish
form
- Type
string
hidden
- Type
boolean
inlist
- Type
any
inputMode
Hints at the type of data that might be entered by the user while editing the element or its contents
- Type
| "text" | "none" | "search" | "tel" | "url" | "email" | "numeric" | "decimal"
is
Specify that a standard HTML element should behave like a defined custom built-in element
- Type
string
itemID
- Type
string
itemProp
- Type
string
itemRef
- Type
string
itemScope
- Type
boolean
itemType
- Type
string
key
- Type
Key
lang
- Type
string
maxLength
- Type
number
minLength
- Type
number
nonce
- Type
string
onAbort
- Type
ReactEventHandler<HTMLTextAreaElement>
onAbortCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onAnimationEnd
- Type
AnimationEventHandler<HTMLTextAreaElement>
onAnimationEndCapture
- Type
AnimationEventHandler<HTMLTextAreaElement>
onAnimationIteration
- Type
AnimationEventHandler<HTMLTextAreaElement>
onAnimationIterationCapture
- Type
AnimationEventHandler<HTMLTextAreaElement>
onAnimationStart
- Type
AnimationEventHandler<HTMLTextAreaElement>
onAnimationStartCapture
- Type
AnimationEventHandler<HTMLTextAreaElement>
onAuxClick
- Type
MouseEventHandler<HTMLTextAreaElement>
onAuxClickCapture
- Type
MouseEventHandler<HTMLTextAreaElement>
onBeforeInput
- Type
FormEventHandler<HTMLTextAreaElement>
onBeforeInputCapture
- Type
FormEventHandler<HTMLTextAreaElement>
onBlur
- Type
FocusEventHandler<HTMLTextAreaElement>
onBlurCapture
- Type
FocusEventHandler<HTMLTextAreaElement>
onCanPlay
- Type
ReactEventHandler<HTMLTextAreaElement>
onCanPlayCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onCanPlayThrough
- Type
ReactEventHandler<HTMLTextAreaElement>
onCanPlayThroughCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onChange
- Type
ChangeEventHandler<HTMLTextAreaElement>
onChangeCapture
- Type
FormEventHandler<HTMLTextAreaElement>
onClick
- Type
MouseEventHandler<HTMLTextAreaElement>
onClickCapture
- Type
MouseEventHandler<HTMLTextAreaElement>
onCompositionEnd
- Type
CompositionEventHandler<HTMLTextAreaElement>
onCompositionEndCapture
- Type
CompositionEventHandler<HTMLTextAreaElement>
onCompositionStart
- Type
CompositionEventHandler<HTMLTextAreaElement>
onCompositionStartCapture
- Type
CompositionEventHandler<HTMLTextAreaElement>
onCompositionUpdate
- Type
CompositionEventHandler<HTMLTextAreaElement>
onCompositionUpdateCapture
- Type
CompositionEventHandler<HTMLTextAreaElement>
onContextMenu
- Type
MouseEventHandler<HTMLTextAreaElement>
onContextMenuCapture
- Type
MouseEventHandler<HTMLTextAreaElement>
onCopy
- Type
ClipboardEventHandler<HTMLTextAreaElement>
onCopyCapture
- Type
ClipboardEventHandler<HTMLTextAreaElement>
onCut
- Type
ClipboardEventHandler<HTMLTextAreaElement>
onCutCapture
- Type
ClipboardEventHandler<HTMLTextAreaElement>
onDoubleClick
- Type
MouseEventHandler<HTMLTextAreaElement>
onDoubleClickCapture
- Type
MouseEventHandler<HTMLTextAreaElement>
onDrag
- Type
DragEventHandler<HTMLTextAreaElement>
onDragCapture
- Type
DragEventHandler<HTMLTextAreaElement>
onDragEnd
- Type
DragEventHandler<HTMLTextAreaElement>
onDragEndCapture
- Type
DragEventHandler<HTMLTextAreaElement>
onDragEnter
- Type
DragEventHandler<HTMLTextAreaElement>
onDragEnterCapture
- Type
DragEventHandler<HTMLTextAreaElement>
onDragExit
- Type
DragEventHandler<HTMLTextAreaElement>
onDragExitCapture
- Type
DragEventHandler<HTMLTextAreaElement>
onDragLeave
- Type
DragEventHandler<HTMLTextAreaElement>
onDragLeaveCapture
- Type
DragEventHandler<HTMLTextAreaElement>
onDragOver
- Type
DragEventHandler<HTMLTextAreaElement>
onDragOverCapture
- Type
DragEventHandler<HTMLTextAreaElement>
onDragStart
- Type
DragEventHandler<HTMLTextAreaElement>
onDragStartCapture
- Type
DragEventHandler<HTMLTextAreaElement>
onDrop
- Type
DragEventHandler<HTMLTextAreaElement>
onDropCapture
- Type
DragEventHandler<HTMLTextAreaElement>
onDurationChange
- Type
ReactEventHandler<HTMLTextAreaElement>
onDurationChangeCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onEmptied
- Type
ReactEventHandler<HTMLTextAreaElement>
onEmptiedCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onEncrypted
- Type
ReactEventHandler<HTMLTextAreaElement>
onEncryptedCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onEnded
- Type
ReactEventHandler<HTMLTextAreaElement>
onEndedCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onError
- Type
ReactEventHandler<HTMLTextAreaElement>
onErrorCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onFocus
- Type
FocusEventHandler<HTMLTextAreaElement>
onFocusCapture
- Type
FocusEventHandler<HTMLTextAreaElement>
onGotPointerCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onGotPointerCaptureCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onInput
- Type
FormEventHandler<HTMLTextAreaElement>
onInputCapture
- Type
FormEventHandler<HTMLTextAreaElement>
onInvalid
- Type
FormEventHandler<HTMLTextAreaElement>
onInvalidCapture
- Type
FormEventHandler<HTMLTextAreaElement>
onKeyDown
- Type
KeyboardEventHandler<HTMLTextAreaElement>
onKeyDownCapture
- Type
KeyboardEventHandler<HTMLTextAreaElement>
onKeyPress
- Type
KeyboardEventHandler<HTMLTextAreaElement>
onKeyPressCapture
- Type
KeyboardEventHandler<HTMLTextAreaElement>
onKeyUp
- Type
KeyboardEventHandler<HTMLTextAreaElement>
onKeyUpCapture
- Type
KeyboardEventHandler<HTMLTextAreaElement>
onLoad
- Type
ReactEventHandler<HTMLTextAreaElement>
onLoadCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onLoadedData
- Type
ReactEventHandler<HTMLTextAreaElement>
onLoadedDataCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onLoadedMetadata
- Type
ReactEventHandler<HTMLTextAreaElement>
onLoadedMetadataCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onLoadStart
- Type
ReactEventHandler<HTMLTextAreaElement>
onLoadStartCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onLostPointerCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onLostPointerCaptureCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onMouseDown
- Type
MouseEventHandler<HTMLTextAreaElement>
onMouseDownCapture
- Type
MouseEventHandler<HTMLTextAreaElement>
onMouseEnter
- Type
MouseEventHandler<HTMLTextAreaElement>
onMouseLeave
- Type
MouseEventHandler<HTMLTextAreaElement>
onMouseMove
- Type
MouseEventHandler<HTMLTextAreaElement>
onMouseMoveCapture
- Type
MouseEventHandler<HTMLTextAreaElement>
onMouseOut
- Type
MouseEventHandler<HTMLTextAreaElement>
onMouseOutCapture
- Type
MouseEventHandler<HTMLTextAreaElement>
onMouseOver
- Type
MouseEventHandler<HTMLTextAreaElement>
onMouseOverCapture
- Type
MouseEventHandler<HTMLTextAreaElement>
onMouseUp
- Type
MouseEventHandler<HTMLTextAreaElement>
onMouseUpCapture
- Type
MouseEventHandler<HTMLTextAreaElement>
onPaste
- Type
ClipboardEventHandler<HTMLTextAreaElement>
onPasteCapture
- Type
ClipboardEventHandler<HTMLTextAreaElement>
onPause
- Type
ReactEventHandler<HTMLTextAreaElement>
onPauseCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onPlay
- Type
ReactEventHandler<HTMLTextAreaElement>
onPlayCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onPlaying
- Type
ReactEventHandler<HTMLTextAreaElement>
onPlayingCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onPointerCancel
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerCancelCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerDown
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerDownCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerEnter
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerEnterCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerLeave
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerLeaveCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerMove
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerMoveCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerOut
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerOutCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerOver
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerOverCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerUp
- Type
PointerEventHandler<HTMLTextAreaElement>
onPointerUpCapture
- Type
PointerEventHandler<HTMLTextAreaElement>
onProgress
- Type
ReactEventHandler<HTMLTextAreaElement>
onProgressCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onRateChange
- Type
ReactEventHandler<HTMLTextAreaElement>
onRateChangeCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onReset
- Type
FormEventHandler<HTMLTextAreaElement>
onResetCapture
- Type
FormEventHandler<HTMLTextAreaElement>
onResize
- Type
ReactEventHandler<HTMLTextAreaElement>
onResizeCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onScroll
- Type
UIEventHandler<HTMLTextAreaElement>
onScrollCapture
- Type
UIEventHandler<HTMLTextAreaElement>
onSeeked
- Type
ReactEventHandler<HTMLTextAreaElement>
onSeekedCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onSeeking
- Type
ReactEventHandler<HTMLTextAreaElement>
onSeekingCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onSelect
- Type
ReactEventHandler<HTMLTextAreaElement>
onSelectCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onStalled
- Type
ReactEventHandler<HTMLTextAreaElement>
onStalledCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onSubmit
- Type
FormEventHandler<HTMLTextAreaElement>
onSubmitCapture
- Type
FormEventHandler<HTMLTextAreaElement>
onSuspend
- Type
ReactEventHandler<HTMLTextAreaElement>
onSuspendCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onTimeUpdate
- Type
ReactEventHandler<HTMLTextAreaElement>
onTimeUpdateCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onTouchCancel
- Type
TouchEventHandler<HTMLTextAreaElement>
onTouchCancelCapture
- Type
TouchEventHandler<HTMLTextAreaElement>
onTouchEnd
- Type
TouchEventHandler<HTMLTextAreaElement>
onTouchEndCapture
- Type
TouchEventHandler<HTMLTextAreaElement>
onTouchMove
- Type
TouchEventHandler<HTMLTextAreaElement>
onTouchMoveCapture
- Type
TouchEventHandler<HTMLTextAreaElement>
onTouchStart
- Type
TouchEventHandler<HTMLTextAreaElement>
onTouchStartCapture
- Type
TouchEventHandler<HTMLTextAreaElement>
onTransitionEnd
- Type
TransitionEventHandler<HTMLTextAreaElement>
onTransitionEndCapture
- Type
TransitionEventHandler<HTMLTextAreaElement>
onVolumeChange
- Type
ReactEventHandler<HTMLTextAreaElement>
onVolumeChangeCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onWaiting
- Type
ReactEventHandler<HTMLTextAreaElement>
onWaitingCapture
- Type
ReactEventHandler<HTMLTextAreaElement>
onWheel
- Type
WheelEventHandler<HTMLTextAreaElement>
onWheelCapture
- Type
WheelEventHandler<HTMLTextAreaElement>
prefix
- Type
string
property
- Type
string
radioGroup
- Type
string
resource
- Type
string
results
- Type
number
role
- Type
AriaRole
rows
- Type
number
security
- Type
string
slot
- Type
string
spellCheck
- Type
Booleanish
suppressContentEditableWarning
- Type
boolean
suppressHydrationWarning
- Type
boolean
tabIndex
- Type
number
title
- Type
string
translate
- Type
"yes" | "no"
typeof
- Type
string
unselectable
- Type
"on" | "off"
value
- Type
string | number | readonly string[]
vocab
- Type
string
wrap
- Type
string