Html
Progress는 작업이나 프로세스의 진행 상태를 시각적으로 보여주는 HTML 컴포넌트예요. 크기·측정값 위치·상태(성공/경고/실패) 수식어를 조합해 필요한 진행률 바를 만들 수 있어요.
출처: 문서
본문
예제 (Examples)
단순 (Simple)
Title
33%
작게 (Small)
Title
33%
크게 (Large)
Title
33%
외부 (Outside)
Title
33%
내부 (Inside)
Title
33%
외부 고정 너비 측정값 (Outside static width measure)
1%
50%
100%
1,000
50,000
100,000
한 줄로 (On single line)
33%
측정값 없이 (Without measure)
Title
유한 단계 (Finite step)
Title
2 of 5 units
설명 잘라내기 (Truncate description)
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quis ultricies lectus, eu lobortis mauris. Morbi pretium arcu id rhoncus mollis. Donec accumsan tincidunt enim nec varius. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Suspendisse potenti.
33%
도움말 텍스트 (Helper text)
Title
33%
Progress helper text
백분율이 아닌 진행률 (Non-percentage progress)
막대와 함께 표시되는 상태가 백분율이 아니라면, 이 상태를 화면 낭독기 사용자에게 제공하기 위해 ARIA 태그 aria-valuetext를 사용해야 해요. 화면 낭독기마다 이 속성을 다르게 처리하므로, aria-valuemax를 "100"이 아닌 다른 값으로 설정하는 것이 권장되는 유일한 경우예요.
진행 단계 지침 (Progress step instruction)
Title
Step 2: Copying files
상태 예제 (Status examples)
상태를 전달할 때는 다음을 반드시 확인해야 해요.
-
상태를 설명하는 보이는 도움말 텍스트가 있어야 해요.
-
도움말 텍스트에는 HTML helper text component에서 볼 수 있듯이 상태 아이콘이 포함돼야 해요.
-
도움말 텍스트는 progress helper text example에서 볼 수 있듯이
aria-describedby속성을 통해.pf-v6-c-progress__bar[role="progressbar"]요소에 연결돼야 해요.
성공 (Success)
Title
100%
경고 (Warning)
Title
100%
실패 (Failure)
Title
33%
내부 성공 (Inside success)
Title
100%
내부 경고 (Inside warning)
Title
100%
외부 실패 (Outside failure)
Title
33%
측정값 없는 실패 (Failure without measure)
Title
문서 (Documentation)
개요 (Overview)
접근성 (Accessibility)
이 컴포넌트가 페이지의 특정 영역의 로딩 진행률을 설명하는 것이라면, 작성자는 aria-describedby로 상태를 가리키고 로딩이 끝날 때까지 해당 영역의 aria-busy 속성을 true로 설정해야 해요.
| 속성 (Attribute) | 적용 대상 (Applied to) | 결과 (Outcome) |
|---|---|---|
role="progressbar" |
.pf-v6-c-progress__bar |
오래 걸리거나 여러 단계로 구성된 작업의 진행 상태를 표시하는 요소에 쓰이는 role이에요. |
aria-valuenow="" |
.pf-v6-c-progress__bar |
진행이 계속됨에 따라 이 값을 갱신해야 해요. |
aria-valuemin="0" |
.pf-v6-c-progress__bar |
진행률 바의 최소값이에요. |
aria-valuemax="100" |
.pf-v6-c-progress__bar |
진행률 바의 최대값이에요. 진행률이 aria-valuenow로만 정의된다면(예: 백분율) 이 값은 "100"으로 설정해야 해요. aria-valuetext로 정의된다면 100이 아닌 값이 될 수 있어요. 예를 들어 aria-valuetext가 "2 of 5 units"라면 aria-valuemax는 "5", aria-valuenow는 "2"가 될 수 있어요. |
aria-label="[id of .pf-v6-c-progress__description]" |
.pf-v6-c-progress__bar |
progress 컴포넌트에 접근 가능한 이름을 제공해요. |
aria-labelledby="[id element that labels the progress]" |
.pf-v6-c-progress__bar |
progress 컴포넌트에 접근 가능한 이름을 제공해요. |
aria-describedby="[id of element that describes the progress]" |
.pf-v6-c-progress__bar |
progress 컴포넌트에 접근 가능한 설명을 제공해요. |
aria-valuetext="[loading state]" |
.pf-v6-c-progress__bar |
현재 상태를 전달하는 텍스트 문자열을 제공해요. 상태에 대한 중요한 정보가 텍스트 문자열에 포함된 경우에만 사용해요. 백분율이 전달할 가장 중요한 값이라면 사용하지 마세요. aria-valuetext를 사용하면 일부 화면 낭독기는 aria-valuenow에서 결정된 백분율 값을 무시해요. |
aria-hidden="true" |
.pf-v6-c-progress__status |
화면 낭독기에서 보이는 진행률 상태를 숨겨요. 이 정보는 .pf-v6-c-progress__bar 요소에 정의된 aria 속성으로 전달돼요. |
사용법 (Usage)
| 클래스 (Class) | 적용 대상 (Applied to) | 결과 (Outcome) |
|---|---|---|
.pf-v6-c-progress |
`` | progress 컴포넌트를 시작해요. |
.pf-v6-c-progress__description |
`` | 진행률 바의 설명이에요. |
.pf-v6-c-progress__status |
`` | % 진행률과 상태 아이콘을 표시해요. |
.pf-v6-c-progress__measure |
`` | % 완료를 표시해요. |
.pf-v6-c-progress__status-icon |
`` | 상태 아이콘을 표시해요. (선택) |
.pf-v6-c-progress__bar |
`` | 전체 너비에 걸쳐 표시하며 완료 상태를 나타내요. |
.pf-v6-c-progress__indicator |
`` | .pf-v6-c-progress__bar와 함께 표시해 현재까지의 진행률을 나타내요. |
.pf-v6-c-progress__helper-text |
`` | 진행률 바 아래에 추가 텍스트를 표시해요. (선택) |
.pf-m-lg |
.pf-v6-c-progress |
진행률 바를 더 크게 수정해요. |
.pf-m-sm |
.pf-v6-c-progress |
진행률 바를 더 작게 수정해요. |
.pf-m-inside |
.pf-v6-c-progress |
측정값을 진행 표시기 안에 보여줘요. 참고: 이 옵션은 .pf-m-lg가 필요해요. |
.pf-m-outside |
.pf-v6-c-progress |
측정값과 상태 아이콘을 진행률 바 오른쪽에 보여줘요. |
.pf-m-singleline |
.pf-v6-c-progress |
progress 컴포넌트를 한 줄로 만들도록 수정해요. 측정값이 필요하면 .pf-m-inside 또는 .pf-m-outside와 함께 사용해요. |
.pf-m-success |
.pf-v6-c-progress |
progress 컴포넌트의 모양을 성공 상태로 바꿔요. |
.pf-m-warning |
.pf-v6-c-progress |
progress 컴포넌트의 모양을 경고 상태로 바꿔요. |
.pf-m-danger |
.pf-v6-c-progress |
progress 컴포넌트의 모양을 위험(실패) 상태로 바꿔요. |
.pf-m-truncate |
.pf-v6-c-progress__description |
설명을 한 줄로 표시하고 넘치는 텍스트를 줄임표로 잘라내도록 수정해요. |
.pf-m-static-width |
.pf-v6-c-progress.pf-m-outside .pf-v6-c-progress__measure |
측정값 요소가 0-100%를 담을 수 있는 고정 min-width를 갖도록 수정해요. --pf-v6-c-progress__measure--m-static-width--MinWidth를 설정해 덮어쓸 수 있어요. |