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
  • Task List

    Task List

    8
  • Uai Blocks Community Feed

    Uai Blocks Community Feed

    5
  • Reaction Bar

    Reaction Bar

    3
  • Cart Item

    Cart Item

  • Quantity Picker

    Quantity Picker

  • Comment

    Comment

  • Metric Card

    Metric Card

More in Forms

View all
  • Form

    Form

    7
  • Login 2

    Login 2

    16
  • Contact Form

    Contact Form

    32
  • Book A Demo 1

    Book A Demo 1

    95
  • Contact Card

    Contact Card

    1.1K
  • Premium Auth

    Premium Auth

    613
  • Authentication Card

    Authentication Card

    52
  • Form

    Form

    18