TextArea Component

A form textarea component that provides a clean and accessible way to collect multi-line user input.

  • Accessible textarea implementation
  • Support for resizing
  • Customizable styling
  • Error state handling
  • Label integration
  • Placeholder support

Installation

The TextArea component is part of our UI library. You can import it directly from the components directory.


Usage

Here is how to use the textarea in your project.

React TSX
1import { Textarea } from "@/components/modern-ui/textarea"

React TSX
1<Textarea placeholder="Enter your message" />

Examples

Basic TextArea

TextArea with Label

TextArea with Error

Bio is required

API Reference

Textarea

PropTypeDefaultDescription
valuestring-The controlled value of the textarea
defaultValuestring-The default value of the textarea
onChange(event: React.ChangeEvent<HTMLTextAreaElement>) => void-Event handler called when the value changes
placeholderstring-Placeholder text
disabledbooleanfalseWhether the textarea is disabled
requiredbooleanfalseWhether the textarea is required
namestring-The name of the textarea
idstring-The id of the textarea
classNamestring-Additional CSS classes

Additionally, all standard HTML textarea attributes are supported.