awaiden

Form

Forms

About

A native HTML form wrapper with consolidated validation error handling and vertical or horizontal layout, built for use with labeled field controls.

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

Code

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

Usage.tsx

"use client";

import { FormRoot } from "@/components/ui/form";
import { Button } from "@/components/ui/button";

export default function FormDemo() {
  return (
    <FormRoot
      className="w-full max-w-sm"
      onSubmit={(event) => {
        event.preventDefault();
      }}
    >
      <div className="flex w-full flex-col gap-1.5">
        <label
          htmlFor="demo-name"
          className="text-sm font-medium text-foreground"
        >
          Name
        </label>
        <input
          id="demo-name"
          name="name"
          placeholder="Jane Doe"
          required
          className="h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-xs outline-none transition-colors focus-visible:outline-2 focus-visible:outline-ring"
        />
      </div>

      <div className="flex w-full flex-col gap-1.5">
        <label
          htmlFor="demo-email"
          className="text-sm font-medium text-foreground"
        >
          Email
        </label>
        <input
          id="demo-email"
          name="email"
          type="email"
          placeholder="jane@example.com"
          required
          className="h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-xs outline-none transition-colors focus-visible:outline-2 focus-visible:outline-ring"
        />
      </div>

      <Button type="submit">Submit</Button>
    </FormRoot>
  );
}

Dependencies

More by awaiden

View all
  • Drawer

    Drawer

  • Toast

    Toast

  • Combobox

    Combobox

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 1

    Login 1

    52
  • Book A Demo 3

    Book A Demo 3

    83
  • Authentication Card

    Authentication Card

    47
  • Book A Demo 1

    Book A Demo 1

    69
  • Contact Card

    Contact Card

    1K
  • Login Card

    Login Card

    32
  • Login 2

    Login 2

    7