1. Government Frontend Component Guide
  2. Success alert

Component

Success alert

Used at the top of the page, to summarise a successful user action.

How it looks (preview all)

How to call this component

<%= render "govuk_publishing_components/components/success_alert", {
  message: "Message to alert the user to a successful action goes here"
} %>

Accessibility acceptance criteria

  • should be focused on page load, to ensure the message is noticed by assistive tech
  • Should have a role of ‘alert’ to communicate that is a important and time sensitive message

Other examples

With message and description (preview)

<%= render "govuk_publishing_components/components/success_alert", {
  message: "Message to alert the user to a successful action goes here",
  description: "A further description"
} %>

Long example (preview)

<%= render "govuk_publishing_components/components/success_alert", {
  message: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut aliquet
    dignissim dui, ac laoreet tortor vulputate nec. Aenean quis turpis
    orci. Proin semper porttitor ipsum, vel maximus justo rutrum vel.
    Morbi volutpat facilisis libero. Donec posuere eget odio non egestas.
    Nullam sed neque quis turpis.
    "
} %>