React Chip 개요

    Ignite UI for React 칩은 사람들이 정보를 입력하거나, 선택하거나, 콘텐츠를 필터링하거나, 작업을 트리거하는 데 도움이 됩니다.

    React Chip Example

    Usage

    먼저, 다음 명령을 실행하여 Ignite UI for React 설치해야 합니다.

    npm install igniteui-react
    

    그 다음에는 다음과 같이 필요한 CSS를IgrChip 가져오면 됩니다:

    import { IgrChip } from 'igniteui-react';
    import 'igniteui-webcomponents/themes/light/bootstrap.css';
    
    <IgrChip></IgrChip>
    

    선택 가능한 칩을 표시하려면 칩의 속성을 사용할selectable 수 있습니다.

    <IgrChip selectable={true}></IgrChip>
    

    분리형 칩을 표시하려면 칩의 특성을 사용할removable 수 있습니다.

    <IgrChip removable={true}></IgrChip>
    

    Examples

    Variants

    The Ignite UI for React chip supports several pre-defined stylistic variants. You can change the variant by assigning one of the supported values - Primary, Info, Success, Warning, or Danger to the variant property.

    <IgrChip variant="success"></IgrChip>
    

    Disabled

    The Ignite UI for React chip can be disabled by using the disabled property.

    <IgrChip disabled={true}></IgrChip>
    

    Prefix / Suffix

    Prefix그리고SuffixIgrChip 구성 요소와 슬롯에 대해 칩의 주요 콘텐츠 앞뒤에 다른 콘텐츠를 추가할 수 있습니다. 기본 선택 및 제거 아이콘을 제공하지만, 다음을 사용해 커스터마이징할 수 있습니다IgrSelect 그리고Remove 슬롯. 주요 콘텐츠 전후로 추가 콘텐츠를 추가할 수 있습니다.Start 그리고End 슬롯.

    크기

    사용자가IgrChip 다음의--ig-size CSS 변수:

    <IgrChip className="size-small" selectable={true} removable={true}>
        <span>Chip</span>
    </IgrChip>
    <IgrChip className="size-medium" selectable={true} removable={true}>
        <span>Chip</span>
    </IgrChip>
    <IgrChip className="size-large" selectable={true} removable={true}>
        <span>Chip</span>
    </IgrChip>
    
    .size-small {
      --ig-size: var(--ig-size-small);
    }
    
    .size-medium {
      --ig-size: var(--ig-size-medium);
    }
    
    .size-large {
      --ig-size: var(--ig-size-large);
    }
    

    Styling

    이 컴포넌트는IgrChip 모든 스타일 속성을 변경할 수 있는 abase,prefix,suffix CSS 파트를 노출합니다.

    igc-chip::part(base) {
      background: var(--ig-primary-500);
      color: var(--ig-primary-500-contrast);
    }
    
    igc-chip::part(suffix) {
      color: var(--ig-gray-400);
    }
    

    API References

    Additional Resources