Textarea

Textarea is a component used to obtain multi-line text input.

Usage

import { Textarea } from "@yamada-ui/react"
<Textarea />

Change Variants

Change Size

Change Color Scheme

Disable

To disable the input, set disabled to true.

Read-Only

To read-only, set readOnly to true.

Invalid

To set invalid state, set invalid to true.

Change Border Color

To change the border color, set a color to focusBorderColor or errorBorderColor.

Customize Placeholder

To change the placeholder color, set _placeholder to the props.

Change Resize Behavior

To change the resize behavior, set resize to one of "block", "horizontal", "vertical", or "none".

Use Auto-resize

To enable auto-resizing, set autosize to true.

Control Resize

Props

Accessibility

If you are not using Field.Root, set aria-label or aria-labelledby to Textarea.

<Textarea aria-label="Comments" />
<VStack gap="sm">
  <Text as="h3" id="label">
    Comments
  </Text>

  <Textarea aria-labelledby="label" />
</VStack>

ARIA Roles and Attributes

ComponentRoles and AttributesUsage
Textareaaria-invalidSets to "true" if invalid is set.
aria-disabledSets to "true" if disabled is set.
aria-describedbyIf Textarea is within a Field.Root and Field.Root has an errorMessage, helperMessage, or a Field.ErrorMessage, Field.HelperMessage, sets its id.
aria-readonlySets to "true" if readOnly is set.
aria-requiredSets to "true" if required is set.