본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Notification banner

원문 보기 위키 갱신

페이지 콘텐츠와 직접 관련되지는 않지만 사용자가 알아야 할 것을 알려줄 때 쓰는 컴포넌트예요.

출처: 문서

본문

notification banner를 사용해서, 페이지 콘텐츠와 직접 관련되지는 않지만 사용자가 알아야 할 것을 알려주세요.

<div class="govuk-notification-banner" role="region" aria-labelledby="govuk-notification-banner-title" data-module="govuk-notification-banner">
  <div class="govuk-notification-banner__header">
    <h2 class="govuk-notification-banner__title" id="govuk-notification-banner-title">
      Important
    </h2>
  </div>
  <div class="govuk-notification-banner__content">
    <p class="govuk-notification-banner__heading">
      You have 7 days left to send your application.
      <a class="govuk-notification-banner__link" href="#">View application</a>.
    </p>
  </div>
</div>
{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner %}

{% call govukNotificationBanner() %}
  <p class="govuk-notification-banner__heading">
    You have 7 days left to send your application.
    <a class="govuk-notification-banner__link" href="#">View application</a>.
  </p>
{% endcall %}

When to use this component

notification banner는 사용자가 그 페이지에서 하려는 일과 직접 관련되지 않은 것을 알려줄 때 사용해요. 예를 들어:

  • 서비스 전체에 영향을 주는 문제를 사용자에게 알릴 때 (예: 긴급 상황으로 신청 처리가 지연되는 경우)
  • 특히 사용자에게 영향을 주는 일을 알릴 때 (예: 다가오는 마감 기한)
  • 앞선 페이지에서 방금 한 일의 결과를 사용자에게 알릴 때 (예: 이메일이 전송되었음을 확인)

When not to use this component

notification banner를 아껴서 사용하세요. 사람들이 종종 이를 놓친다는 증거가 있고, 너무 자주 사용하면 이 문제가 더 악화될 가능성이 커요.

정보가 사용자가 그 페이지에서 하는 일과 직접 관련된다면, 본문 콘텐츠에 넣으세요. 눈에 띄게 할 필요가 있다면 Inset text 컴포넌트나 Warning text 컴포넌트를 사용하세요.

하지 말아야 할 것:

  • 검증 오류를 알리기 위해 notification banner를 사용하지 마세요. 대신 Error message 컴포넌트와 Error summary 컴포넌트를 사용하세요
  • 같은 페이지에 notification banner와 Error summary 컴포넌트를 함께 보여주지 마세요. 오류 요약만 보여주세요

How it works

notification banner를 페이지 h1 바로 앞에 배치하세요. notification banner는 컴포넌트, 제목, 본문 텍스트 같은 페이지의 다른 콘텐츠와 같은 너비여야 해요. 예를 들어 데스크톱 기기에서 다른 콘텐츠가 화면의 2/3를 차지한다면, notification banner도 2/3를 차지해야 해요. 페이지를 배치하는 방법에 대해 읽어보세요.

화면 낭독기 사용자가 notification banner로 이동할 수 있도록 role="region"과 aria-labelledby="govuk-notification-banner-title"(h2에 id="govuk-notification-banner-title"를 함께)을 사용하세요.

같은 페이지에 notification banner를 두 개 이상 보여주지 마세요. 대신 메시지를 하나의 notification banner로 결합하세요. 메시지가 너무 달라 결합할 수 없다면, 우선순위가 가장 높은 notification banner만 보여주세요.

Notification banner headings

