Icon
Icon은 아이콘과 그 크기, 상태 색상, 진행 상태를 일관된 컨테이너 안에 담아 표시하는 컴포넌트예요. 크기와 색상을 표준 옵션으로 통일해 시각적 일관성을 유지할 수 있어요.
출처: 문서
본문
예제 (Examples)
기본 (Basic)
독립형 아이콘 크기 (Standalone icon sizes)
아이콘 크기를 정할 때 쓰는 표준 옵션이에요.
본문 크기 (Body sizes)
이 크기 옵션들은 아이콘이 본문 텍스트 크기에 맞게 하기 위한 것이에요.
제목 크기 (Heading sizes)
이 크기 옵션들은 아이콘이 제목 텍스트 크기에 맞게 하기 위한 것이에요.
상태 색상 (Status colors)
다음 예제는 아이콘의 다양한 상태 변형을 보여 줘요. 이 아이콘들은 일반적인 맥락 밖에서 표시된 점을 유의하세요. 상태를 사용자에게 전달할 때 색상에만 의존해서는 안 돼요.
아이콘 컨테이너 안에서 아이콘 크기 지정 (Sizing an icon within the icon container)
size와 iconSize 프로퍼티를 함께 제공하면 아이콘이 크기가 바뀌어도 아이콘 컨테이너가 일관된 크기를 유지할 수 있어요.
인라인 (Inline)
Heading Lorem ipsum dolor sit amet, consectetur adipiscing elit Sed hendrerit nisi in cursus maximus. Second level Curabitur accumsan turpis pharetra augue tincidunt blandit. Quisque condimentum maximus mi, sit amet commodo arcu rutrum id. Proin pretium urna vel cursus venenatis. Suspendisse potenti. Sometimes you need small text Inline with size specified: small, medium, large, extra large
진행 중 (In progress)
isInProgress 프로퍼티를 전달하면 아이콘이 진행 아이콘으로 바뀌어요. 기본적으로 이 진행 아이콘은 Spinner이며, progressIcon 프로퍼티로 커스터마이즈하거나 재정의할 수 있어요.
진행 상태 토글 (Toggle in progress state)
커스텀 진행 아이콘 (Custom in progress icon)
진행 상태 토글 (Toggle in progress state)
Props
Icon
*required
| Name | Type | Default | Description | |
|---|---|---|---|---|
| children | React.ReactNode | 아이콘 콘텐츠. | ||
| className | string | 아이콘 컨테이너에 적용되는 추가 클래스. | ||
| defaultProgressArialabel | string | 'Loading...' | 기본 진행 아이콘의 aria-label. | |
| iconSize | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'headingSm' | 'headingMd' | 'headingLg' | 'headingXl' | 'heading_2xl' | 'heading_3xl' | 'bodySm' | 'bodyDefault' | 'bodyLg' | 아이콘의 크기. size 프로퍼티로 설정된 아이콘 크기를 재정의해요. |
||
| isInline | boolean | false | 아이콘이 인라인이며 텍스트의 글꼴 크기와 색상을 상속해야 함을 나타내요. size와 iconSize 프로퍼티로 재정의돼요. |
|
| isInProgress | boolean | false | 아이콘이 진행 중임을 나타내요. true로 설정하면 아이콘이 progressIcon으로 교체돼요. |
|
| progressIcon | React.ReactNode | isInProgress가 true일 때의 아이콘. 기본값은 1em 스피너예요. |
||
| progressIconSize | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'headingSm' | 'headingMd' | 'headingLg' | 'headingXl' | 'heading_2xl' | 'heading_3xl' | 'bodySm' | 'bodyDefault' | 'bodyLg' | 진행 아이콘의 크기. size 프로퍼티로 설정된 아이콘 크기를 재정의해요. |
||
| shouldMirrorRTL | boolean | false | children으로 전달된 아이콘이 오른쪽에서 왼쪽(RTL) 언어용으로 미러링되어야 하는지 나타내는 플래그. progressIcon에 전달된 아이콘은 미러링되지 않아요. |
|
| size | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'headingSm' | 'headingMd' | 'headingLg' | 'headingXl' | 'heading_2xl' | 'heading_3xl' | 'bodySm' | 'bodyDefault' | 'bodyLg' | 아이콘 컴포넌트 컨테이너와 아이콘의 크기. | ||
| status | 'custom' | 'info' | 'success' | 'warning' | 'danger' | 아이콘의 상태 색상. |