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.

Similar Components

Editable

Editable is a component used to obtain inline editable text input.

Input

Input is a component used to obtain text input from the user.

NumberInput

NumberInput is a component used to obtain numeric input from the user.

PasswordInput

PasswordInput is a component that allows users to input passwords with a visibility toggle.

PinInput

PinInput is a component used to capture pin codes or OTP (One-Time Password) inputs.

FileInput

FileInput is a component used for users to select files.

Autocomplete

Autocomplete is a component used to display suggestions in response to user text input.

Checkbox

Checkbox is a component used for allowing users to select multiple values from multiple options.

Uses Components & Hooks