Pace UI

Form Textarea

Forms 4

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

    905
  • Flip Reveal

    Flip Reveal

    636
  • Dot Flow

    Dot Flow

    258
  • Draw Line Text

    Draw Line Text

    103
  • Liquid Glass

    Liquid Glass

    54
  • Liquid Cursor

    Liquid Cursor

    41
  • Layered Stack

    Layered Stack

    33
  • Reveal Text

    Reveal Text

    6

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 2

    Login 2

    7
  • Authentication Card

    Authentication Card

    47
  • Login 1

    Login 1

    52
  • Contact Card

    Contact Card

    1K
  • Login Form

    Login Form

    6
  • Form

    Form

    16
  • Book A Demo 3

    Book A Demo 3

    83

Explore more

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