Validation Summary

The ValidationSummary component collects form issues into an accessible alert or status region.

Usage & Examples

Form Issues

form-issues.tsx
<ValidationSummary
  title="Review these fields"
  description="Two fields need attention before continuing."
  items={[
    { id: "email", message: "Email is required.", href: "#email" },
    "Password must be at least 12 characters.",
  ]}
/>

Props API

41 props
Columns
Validation Summary props API
Default
Description
childrenReactNodeNopropsMain content rendered inside the component after the generated validation list.
classNamestringNostylingAdditional class name for the component root.
containerClassNamestringNopropsAdditional class name for the outer label/component container.
contentClassNamestringNopropsAdditional class name for the content area.
data-testidstringNotestingBackward-compatible alias for test ID attributes.
descriptionReactNodeNopropsSupporting text rendered beneath the title.
descriptionClassNamestringNopropsAdditional class name for the description.
disabledbooleanNopropsfalseWhether the component is disabled.
emptyClassNamestringNopropsAdditional class name for empty-state text.
emptyMessageReactNodeNopropsMessage rendered when there are no validation items and hideWhenEmpty is false.
focusablebooleanNopropstrueWhether the summary should be focusable for programmatic focus.
focusOnMountbooleanNopropsfalseWhether the summary should focus itself when validation items are present.