피드백
알림
페이지의 콘텐츠 흐름 안에서 메시지를 전달하며, 필요에 따라 상태를 지정할 수 있습니다.
이 페이지의 내용
알림은 페이지의 콘텐츠 흐름 안에서 해당 페이지에 관한 메시지를 전달합니다. 평평한 표면에 0.5픽셀 윤곽선이 둘러져 있습니다. 상태에 따라 표면에는 옅게 색이 입혀지고 아이콘에도 상태 색이 적용됩니다. 텍스트는 잉크 색을 유지하며, 색상을 구분하지 않아도 메시지의 의미를 알 수 있습니다.
알림
<div class="alert" role="status"> <svg class="icon alert-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <circle cx="8" cy="8" r="6" /><circle cx="8" cy="5" r="0.5" fill="currentColor" stroke="none" /><path d="M8 8L8 11" /> </svg> <div class="alert-body"> <p class="alert-title">A new version is available</p> <p class="alert-description">Reload to use the latest build of the dashboard.</p> </div> <button type="button" class="btn btn-sm">Reload</button></div>import InfoCircleIcon from '@master/icons-react/native/16/soft/info-circle'<div className="alert" role="status"> <InfoCircleIcon className="icon alert-icon" /> <div className="alert-body"> <p className="alert-title">A new version is available</p> <p className="alert-description">Reload to use the latest build of the dashboard.</p> </div> <button type="button" className="btn btn-sm">Reload</button></div><script> import InfoCircleIcon from '@master/icons-svelte/native/16/soft/info-circle'</script><div class="alert" role="status"> <InfoCircleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-title">A new version is available</p> <p class="alert-description">Reload to use the latest build of the dashboard.</p> </div> <button type="button" class="btn btn-sm">Reload</button></div><script setup>import InfoCircleIcon from '@master/icons-vue/native/16/soft/info-circle'</script><template> <div class="alert" role="status"> <InfoCircleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-title">A new version is available</p> <p class="alert-description">Reload to use the latest build of the dashboard.</p> </div> <button type="button" class="btn btn-sm">Reload</button> </div></template>#상태
독자가 취해야 할 조치에 따라 상태를 선택하고, 메시지에도 그 내용을 명시하세요.
alert-info는 당장 달라지는 사항이 없을 때 배경 정보를 덧붙입니다.alert-success는 방금 완료된 작업을 확인해 줍니다.alert-warning은 문제가 발생하기 전에 주의를 환기합니다.alert-danger는 작업이 실패했거나 진행할 수 없음을 알립니다.
상태
<div class="alert alert-info" role="status"> <svg class="icon alert-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <circle cx="8" cy="8" r="6" /><circle cx="8" cy="5" r="0.5" fill="currentColor" stroke="none" /><path d="M8 8L8 11" /> </svg> <div class="alert-body"> <p class="alert-description">Scheduled maintenance on Sunday from 02:00 to 03:00 UTC.</p> </div></div><div class="alert alert-success" role="status"> <svg class="icon alert-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <circle cx="8" cy="8" r="6" /><path d="M5 8L7.1041 9.8703A0.2 0.2 0 0 0 7.3832 9.8573L10.75 6.25" /> </svg> <div class="alert-body"> <p class="alert-description">Your domain is verified and serving traffic.</p> </div></div><div class="alert alert-warning" role="status"> <svg class="icon alert-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M8.8742 3.8235L13.4246 12.0144A1 1 0 0 1 12.5505 13.5L3.4495 13.5A1 1 0 0 1 2.5754 12.0144L7.1258 3.8235A1 1 0 0 1 8.8742 3.8235Z" /><path d="M8 6.5L8 9" /><circle cx="8" cy="11.5" r="0.5" fill="currentColor" stroke="none" /> </svg> <div class="alert-body"> <p class="alert-title">Your card expires this month</p> <p class="alert-description">Update the payment method to keep deployments running.</p> </div> <button type="button" class="btn btn-sm">Update</button></div><div class="alert alert-danger" role="alert"> <svg class="icon alert-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <circle cx="8" cy="8" r="6" transform="rotate(180 8 8)" /><circle cx="8" cy="5" r="0.5" fill="currentColor" stroke="none" transform="rotate(180 8 8)" /><path d="M8 8L8 11" transform="rotate(180 8 8)" /> </svg> <div class="alert-body"> <p class="alert-title">The build failed</p> <p class="alert-description"> The install step exited with code 1. Read the logs for the missing dependency. </p> </div></div>import InfoCircleIcon from '@master/icons-react/native/16/soft/info-circle'import CheckCircleIcon from '@master/icons-react/native/16/soft/check-circle'import AlertTriangleIcon from '@master/icons-react/native/16/soft/alert-triangle'import AlertCircleIcon from '@master/icons-react/native/16/soft/alert-circle'<> <div className="alert alert-info" role="status"> <InfoCircleIcon className="icon alert-icon" /> <div className="alert-body"> <p className="alert-description">Scheduled maintenance on Sunday from 02:00 to 03:00 UTC.</p> </div> </div> <div className="alert alert-success" role="status"> <CheckCircleIcon className="icon alert-icon" /> <div className="alert-body"> <p className="alert-description">Your domain is verified and serving traffic.</p> </div> </div> <div className="alert alert-warning" role="status"> <AlertTriangleIcon className="icon alert-icon" /> <div className="alert-body"> <p className="alert-title">Your card expires this month</p> <p className="alert-description">Update the payment method to keep deployments running.</p> </div> <button type="button" className="btn btn-sm">Update</button> </div> <div className="alert alert-danger" role="alert"> <AlertCircleIcon className="icon alert-icon" /> <div className="alert-body"> <p className="alert-title">The build failed</p> <p className="alert-description"> The install step exited with code 1. Read the logs for the missing dependency. </p> </div> </div></><script> import InfoCircleIcon from '@master/icons-svelte/native/16/soft/info-circle' import CheckCircleIcon from '@master/icons-svelte/native/16/soft/check-circle' import AlertTriangleIcon from '@master/icons-svelte/native/16/soft/alert-triangle' import AlertCircleIcon from '@master/icons-svelte/native/16/soft/alert-circle'</script><div class="alert alert-info" role="status"> <InfoCircleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-description">Scheduled maintenance on Sunday from 02:00 to 03:00 UTC.</p> </div></div><div class="alert alert-success" role="status"> <CheckCircleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-description">Your domain is verified and serving traffic.</p> </div></div><div class="alert alert-warning" role="status"> <AlertTriangleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-title">Your card expires this month</p> <p class="alert-description">Update the payment method to keep deployments running.</p> </div> <button type="button" class="btn btn-sm">Update</button></div><div class="alert alert-danger" role="alert"> <AlertCircleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-title">The build failed</p> <p class="alert-description"> The install step exited with code 1. Read the logs for the missing dependency. </p> </div></div><script setup>import InfoCircleIcon from '@master/icons-vue/native/16/soft/info-circle'import CheckCircleIcon from '@master/icons-vue/native/16/soft/check-circle'import AlertTriangleIcon from '@master/icons-vue/native/16/soft/alert-triangle'import AlertCircleIcon from '@master/icons-vue/native/16/soft/alert-circle'</script><template> <div class="alert alert-info" role="status"> <InfoCircleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-description">Scheduled maintenance on Sunday from 02:00 to 03:00 UTC.</p> </div> </div> <div class="alert alert-success" role="status"> <CheckCircleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-description">Your domain is verified and serving traffic.</p> </div> </div> <div class="alert alert-warning" role="status"> <AlertTriangleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-title">Your card expires this month</p> <p class="alert-description">Update the payment method to keep deployments running.</p> </div> <button type="button" class="btn btn-sm">Update</button> </div> <div class="alert alert-danger" role="alert"> <AlertCircleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-title">The build failed</p> <p class="alert-description"> The install step exited with code 1. Read the logs for the missing dependency. </p> </div> </div></template>#레이아웃
알림은 --alert-radius를 사용하며 기본값은 var(--radius-control-lg)입니다. 알림을 트레이 안에 바로 배치할 때는 트레이의 모서리와 안쪽 여백을 따르도록 알림의 해당 속성에 var(--radius-surface)를 지정하세요.
아이콘에 icon alert-icon 클래스를 적용하세요. 텍스트가 몇 줄이든 아이콘은 첫 줄의 세로 중앙에 정렬됩니다. alert-body는 남은 너비를 차지합니다. 본문 뒤의 버튼이나 링크는 행 끝에 배치되며, 알림의 너비가 좁으면 텍스트 아래 줄로 내려갑니다.
좁은 열의 알림
<div class="alert alert-warning max-w(280) mx-auto" role="status"> <svg class="icon alert-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M8.8742 3.8235L13.4246 12.0144A1 1 0 0 1 12.5505 13.5L3.4495 13.5A1 1 0 0 1 2.5754 12.0144L7.1258 3.8235A1 1 0 0 1 8.8742 3.8235Z" /><path d="M8 6.5L8 9" /><circle cx="8" cy="11.5" r="0.5" fill="currentColor" stroke="none" /> </svg> <div class="alert-body"> <p class="alert-title">Usage is at 90%</p> <p class="alert-description">Requests are limited when the plan runs out.</p> </div> <button type="button" class="btn btn-sm">Upgrade</button></div>import AlertTriangleIcon from '@master/icons-react/native/16/soft/alert-triangle'<div className="alert alert-warning max-w(280) mx-auto" role="status"> <AlertTriangleIcon className="icon alert-icon" /> <div className="alert-body"> <p className="alert-title">Usage is at 90%</p> <p className="alert-description">Requests are limited when the plan runs out.</p> </div> <button type="button" className="btn btn-sm">Upgrade</button></div><script> import AlertTriangleIcon from '@master/icons-svelte/native/16/soft/alert-triangle'</script><div class="alert alert-warning max-w(280) mx-auto" role="status"> <AlertTriangleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-title">Usage is at 90%</p> <p class="alert-description">Requests are limited when the plan runs out.</p> </div> <button type="button" class="btn btn-sm">Upgrade</button></div><script setup>import AlertTriangleIcon from '@master/icons-vue/native/16/soft/alert-triangle'</script><template> <div class="alert alert-warning max-w(280) mx-auto" role="status"> <AlertTriangleIcon class="icon alert-icon" /> <div class="alert-body"> <p class="alert-title">Usage is at 90%</p> <p class="alert-description">Requests are limited when the plan runs out.</p> </div> <button type="button" class="btn btn-sm">Upgrade</button> </div></template>#접근성
- 페이지가 로드된 후에 나타나는 알림에는 라이브 영역이 필요합니다.
role="status"는 스크린 리더가 안내를 잠시 멈출 때까지 기다렸다가 메시지를 읽으며,role="alert"는 진행 중인 안내를 중단하고 메시지를 읽습니다.role="alert"는 즉시 조치가 필요한 실패에만 사용하세요. - 처음부터 페이지에 포함된 알림에는 역할을 지정할 필요가 없습니다.
- 메시지는 텍스트로 전달되므로 아이콘에는
aria-hidden="true"를 지정하세요.
#클래스
| 클래스 | 설명 |
|---|---|
alert | 평평한 표면에 0.5px 윤곽선을 두른 중립 색상의 메시지입니다. 본문 뒤의 버튼이나 링크는 행 끝에 놓이며, 폭이 좁으면 본문 아래로 내려갑니다. |
alert-info | 아직 상황에 변화가 없는 상태에서 참고 정보를 제공합니다. 배경에는 정보 색상을 옅게 입히고 아이콘에도 정보 색상을 적용합니다.적용할 클래스는 alert입니다 |
alert-success | 방금 완료된 작업을 표시합니다. 배경에는 성공 색상을 옅게 입히고 아이콘에도 성공 색상을 적용합니다.적용할 클래스는 alert입니다 |
alert-warning | 문제가 생기기 전에 주의를 환기합니다. 배경에는 경고 색상을 옅게 입히고 아이콘에도 경고 색상을 적용합니다.적용할 클래스는 alert입니다 |
alert-danger | 실패했거나 진행할 수 없는 작업을 표시합니다. 배경에는 위험 색상을 옅게 입히고 아이콘에도 위험 색상을 적용합니다.적용할 클래스는 alert입니다 |
alert-icon | 아이콘 요소에 icon 클래스와 함께 적용합니다. 텍스트가 몇 줄이든 아이콘의 세로 중심을 첫 줄에 맞춥니다. |
alert-body | 텍스트를 담고 행에서 남은 너비를 차지합니다. |
alert-title | 핵심 메시지를 전달하는 짧고 굵은 제목입니다. |
alert-description | 제목 아래의 설명입니다. 제목이 없으면 이 문장이 전체 메시지가 됩니다. |
#사용자 지정 속성
| 속성 | 기본값 | 설명 |
|---|---|---|
--alert-radius | var(--radius-control-lg) | 모서리 배율을 적용하기 전의 원형 반경입니다. 트레이에 바로 담기는 경우에는 var(--radius-surface)를 사용합니다.alert에 설정합니다 |