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

    435
  • Folder Card

    Folder Card

    347
  • Share Dialog

    Share Dialog

    313
  • Kanban Board

    Kanban Board

    271
  • Notification Panel

    Notification Panel

    112
  • Charts & KPI Cards

    Charts & KPI Cards

    100
  • Web Shot Button

    Web Shot Button

    57
  • Rich Text Editor

    Rich Text Editor

    50

More in Forms

View all
  • Premium Auth

    Premium Auth

    524
  • Contact Card

    Contact Card

    1K
  • Book A Demo 1

    Book A Demo 1

    73
  • Login 1

    Login 1

    53
  • Form

    Form

    137
  • Card Studio

    Card Studio

    41
  • SignInPage

    SignInPage

    667
  • Modern & Stunning sign in

    Modern & Stunning sign in

    1.6K