Pallas UI
DocsComponents
Core Concepts
    • Introduction
    • Getting Started
    • Theming
    • Color Tokens
    • Spacing & Sizing
    • Layout Guide
    • AspectRatio
    • Box
    • Flex
    • Grid
    • Shapes
Previews
    • Accordion
    • Alert
    • Avatar
    • Badge
    • Breadcrumb
    • Button
    • Carousel
    • Checkbox
    • Combobox
    • Command
    • Date Picker
    • Form
    • Input
    • Input OTP
    • Label
    • MenuBar
    • Modal
    • Popover
    • Progress
    • Radio Group
    • ScrollArea
    • Segmented
    • Select
    • Separator
    • Sheet
    • Sidebar
    • Skeleton
    • Slider
    • Spinner
    • Steps
    • Switch
    • Tabs
    • Textarea
    • Toast
    • Tooltip
    • TreeView
    • Typography
  1. Components
  2. Textarea

Textarea

Displays a multi-line text input field.

Installation

Copy and paste the following code into your project

'use client'
 
import { css, cx } from '@styled-system/css'
import { type TextareaVariantProps, textarea } from '@styled-system/recipes'
import type { SystemStyleObject } from '@styled-system/types'
import React from 'react'
 
const resizeClasses = {
  none: css({ resize: 'none' }),
  vertical: css({ resize: 'vertical' }),
  horizontal: css({ resize: 'horizontal' }),
  both: css({ resize: 'both' }),
} as const
 
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> &
  TextareaVariantProps & {
    resize?: keyof typeof resizeClasses
    css?: SystemStyleObject
  }
 
export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
  ({ className, variant, size, radii, resize = 'vertical', css: cssProp, ...props }, ref) => (
    <textarea
      ref={ref}
      className={cx(textarea({ variant, size, radii }), resizeClasses[resize], cssProp && css(cssProp), className)}
      {...props}
    />
  ),
)
Textarea.displayName = 'Textarea'

Update the import paths to match your project setup

Usage

import { Textarea } from '@/components/ui/textarea'
 
<Textarea placeholder="Type your message here." />

Examples

Sizes

Three sizes (sm, md, lg) to match the density of the surrounding form. The default is md.

Loading preview...

Variants

Four visual styles — outline (default), underlined, filled, and borderless — matching the Input component's styling options. Choose based on your form's visual hierarchy.

Loading preview...

Validation States

Apply data-status="error", data-status="success", or data-status="warning" to show contextual feedback. Always pair the visual state with a helper text message — the color change alone is not sufficient for screen readers.

Loading preview...

Border Radii

Adjust corner rounding with the radii prop (sm, md, lg) independently of the variant. Use lg or sm to match the rounding style of surrounding form controls.

Loading preview...

Disabled

Use disabled to prevent interaction when the field is not applicable in the current state. The textarea is visually dimmed to signal its unavailability.

With Button

Pair the Textarea with a Button to build a message input area. Wrap both in a flex container and position the button below or alongside the field.

With Label

Always associate a Label with the Textarea using matching htmlFor and id attributes. This is required for accessible field identification.

With Helper Text

Add a supporting paragraph below the Textarea to provide instructions, character limits, or context about the expected input.

Your message will be copied to the support team.

Form

Full form integration with controlled state, client-side validation, and inline error messaging.

Loading preview...

API Reference

Textarea Props

PropTypeDefaultDescription
variant'outline' | 'underlined' | 'filled' | 'borderless''outline'Visual style of the textarea
size'sm' | 'md' | 'lg''md'Controls text size and padding
radii'sm' | 'md' | 'lg''md'Border radius of the textarea
resize'none' | 'vertical' | 'horizontal' | 'both''vertical'Controls user resize behavior
disabledbooleanfalseDisables the textarea

Built with ❤️ by the carbonteq team. The source code is available on GitHub.

© 2026 Pallas UI. All rights reserved.

You can @mention other users and organizations.