Victor Mesquita

Form Error Summary

Forms

About

A dismissible form submission error summary that lists field errors as links which jump to and focus the matching invalid input.

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

Code

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

Usage.tsx

"use client";

import {
  FormErrorSummary,
  FormErrorSummaryTitle,
  FormErrorSummaryList,
  FormErrorSummaryLink,
} from "@/components/ui/form-error-summary";

export default function FormErrorSummaryDemo() {
  return (
    <div className="w-full max-w-md">
      <FormErrorSummary focusOnMount>
        <FormErrorSummaryTitle />
        <FormErrorSummaryList>
          <FormErrorSummaryLink fieldId="email">
            Email is required
          </FormErrorSummaryLink>
          <FormErrorSummaryLink fieldId="password">
            Password must be at least 8 characters
          </FormErrorSummaryLink>
        </FormErrorSummaryList>
      </FormErrorSummary>
      <div className="mt-4 grid gap-3">
        <label htmlFor="email" className="text-sm font-medium text-foreground">
          Email
        </label>
        <input
          id="email"
          className="h-9 rounded-md border border-input bg-background px-3 text-sm text-foreground"
          placeholder="you@example.com"
        />
        <label
          htmlFor="password"
          className="text-sm font-medium text-foreground"
        >
          Password
        </label>
        <input
          id="password"
          type="password"
          className="h-9 rounded-md border border-input bg-background px-3 text-sm text-foreground"
        />
      </div>
    </div>
  );
}

Dependencies

More by Victor Mesquita

View all
  • Data Table Toolbar

    Data Table Toolbar

    10
  • Uai Blocks Community Feed

    Uai Blocks Community Feed

    5
  • Task List

    Task List

    4
  • Status Banner

    Status Banner

  • Sign-up Card

    Sign-up Card

  • Password Recovery

    Password Recovery

  • Calendar View

    Calendar View

  • Document Field

    Document Field

More in Forms

View all
  • Premium Auth

    Premium Auth

    606
  • Contact Form

    Contact Form

    28
  • Book A Demo 1

    Book A Demo 1

    95
  • Contact Card

    Contact Card

    1.1K
  • Form

    Form

    6
  • Login 2

    Login 2

    16
  • Book A Demo 4

    Book A Demo 4

    69
  • Form

    Form

    4