Error summary
Use an error summary at the top of a page to summarise errors made by the user.
An error details component should be used alongside this to show where the errors have been made.
How to use this component
When using this component, make sure you are following the correct errors pattern.
You should not typically need to call the onsError()
macro yourself as it is already called from within form input components, and can be set using the error object.
However, if you need to create a pattern or component that requires an error you can use nunjucks' call functionality (opens in a new tab) .
Name | Type | Required | Description |
---|---|---|---|
text | string | true | The text describing the error |
id | string | true | The HTML id attribute that the error summary link can anchor to |
attributes | object | false | HTML attributes (for example, data attributes) to add to the field |
Help improve this page
Let us know how we could improve this page, or share your user research findings. Discuss the ‘Panel’ component on GitHub (opens in a new tab)