Ir para o conteúdo

Form Error Summary

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

Navegadores
Chrome 123+Firefox 121+Safari 17.5+
Nível
0
Limite de layout forçado
0 ms
Limite do axe
0
Compatível com SSR
Sim
Contrato publicado
Ambiente de teste

Experimentar

Form Error Summary

There is a problem

Enter a valid email address

Use at least 8 characters

Exemplos

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

PropTipoPadrãoDescrição
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)—Substitua o elemento renderizado preservando comportamento e conexões de acessibilidade.

Teclado

TeclaAção

Acessibilidade

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.

Pontos de integração de estilos

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