Ir al contenido

Form Error Summary

A server-rendered summary linking each error to its field.

Navegadores
Chrome 123+Firefox 121+Safari 17.5+
Nivel
0
Presupuesto de diseño forzado
0 ms
Presupuesto de axe
0
Compatible con SSR
Sí
Contrato publicado
Entorno de pruebas

Zona de pruebas

Form Error Summary

There is a problem

Enter a valid email address

Use at least 8 characters

Ejemplos

A single field error

The summary link focuses the matching field. Keep the same error below the field with aria-describedby; the static summary does not announce or move focus automatically.

There is a problem

Choose a project name

import { FormErrorSummary, Input } from "@gunkin/uiify";

export default function Example() {
  return (
    <form className="example-form" aria-label="Project details">
      <FormErrorSummary aria-label="Project errors" title="There is a problem" errors={[{ href: "#form-error-summary-single-project", message: "Choose a project name" }]} />
      <div className="example-field">
        <label htmlFor="form-error-summary-single-project">Project name</label>
        <Input id="form-error-summary-single-project" name="project" invalid autoComplete="off" aria-describedby="form-error-summary-single-project-error" />
        <p className="example-error" id="form-error-summary-single-project-error">Choose a project name</p>
      </div>
    </form>
  );
}

API

FormErrorSummary

PropTipoPredeterminadoDescripción
title*ReactNode—Visible heading for the summary.
errors*readonly { href: string; message: ReactNode }[]—Each href must target the id of its corresponding field.
className / style / ref / native section propsnative section props—Native section props, styles, events, and ref are forwarded.
renderReactElement | ((props, state) => ReactElement)—Reemplaza el elemento renderizado y conserva las conexiones de comportamiento y accesibilidad.

Teclado

TeclaAcción

Accesibilidad

Static section containing a heading and links to the supplied error targets. Every href must point to a real field id. This summary adds no alert role, live region, focus movement, or validation logic; fields retain their labels and inline aria-describedby relationships. Empty errors render nothing.

Puntos de estilo

data-uiify-form-error-summarydata-part="title|list|item|link"