처리 중
콘텐츠를 다시 불러오는 영역에 덮개와 스피너를 표시합니다.
이 페이지의 내용
처리 중 상태는 필터가 바뀐 카드, 새 페이지를 불러오는 표, 저장 중인 양식처럼 콘텐츠를 다시 가져오고 있는 영역에 표시합니다. 영역에 busy 클래스를 적용하고 작업이 진행되는 동안 aria-busy="true"를 설정하세요. 영역의 표면색을 사용한 덮개가 기존 콘텐츠의 강조를 낮추고, 가운데에서는 스피너가 회전합니다. 기존 콘텐츠가 제자리를 유지하므로 새 콘텐츠가 표시될 때 레이아웃이 갑자기 움직이지 않습니다.
처리 중
<article class="card busy w-full max-w(320)" id="revenue" aria-label="Revenue"> <header class="card-header"> <h3 class="card-title">Revenue</h3> <p class="card-description">$48,200 this month, up 12% on October.</p> </header> <footer class="card-footer"> <button class="btn btn-sm" type="button" id="revenue-refresh">Refresh</button> </footer></article><script>var card = document.getElementById('revenue')document.getElementById('revenue-refresh').addEventListener('click', function () { card.setAttribute('aria-busy', 'true') card.inert = true setTimeout(function () { card.removeAttribute('aria-busy') card.inert = false }, 1800)})</script>#하나의 상태 속성
클래스만 적용하면 화면에 아무것도 표시되지 않습니다. 같은 요소에 지정한 aria-busy="true"가 처리 중 상태를 결정합니다. 스크린 리더에 전달되는 상태와 스타일시트가 참조하는 상태가 같으므로 두 상태가 어긋나지 않습니다. 작업이 끝나면 속성을 제거하거나 값을 false로 설정하세요.
덮개는 160ms 후 서서히 나타납니다. 작업이 바로 끝나면 덮개가 깜빡이지 않고, 이미 표시된 콘텐츠를 기다리라는 안내도 나오지 않습니다.
처리 중 상태
<article class="card busy w-full max-w(320)" aria-busy="true" aria-label="Revenue" inert> <header class="card-header"> <h3 class="card-title">Revenue</h3> <p class="card-description">$48,200 this month, up 12% on October.</p> </header> <footer class="card-footer"><button class="btn btn-sm" type="button">Refresh</button></footer></article><article className="card busy w-full max-w(320)" aria-busy="true" aria-label="Revenue" inert> <header className="card-header"> <h3 className="card-title">Revenue</h3> <p className="card-description">$48,200 this month, up 12% on October.</p> </header> <footer className="card-footer"> <button className="btn btn-sm" type="button">Refresh</button> </footer></article><article class="card busy w-full max-w(320)" aria-busy="true" aria-label="Revenue" inert> <header class="card-header"> <h3 class="card-title">Revenue</h3> <p class="card-description">$48,200 this month, up 12% on October.</p> </header> <footer class="card-footer"><button class="btn btn-sm" type="button">Refresh</button></footer></article><template> <article class="card busy w-full max-w(320)" aria-busy="true" aria-label="Revenue" inert> <header class="card-header"> <h3 class="card-title">Revenue</h3> <p class="card-description">$48,200 this month, up 12% on October.</p> </header> <footer class="card-footer"><button class="btn btn-sm" type="button">Refresh</button></footer> </article></template>#덮개
덮개 색은 시트, 카드, 대화 상자가 제공하는 --surface-color를 바탕으로 혼합합니다. 따라서 카드에는 회색 대신 카드 자체의 표면색이 적용됩니다. 자체 표면이 없는 영역에서는 페이지의 캔버스 색을 사용합니다. 덮개는 영역의 모서리 모양을 따릅니다. 스피너 바로 뒤는 불투명하게 가리고 주변은 더 투명하게 처리하므로 스피너의 링이 글자와 겹쳐 보이지 않습니다.
덮개는 아래 요소에 대한 포인터 입력을 막습니다. 키보드 입력을 막으려면 첫 번째 예제처럼 처리 중인 동안 inert 속성을 추가하고 작업이 끝나면 제거하세요.
--busy-size는 스피너의 지름을 설정합니다. 기본값은 20px입니다.
#처리 중 상태와 스켈레톤
처리 중 상태는 이미 표시된 콘텐츠를 교체할 때 사용합니다. 처음 불러오는 콘텐츠는 스켈레톤으로 형태를 표시하세요. 개별 컨트롤에서 대기가 필요하면 해당 컨트롤 안에 스피너를 표시하고, 버튼에는 자체 aria-busy 상태를 사용하세요.
#접근성
aria-busy="true"는 영역이 업데이트 중임을 보조 기술에 알립니다. 보조 기술은 이 속성이 제거될 때까지 영역 안의 변경 사항을 읽지 않을 수 있습니다.- 이 속성은 작업이 시작됐다는 안내를 제공하지 않습니다. 처리 중인 영역 바깥의 라이브 영역이나 작업을 시작한 컨트롤에서 텍스트로 안내하세요.
- 처리 중에는 영역을
inert상태로 설정해 덮개 아래의 컨트롤에 포커스를 두거나 컨트롤을 누를 수 없게 하세요. - 사용자가 동작 줄이기를 설정하면 스피너가 더 느리게 회전합니다. 강제 색상 모드에서는 덮개에 캔버스 색을 사용합니다.
#클래스
| 클래스 | 설명 |
|---|---|
busy | 영역 자체에 aria-busy="true"가 설정된 동안 표면과 같은 색의 덮개를 씌워 콘텐츠가 덜 두드러지게 하고, 가운데에서 스피너를 회전시킵니다. 덮개는 영역의 모서리 모양을 따르며 160ms 후에 나타납니다. |
#사용자 지정 속성
| 속성 | 기본값 | 설명 |
|---|---|---|
--busy-size | 1.25rem | 스피너 지름 |