ErrorPill
The ErrorPill component displays the number of validation errors associated with a field or group of fields. It returns null when the count is zero.
Import
Counts
Pass the i18n object from useTranslation. Add withMessage when the count needs a localized “error” or “errors” label.
Common props
These are the props most commonly used with this component. See its exported types in @payloadcms/ui for the complete list.
Prop | Type | Default | Description |
|---|---|---|---|
| | — | Number of errors. Renders nothing when set to 0. |
| | — | Supplies localized error labels. |
| | | Displays “error” or “errors” after the count. |
| | — | Adds a custom class to the element. |
* An asterisk denotes that a prop is required.
Was this page helpful?