{% macro govukNotificationBanner(params) %} {%- if params.type == "success" %} {% set successBanner = true %} {% endif %} {%- if successBanner %} {% set typeClass = "govuk-notification-banner--" + params.type %} {% endif %} {% if params.role %} {% set role = params.role %} {% elif successBanner %} {# If type is success, add `role="alert"` to prioritise the information in the notification banner to users of assistive technologies #} {% set role = "alert" %} {% else %} {# Otherwise add `role="region"` to make the notification banner a landmark to help users of assistive technologies to navigate to the banner #} {% set role = "region" %} {% endif %} {%- if params.titleHtml %} {% set title = params.titleHtml | safe %} {%- elif params.titleText %} {% set title = params.titleText %} {%- elif successBanner %} {% set title = "Success" %} {%- else %} {% set title = "Important" %} {%- endif -%}
{{ title }}
{%- if caller or params.html -%} {{ caller() if caller else params.html | safe }} {%- elif params.text -%} {# Set default style for single line content #}

{{ params.text }}

{%- endif -%}
{% endmacro %}