- Implementation
- FieldMessage Props
Common Examples
Multiple Errors
Theerror prop accepts a string array to display multiple errors at once.Warning Messages
Thewarning prop accepts a string or string array.Errors and Warnings Together
Persistent Hints
Hints are now always visible, even when errors or warnings are present. Previously, the hint was hidden when anerrorMessage was displayed. This change makes hints more useful as persistent contextual guidance.Accessibility
Error messages always usearia-live="assertive" and warning messages always use aria-live="polite". These values are hardcoded to ensure a consistent and accessible experience.For accessibility, the FieldMessage component accepts an id prop that can be used to establish a relationship between the contents of the FieldMessage and the form component you are associating it with. To do this, you will likely need to use an ARIA attribute such as aria-describedby. See MDN docs.Related
- Errors and Warnings pattern — Guidance on surfacing errors and warnings across the app.
- Forms pattern — Best practices for form layout, labels, and help text.