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

    960
  • Flip Reveal

    Flip Reveal

    669
  • Dot Flow

    Dot Flow

    267
  • Draw Line Text

    Draw Line Text

    119
  • Liquid Glass

    Liquid Glass

    62
  • Liquid Cursor

    Liquid Cursor

    51
  • Layered Stack

    Layered Stack

    46
  • Calendar Heatmap Chart

    Calendar Heatmap Chart

    10

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

Explore more

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