Cookies on

Cookies are small files stored on your device when you visit a website. We use some essential cookies to make this website work.

We would like to set additional cookies to remember your settings and understand how you use the site. This helps us to improve our services.

You have accepted all additional cookies. You have rejected all additional cookies. You can change your cookie preferences at any time.

Skip to main content

Panel - announcement

Use an announcement panel is used to display important messages that should be seen by all users but are not directly related to the page content. For example, issues with an entire service.

Example Panel With Announcement contents


{% from "components/panel/_macro.njk" import onsPanel %}

{% call onsPanel({
        "type": 'announcement'

<p class="ons-u-mb-no">National lockdown: stay at home</p>

<div class="ons-u-fs-r">
    <p>Coronavirus (COVID-19) remains a serious threat across the country. <a href="#0">Find out more</a></p>

{% endcall %}

Nunjucks macro options

bodystringtrueThe contents of the panel. This can contain HTML.
titlestringfalseThe title for the error summary panel
titleTagstringfalseThe HTML heading tag for the title. Use to ensure the title has a correct semantic order on the page. Will default to an h2
typestringfalseA single value to adjust the component using available variants: “success”, “warn”, “ghost”, “bare”, “error”, “branded”, “warn-branded”, and “announcement”
spaciousbooleanfalseSet to “true” to double the padding spacing surrounding the body content if required
classesstringfalseCustom classes to add to the panel
idstringfalseThe HTML id for the panel
attributesobjectfalseHTML attributes to apply to the panel (for example, data attributes)
assistiveTextPrefixstringfalseSets the visually hidden prefix text for screen readers. Default values for each panel type:
  • information and branded – “Important information: ”
  • success – “Completed: ”
  • warn and warn-branded – “Warning: ”
  • error– “Error: ”
iconTypestringfalseAdds an icon to the panel, before the body content, by setting the icon type
iconSizestringfalseIcon size can be set to match the size of the body content text as detailed in the typography type scale


<div class="ons-announcement">
  <div class="ons-container">
    <div class="ons-panel ons-panel--announcement ons-panel--no-title">
      <span class="ons-panel__icon" aria-hidden="true"><svg class="" xmlns="" width="24px"
          height="24px" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
      <span class="ons-panel__assistive-text ons-u-vh">Announcement: </span>
      <div class="ons-panel__body">
        <p class="ons-u-mb-no">National lockdown: stay at home</p>
        <div class="ons-u-fs-r">
          <p>Coronavirus (COVID-19) remains a serious threat across the country. <a href="#0">Find out more</a></p>

When not to use this component

Do not use this component if the message is not relevant to every user or the message needs to be displayed permanently.

To warn the user of something important, use the warning panel.

To inform the user of an error, use an error details and an error summary.

To highlight important text to users, use the information panel.

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)