ProgressCircle
확정적(determinate) 또는 불확정적(indeterminate) 진행 상태를 보여주는 원형 진행 표시기예요.
본문
사용법 (Usage)
import { ProgressCircle } from '@heroui/react';
{"component": "progress-circle-basic"}
구조 (Anatomy)
import { ProgressCircle } from '@heroui/react';
export default () => (
<ProgressCircle aria-label="Loading" value={60}>
<ProgressCircle.Track>
<ProgressCircle.TrackCircle />
<ProgressCircle.FillCircle />
</ProgressCircle.Track>
</ProgressCircle>
);
예시 (Examples)
크기 (Sizes)
{"component": "progress-circle-sizes"}
색상 (Colors)
{"component": "progress-circle-colors"}
불확정적 (Indeterminate)
진행 상태를 알 수 없을 때는 isIndeterminate를 사용하세요.
{"component": "progress-circle-indeterminate"}
라벨 포함 (With Label)
{"component": "progress-circle-with-label"}
커스텀 SVG 프롭스 (Custom SVG Props)
각 부분이 합성 가능한 컴포넌트이므로 strokeWidth, r, cx, cy, viewBox 같은 SVG 속성을 직접 재정의할 수 있어요.
{"component": "progress-circle-custom-svg"}
커스터마이징 (Customization)
Tailwind CSS
{"component": "progress-circle-custom-styles"}
전역 CSS (Global CSS)
ProgressCircle 컴포넌트 클래스를 커스터마이징하려면 @layer components 디렉티브를 사용하세요.
자세히 알아보기.
@layer components {
.progress-circle {
@apply inline-flex;
}
.progress-circle__track {
@apply size-12;
}
.progress-circle__fill-circle {
stroke: purple;
}
}
스타일링 참고 (Styling Reference)
HeroUI는 BEM 방법론을 따라 컴포넌트 변형과 상태를 재사용하고 커스터마이징하기 쉽게 만들어요.
CSS 클래스 (CSS Classes)
ProgressCircle 컴포넌트는 다음 CSS 클래스를 사용해요 (소스 스타일 보기):
기본 & 요소 클래스 [!toc]
.progress-circle- 기본 컨테이너.progress-circle__track- SVG 요소.progress-circle__track-circle- 배경 원.progress-circle__fill-circle- 진행 호(arc)
크기 클래스 [!toc]
.progress-circle--sm- 작은 크기 변형.progress-circle--md- 중간 크기 변형 (기본값).progress-circle--lg- 큰 크기 변형
색상 클래스 [!toc]
.progress-circle--default- 기본 색상 변형.progress-circle--accent- 강조 색상 변형.progress-circle--success- 성공 색상 변형.progress-circle--warning- 경고 색상 변형.progress-circle--danger- 위험 색상 변형
API 참고 (API Reference)
ProgressCircle
React Aria ProgressBar에서 상속받아요.
| Prop | Type | Default | Description |
|---|---|---|---|
value |
number |
0 |
The current value |
minValue |
number |
0 |
The minimum value |
maxValue |
number |
100 |
The maximum value |
isIndeterminate |
boolean |
false |
Whether progress is indeterminate |
size |
"sm" | "md" | "lg" |
"md" |
Size of the circle |
color |
"default" | "accent" | "success" | "warning" | "danger" |
"accent" |
Color of the progress arc |
formatOptions |
Intl.NumberFormatOptions |
{style: 'percent'} |
Number format for the value display |
children |
ReactNode | (values: ProgressBarRenderProps) => ReactNode |
- | Content or render prop |
렌더 프롭스 (Render Props)
렌더 프롭 패턴을 사용하면 다음 값이 제공돼요:
| Prop | Type | Description |
|---|---|---|
percentage |
number |
The percentage of the progress (0-100) |
valueText |
string |
The formatted value text |
isIndeterminate |
boolean |
Whether progress is indeterminate |