vijayksingh

Textarea

Forms 5

About

An auto-growing multi-line text input with a character counter that fades in near the limit and shakes if the user types past it.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Textarea to your project and fits it to your theme.

Code

How Textarea is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import * as React from "react";
import Textarea from "@/components/ui/textarea";

export default function TextareaDemo() {
  const [note, setNote] = React.useState("");
  return (
    <div className="grid w-full max-w-[440px] gap-20">
      <Textarea
        aria-label="Note"
        placeholder="Write a note…"
        value={note}
        onChange={(e) => setNote(e.target.value)}
        maxLength={120}
      />
      <Textarea
        aria-label="Invalid note"
        invalid
        defaultValue="This needs a date."
        minRows={2}
      />
      <Textarea
        aria-label="Disabled note"
        disabled
        defaultValue="Read only for now."
        minRows={2}
      />
    </div>
  );
}

Dependencies

More by vijayksingh

View all
  • Weather Widget

    Weather Widget

    133
  • Meter

    Meter

    14
  • Skeleton Loader

    Skeleton Loader

    12
  • Soft Hardware Spinner

    Soft Hardware Spinner

    3
  • Well

    Well

    1
  • Settings List

    Settings List

  • Perfect Preview

    Perfect Preview

  • Line Handles

    Line Handles

More in Forms

View all
  • Premium Auth

    Premium Auth

    593
  • Contact Form

    Contact Form

    28
  • Form

    Form

    4
  • Login 1

    Login 1

    70
  • Book A Demo 1

    Book A Demo 1

    94
  • Contact Card

    Contact Card

    1.1K
  • HeroUI Field Error

    HeroUI Field Error

    13
  • Form [react-aria-components]

    Form [react-aria-components]

    19