Error alert example

With data attributes

The example shown applies a tracking attribute specifically for use by Google Tag Manager in Content Publisher.

Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the GA4 link tracker.

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/error_alert", {
  message: "Message to alert the user to a unsuccessful action goes here",
  description: "A further description",
  data_attributes: {
    tracking: "GTM-123AB"
  }
} %>