Pace UI

Form Textarea

Forms 6

About

A textarea form field wired to TanStack Form with a label, error handling, and validation display.

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

Code

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

Usage.tsx

"use client";

import { useForm } from "@tanstack/react-form";

import { Button } from "@/components/ui/button";
import { FormTextarea } from "@/components/ui/form-textarea";

export default function FormTextareaDemo() {
  const form = useForm({
    defaultValues: {
      bio: "",
    },
    onSubmit: async ({ value }) => {
      console.log(value);
    },
  });

  return (
    <form
      onSubmit={(e) => {
        e.preventDefault();
        e.stopPropagation();
        form.handleSubmit();
      }}
      className="flex w-full max-w-sm flex-col gap-4"
    >
      <form.Field
        name="bio"
        validators={{
          onBlur: ({ value }) =>
            !value ? "Please tell us a little about yourself" : undefined,
        }}
      >
        {() => (
          <FormTextarea
            form={form}
            name="bio"
            label="Bio"
            placeholder="Tell us about yourself"
            rows={4}
          />
        )}
      </form.Field>
      <Button type="submit">Submit</Button>
    </form>
  );
}

Dependencies

More by Pace UI

View all
  • Dot Loader

    Dot Loader

    977
  • Flip Reveal

    Flip Reveal

    671
  • Dot Flow

    Dot Flow

    271
  • Draw Line Text

    Draw Line Text

    123
  • Liquid Glass

    Liquid Glass

    65
  • Liquid Cursor

    Liquid Cursor

    51
  • Layered Stack

    Layered Stack

    50
  • Calendar Heatmap Chart

    Calendar Heatmap Chart

    22

More in Forms

View all
  • Form

    Form

    10
  • Contact Form

    Contact Form

    33
  • Premium Auth

    Premium Auth

    616
  • Paper Plane

    Paper Plane

    113
  • Contact Card

    Contact Card

    1.1K
  • Form

    Form

    18
  • Onboarding Stepper

    Onboarding Stepper

    14
  • Input

    Input

    14

Explore more

Part of Pace UI — browse the full library on 21st.dev.