govuk-notification-banner__content 안에서 ```로 시작하는 제목을 사용해 콘텐츠를 구조화할 수 있어요.

제목이 필요 없는 단일 줄 알림에는 제목 사용을 피하세요.

Telling the user about a problem that affects the whole service

서비스 전체에 문제가 있다는 것을 사용자가 알아야 한다면 '중립적인(neutral)' 파란색 notification banner를 사용하세요. 예를 들어:

  • 무언가를 등록하거나 신청하게 하는 서비스에서, 긴급 상황 때문에 신청 처리가 평소보다 오래 걸린다는 것을 사용자가 알아야 할 수 있어요
  • 계정형 서비스에서, 예정된 유지보수로 서비스가 중단될 것이라는 것을 사용자가 알아야 할 수 있어요
<div class="govuk-notification-banner" role="region" aria-labelledby="govuk-notification-banner-title" data-module="govuk-notification-banner">
  <div class="govuk-notification-banner__header">
    <h2 class="govuk-notification-banner__title" id="govuk-notification-banner-title">
      Important
    </h2>
  </div>
  <div class="govuk-notification-banner__content">
    There may be a delay in processing your application because of the coronavirus outbreak.
  </div>
</div>
{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner %}

{% call govukNotificationBanner() %}
  There may be a delay in processing your application because of the coronavirus outbreak.
{% endcall %}

서비스가 GOV.UK에 있고 긴급 상황의 영향을 받는다면, 부서의 콘텐츠 팀에 GOV.UK 콘텐츠에 이를 연결하는 다운타임 메시지 추가 요청을 하세요. 서비스가 평소보다 더 많은 수요를 받고 있다면, '서비스에 문제가 있음' 페이지와 '서비스 이용 불가' 페이지를 설정했는지, 문구가 최신 상태인지 확인하세요.

Telling the user about something that's happening elsewhere

서비스의 다른 곳에서 일어나는 일을 사용자가 알아야 한다면 '중립적인' notification banner를 사용하세요. 예를 들어:

  • 사건 처리 시스템에서, 사용자가 처리해야 할 새 사건이 있다는 것을 알아야 할 수 있어요
  • 계정형 서비스에서, 마감이 다가오거나 결제가 연체되었음을 알려야 할 수 있어요
<div class="govuk-notification-banner" role="region" aria-labelledby="govuk-notification-banner-title" data-module="govuk-notification-banner">
  <div class="govuk-notification-banner__header">
    <h2 class="govuk-notification-banner__title" id="govuk-notification-banner-title">
      Important
    </h2>
  </div>
  <div class="govuk-notification-banner__content">
    <p class="govuk-notification-banner__heading">
      You have 7 days left to send your application.
      <a class="govuk-notification-banner__link" href="#">View application</a>.
    </p>
  </div>
</div>
{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner %}

{% call govukNotificationBanner() %}
  <p class="govuk-notification-banner__heading">
    You have 7 days left to send your application.
    <a class="govuk-notification-banner__link" href="#">View application</a>.
  </p>
{% endcall %}

Reacting to something the user has done

notification banner를 사용해 사용자가 방금 한 일의 결과를 알릴 수도 있어요. 다만 사용자가 아직 현재 여정을 끝내지 않았으므로, 서비스의 이 지점에서 Confirmation page를 사용하는 것은 적절하지 않아요.

선형(linear) 서비스에서는 notification banner를 사용하는 것이 올바른 접근이 아닐 가능성이 커요. 예를 들어 무언가를 등록하거나 신청하게 하는 서비스처럼요. 선형 서비스에서는 보통 '한 페이지에 하나의 일(one thing per page)' 방식을 따르고 notification banner 사용을 피하는 것이 맞아요.

선형 서비스에서는 notification banner 대신 Confirmation page를 사용해 사용자에게 서비스 이용을 끝냈음을 알리세요.

사용자가 기대했던 일이 일어났음을 확인하려면 notification banner의 초록색 버전을 사용하세요.

<div class="govuk-notification-banner govuk-notification-banner--success" role="alert" aria-labelledby="govuk-notification-banner-title" data-module="govuk-notification-banner">
  <div class="govuk-notification-banner__header">
    <h2 class="govuk-notification-banner__title" id="govuk-notification-banner-title">
      Success
    </h2>
  </div>
  <div class="govuk-notification-banner__content">
    <h3 class="govuk-notification-banner__heading">
      Training outcome recorded and trainee withdrawn
    </h3>
    <p class="govuk-body">Contact <a class="govuk-notification-banner__link" href="#">example@department.gov.uk</a> if you think there's a problem.</p>
  </div>
</div>
{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner %}

{% call govukNotificationBanner({
  type: "success"
}) %}
  <h3 class="govuk-notification-banner__heading">
    Training outcome recorded and trainee withdrawn
  </h3>
  <p class="govuk-body">Contact <a class="govuk-notification-banner__link" href="#">example@department.gov.uk</a> if you think there's a problem.</p>
{% endcall %}

사용자가 방금 한 일의 결과를 알리는 데 notification banner를 사용하므로, role="alert"을 추가해 페이지 로드 시 초점이 notification banner로 이동하도록 하세요.

사용자가 새 페이지로 이동하면 초록색 notification banner를 제거하세요.

초록색 버전의 notification banner를 접근성 있게 만들려면:

  • 'Success' 같은 제목을 사용해 의미를 전달하는 데 색상에만 의존하지 않도록 하세요. 이는 WCAG 2.2 성공 기준 1.4.1 Use of colour를 충족하기 위해서예요
  • 같은 서비스 안의 초록색 notification banner에는 같은 제목을 사용해 같은 방식으로 작동하는 컴포넌트를 일관되게 식별하세요. 이는 WCAG 2.2 성공 기준 3.2.4 Consistent identification을 충족하기 위해서예요

Research on this component

이를 이해하려면 더 많은 연구가 필요해요.

  • 사용자가 notification banner에서 중요한 정보를 놓치는 것이 얼마나 흔한지(바로 h1로 건너뛸 수 있는 보조 기술 사용자를 포함해)
  • 사용자가 알림을 해제(dismiss)할 수 있게 하는 것이 때로 도움이 되는지, 그리고 어떻게 할 수 있는지

더 알아보기 (Learn more)

Recent changes

| Date | Changed | Description | | Aug 2022 | GOV.UK Frontend v4.3.0 | Added the ability to pass the html parameter using Nunjucks call syntax. | | Sept 2021 | Guidance | Added more detailed guidance on where to position the notification banner on a page. | | Feb 2021 | Guidance | Added advice on how and when to use heading HTML tags in the component. | | Dec 2020 | GOV.UK Frontend v3.10.1 | Fixed small gap between header and outer border. Explicitly set component's text colour. Updated component to wrap text at two thirds of width-container width. | | Nov 2020 | GOV.UK Frontend v3.10.0 | Component introduced. |

Help improve this component

이 페이지가 유용하고, 관련성 있고, 최신 상태로 유지되도록 하려면 다음과 같이 할 수 있어요.

  • GitHub의 'Notification banner' 토론에 참여하고 연구를 공유하기
  • GitHub에서 변경 제안하기 – GitHub에서 변경 제안하는 방법에 대해 더 알아보기