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 & Examples

Default

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

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

With Label

with-label.tsx
const [value, setValue] = useState("");

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

With Icon

with-icon.tsx
const [value, setValue] = useState("");

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

Validation States

validation-states.tsx
<TextArea state="success" defaultValue="Looks good" />
<TextArea state="warning" defaultValue="Needs review" />
<TextArea state="error" defaultValue="Missing required details" />

Fixed Height

fixed-height.tsx
const [value, setValue] = useState("");

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

Non-Resizable

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

With Accessible Description

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

Props API

32 props
Columns
Text Area props API
Default
Description
aria-describedbystringNoariaLegacy accessible description text rendered internally as visually hidden content. Prefer using `aria-describedby` when referencing external help text.
aria-labelstringNoariaLegacy accessible label prop. Prefer using `aria-label`.
autocompletebooleanNopropsfalseEnables or disables autocomplete.
classNamestringNostylingAdditional custom CSS class name(s) to apply to the wrapper.
containerClassNamestringNopropsAdditional class names for the outer layout container.
data-testidstringNotestingBackward-compatible alias for test ID attributes.
describedBystringNopropsOptional id of external descriptive content. This will be merged with internally generated description ids.
disabledbooleanNopropsfalseIf true, the textarea is disabled.
errorMessageReactNodeNopropsOptional error message shown below the textarea.
errorMessageClassNamestringNopropsAdditional class names for the error message.
glassbooleanNopropsconfigured default glass setting (fallback: false)Adds translucent glass styling to the textarea wrapper.
heightstring | numberNopropsOptional height for the textarea.