Form error message example

With items

Error items are a common pattern where a collection of error is passed with each item having a text attribute of the error

How it looks (preview)

Error: Error 1
Error 2

How to call this example

<%= render "govuk_publishing_components/components/error_message", {
  items: [
    {
      text: "Error 1"
    },
    {
      text: "Error 2"
    }
  ]
} %>