NOCTA UI

Textarea

A versatile textarea component with multiple variants, sizes, resize options, and dark mode support

Installation

Install the Textarea component using the nocta-ui CLI:

npx nocta-ui add textarea

Import the component:

import { Textarea } from '@/components/ui/textarea';

Examples

Default Textarea

Textarea with Label

Textarea with Helper Text

Provide a detailed description of your project goals and requirements

Variants

The Textarea component supports three variants: default, error, and success.

Description is required

Description looks good!

Sizes

Three size options are available: sm, md, and lg. The default size is md.

Resize Options

Control how the textarea can be resized with the resize prop.

Resize is disabled

Can be resized vertically

Can be resized horizontally

Can be resized in both directions

Row Configuration

Adjust the initial height of the textarea using the rows prop.

Textarea States

Disabled State

This field is disabled

Read-only State

This field is read-only

Character Limit

Maximum 250 characters allowed

API Reference

PropTypeDefaultDescription
variant'default' | 'error' | 'success''default'Visual variant of the textarea
size'sm' | 'md' | 'lg''md'Size of the textarea
labelstringundefinedLabel text displayed above the textarea
helperTextstringundefinedHelper text displayed below the textarea
errorMessagestringundefinedError message (shown when variant is 'error')
resize'none' | 'vertical' | 'horizontal' | 'both''vertical'Resize behavior of the textarea
rowsnumber4Initial number of visible text lines
classNamestring''Additional CSS classes for the textarea element
containerClassNamestring''Additional CSS classes for the container

All standard HTML textarea attributes are also supported through props spreading.