Mohamed Uvaish

Textarea

Forms

About

Textarea that grows with its content up to maxRows, with a character counter that appears near the limit and turns red at it. Works inside a Field. Part of the Layro System: layro.vercel.app.

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

import * as React from "react";
import { Field, Textarea } from "@/components/ui/layro-textarea";

/* The textarea grows with what you write and stops at maxRows. The
   counter only appears near the limit, and turns red at it; there is no
   point showing "12/280" to someone who has written twelve characters. */

export default function TextareaDemo() {
  return (
    <div className="flex min-h-screen w-full items-center justify-center bg-background p-6">
      <div className="w-full min-w-0 rounded-[18px] [corner-shape:squircle] bg-card p-6 text-card-foreground ring-1 ring-border" style={{ maxWidth: 440 }}>
        <h2 className="text-[16px] font-semibold tracking-[-0.01em]">Cancel subscription</h2>
        <p className="mt-1 mb-5 text-[13px] text-muted-foreground">Your plan stays active until 14 Oct.</p>
        <Field label="Reason for leaving" optional hint="Grows as you type; the counter appears near the limit">
          <Textarea
            maxLength={180}
            placeholder="What would have made you stay?"
            defaultValue="We moved the team to another tool after the merger, and nobody set up single sign-on for us before the renewal date."
          />
        </Field>
      </div>
    </div>
  );
}

Dependencies

More by Mohamed Uvaish

View all
  • Signature Pad

    Signature Pad

    419
  • Folder Card

    Folder Card

    334
  • Share Dialog

    Share Dialog

    308
  • Kanban Board

    Kanban Board

    241
  • Notification Panel

    Notification Panel

    100
  • Charts & KPI Cards

    Charts & KPI Cards

    83
  • Rich Text Editor

    Rich Text Editor

    43
  • Data Table

    Data Table

    32

More in Forms

View all
  • Premium Auth

    Premium Auth

    495
  • Authentication Card

    Authentication Card

    44
  • Login 1

    Login 1

    52
  • Login 2

    Login 2

    7
  • Form

    Form

    32
  • Card Studio

    Card Studio

    41
  • Form

    Form

    136
  • Login Card

    Login Card

    32