Text Area

The Text Area component supports multi-line text input with theming, validation states, icons, labels, and accessibility features for richer large input handling.

Usage

Default

const [value, setValue] = useState("");

<TextArea
  value={value}
  onChange={(nextValue) => setValue(nextValue)}
  placeholder="Enter your message..."
/>

With Label

const [value, setValue] = useState("");

<TextArea
  label="Message"
  labelPosition="top"
  value={value}
  onChange={(nextValue) => setValue(nextValue)}
  placeholder="Write your message..."
/>

With Icon

const [value, setValue] = useState("");

<TextArea
  icon={FaCommentDots}
  value={value}
  onChange={(nextValue) => setValue(nextValue)}
  placeholder="Leave a comment..."
/>

Validation States

<TextArea state="success" defaultValue="Looks good" />
<TextArea state="warning" defaultValue="Needs review" />
<TextArea state="error" defaultValue="Missing required details" />

Fixed Height

const [value, setValue] = useState("");

<TextArea
  height="160px"
  value={value}
  onChange={(nextValue) => setValue(nextValue)}
  placeholder="A taller textarea for longer content..."
/>

Non-Resizable

<TextArea
  resizable={false}
  defaultValue="This textarea cannot be resized."
/>

With Accessible Description

Use this field to describe your experience with the product.
<TextArea
  label="Experience"
  ariaDescription="Use this field to describe your experience with the product."
  placeholder="Describe your experience..."
/>

Props

Data table
TypeDescription
aria-describedbystringLegacy accessible description text rendered internally as visually hidden content. Prefer using `aria-describedby` when referencing external help text.
aria-labelstringLegacy accessible label prop. Prefer using `aria-label`.
autocompletebooleanEnables or disables autocomplete.
classNamestringAdditional custom CSS class name(s) to apply to the wrapper.
data-testidstringOptional test ID for testing frameworks.
describedBystringOptional id of external descriptive content. This will be merged with internally generated description ids.
disabledbooleanIf true, the textarea is disabled.
errorMessageReactNodeOptional error message shown below the textarea.
heightstring | numberOptional height for the textarea.
helperTextReactNodeOptional helper text shown below the textarea.
iconComponentType<{ className?: string; "aria-hidden"?: boolean; }>Optional icon to display alongside the textarea.
labelstringOptional visible label for the textarea.
labelPositionLabelPositionTypePosition of the label relative to the textarea.
onChange((value: string, event: ChangeEvent<HTMLTextAreaElement>) => void)Called when the textarea value changes. Receives the current string value and the original change event.
outlinebooleanIf true, the textarea is styled with an outline.
placeholderstringPlaceholder text for the textarea.
readOnlybooleanIf true, renders the textarea as read-only.
resizablebooleanIf false, the textarea is not resizable.
roundingRoundingTypeRounding of the component.
shadowShadowTypeShadow of the component.
stateStateTypeState of the text area.
themeThemeTypeTheme used for styling.