본문 바로가기
명함 만들기 캐릭터 모음 16가지 디자인 · PNG / SVG / PDF

알림 배너

지금 무슨 상황인지 읽지 않으면 다음 행동을 틀리게 되는 자리에 쓰는 조각.

피드백

실제 미리보기

출처

<div class="dc-alert dc-alert--info" role="status">
  <svg class="dc-alert__icon" viewBox="0 0 20 20" aria-hidden="true" focusable="false"><path d="M10 1.6a8.4 8.4 0 1 0 0 16.8 8.4 8.4 0 0 0 0-16.8Zm1 13.2H9V9h2v5.8Zm-1-7.6a1.15 1.15 0 1 1 0-2.3 1.15 1.15 0 0 1 0 2.3Z"/></svg>
  <div class="dc-alert__body">
    <p class="dc-alert__title">제출 기한이 3일 남았습니다</p>
    <p class="dc-alert__text">9월 15일 밤 12시까지 올리지 않은 서류는 이번 분기 심사에서 빠집니다.</p>
  </div>
  <button class="dc-alert__close" type="button"><svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M4.2 4.2l7.6 7.6M11.8 4.2l-7.6 7.6" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg><span class="dc-sr">알림 닫기</span></button>
</div>
.dc-alert {
  display: flex; align-items: flex-start; gap: var(--dc-3);
  padding: var(--dc-4);
  border: 1px solid var(--dc-line);
  border-radius: var(--dc-r-md);
  background: var(--dc-surface);
  font-family: var(--dc-font);
}
.dc-alert__icon { flex: none; width: 20px; height: 20px; margin-top: 1px; fill: currentColor; }
.dc-alert__body { flex: 1 1 auto; min-width: 0; }
.dc-alert__title { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.45; color: var(--dc-text); }
.dc-alert__text { margin: var(--dc-1) 0 0; font-size: 13px; line-height: 1.65; color: var(--dc-text-sub); }
.dc-alert__close {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin: -4px -6px 0 0;
  padding: 0; border: 0; border-radius: var(--dc-r-sm);
  background: transparent; color: var(--dc-text-mute);
  transition: background var(--dc-fast), color var(--dc-fast);
}
.dc-alert__close svg { width: 16px; height: 16px; }
.dc-alert__close:hover { background: color-mix(in srgb, var(--dc-text) 8%, transparent); color: var(--dc-text); }
.dc-alert--info { background: var(--dc-info-soft); border-color: color-mix(in srgb, var(--dc-info) 38%, transparent); }
.dc-alert--info .dc-alert__icon { color: var(--dc-info); }
.dc-alert--ok { background: var(--dc-ok-soft); border-color: color-mix(in srgb, var(--dc-ok) 38%, transparent); }
.dc-alert--ok .dc-alert__icon { color: var(--dc-ok); }
.dc-alert--warn { background: var(--dc-warn-soft); border-color: color-mix(in srgb, var(--dc-warn) 38%, transparent); }
.dc-alert--warn .dc-alert__icon { color: var(--dc-warn); }
.dc-alert--danger { background: var(--dc-danger-soft); border-color: color-mix(in srgb, var(--dc-danger) 38%, transparent); }
.dc-alert--danger .dc-alert__icon { color: var(--dc-danger); }
@media (max-width: 420px) {
  .dc-alert { padding: var(--dc-3); }
}

이렇게 씁니다

  • 색만으로 뜻을 전하지 마라 — 아이콘과 글이 같은 말을 한 번 더 한다
  • 배너는 그 상황이 생긴 자리 바로 위에 둔다
  • 오류 배너에는 무엇을 하면 되는지까지 적는다

주의할 점

  • 심각한 오류만 role=alert 로, 나머지는 role=status 로 둔다 — 아무 말에나 끼어들면 아무 말도 들리지 않는다
  • 앱 화면으로 옮길 때 닫기 버튼의 누름 영역은 44px 로 키운다

다음에 볼 것