Textarea

A multi-line text input component with support for visual variants, auto-sizing, and custom header/footer slots.

This component requires the FyskProvider. See Quick Start →

Preview

Textarea
TypeScript
Fysk AI v2.0
Deep Search

Installation

bash
bash
1
npx shadcn@latest add https://fysk.dev/r/textarea.json

Usage

tsx
tsx
1
import { Textarea } from "@/components/ui"
2
3
<Textarea placeholder="Type message here." />

Examples

Stateful States

Textarea supports built-in state management for loading, success, and error states with intelligent icon transitions.

Component
TypeScript

Auto-Sizing

The textarea automatically adjusts its height based on the content length.

Component
TypeScript

Rich Structure

Use the header and footer props to create fully featured text editors or comment boxes.

Component
TypeScript

Features

  • Interactive Feedback: Supports loading, success, and error states with animated icons in the bottom-right corner.

  • Character Counting: Built-in support for showing character counts in the footer, seamlessly integrated with maxLength.

  • Auto-Resize: Built-in logic to expand height dynamically with a configurable maxHeight.

  • Footer & Header Slots: Integrated layout slots for toolbars, labels, or confirmation buttons.

  • Visual Variants: Perfectly aligned with Input styles: glass, secondary, outline, and ghost.

Props

Textarea

PropTypeDefaultDescription
variant"default" | "secondary" | "outline" | "ghost" | "glass""default"The visual aesthetic of the container.
size"xs" | "sm" | "md" | "lg" | "xl""md"The vertical scale and typography of the input field.
state"idle" | "loading" | "success" | "error""idle"The current interaction state and visual feedback.
showCountbooleanfalseDisplays the current character count in the footer area.
autoSizebooleanfalseDynamically adjust height to fit internal content length.
maxHeightnumber-Maximum height when autoSize is enabled.
headerReact.Node-Custom content slot above the text input.
footerReact.Node-Custom content slot below the text input.
headerClassNamestring-Optional CSS class for the header container.
footerClassNamestring-Optional CSS class for the footer container.
iconReact.Node-Custom icon for the idle state.
iconPosition"start" | "end""start"Position of the icon (for idle, success, error, loading).

Accepts all standard HTML textarea attributes and handles focus-within states for structural wrappers automatically.

Built with 💖 | Created by Yashraj