Web Components 확장 패널 개요

    Ignite UI for Web Components 축소 또는 확장의 두 가지 상태로 렌더링할 수 있는 경량 아코디언 구성 요소입니다. 확장 패널은 마우스 클릭이나 키보드 상호 작용을 사용하여 전환할 수 있습니다.

    Web Components Expansion Panel Example

    Usage

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

    npm install igniteui-webcomponents
    

    IgcExpansionPanelComponent를 사용하기 전에 다음과 같이 등록해야 합니다.

    import {defineComponents, IgcExpansionPanelComponent} from 'igniteui-webcomponents';
    
    defineComponents(IgcExpansionPanelComponent);
    

    Ignite UI for Web Components 에 대한 전체 소개는 시작 항목을 참조하세요.

    IgcExpansionPanelComponent 사용을 시작하는 가장 간단한 방법은 다음과 같습니다.

    <igc-expansion-panel>
        <div slot="title">Golden Retriever</div>
        <div slot="subTitle">Medium-large gun dog</div>
        <div>
            <p>The Golden Retriever is a medium-large gun dog that retrieves shot waterfowl, such as ducks
            and upland game birds, during hunting and shooting parties.[3] The name "retriever" refers to the breed's ability
            to retrieve shot game undamaged due to their soft mouth. Golden retrievers have an instinctive love of water, and
            are easy to train to basic or advanced obedience standards.</p>
        </div>
    </igc-expansion-panel>
    

    Binding to events

    확장 패널 구성요소는 다음 이벤트를 발생시킵니다.

    • igcClosed - 확장 패널이 접힐 때 발생합니다.
    • igcOpened - 확장 패널이 확장되면 발생합니다.
    • igcClosing - 확장 패널이 접히기 시작할 때 발생합니다.
    • igcOpening - 확장 패널이 확장되기 시작할 때 발생합니다.

    다음 샘플은 패널의 현재 상태에 따라 subtitle 표시하거나 숨기도록 구성 요소에 로직을 추가하는 방법을 보여줍니다.

    igcOpenedigcClosed 이벤트 이미터에 바인딩하여 이를 수행할 수 있습니다.

    Component Customization

    IgcExpansionPanelComponent 컨트롤을 사용하면 모든 종류의 콘텐츠를 본문 내부에 추가할 수 있습니다. 입력, 차트 및 기타 확장 패널을 렌더링할 수 있습니다!

    IgcExpansionPanelComponent 사용하면 노출된 제목, 하위 제목표시기 슬롯을 통해 헤더를 쉽게 사용자 정의할 수 있습니다.

    확장 표시기의 위치 구성은 확장 패널의 속성을 통해 indicatorPosition 수행할 수 있습니다. 가능한 옵션은 start, end 또는 none 입니다.

    다음 코드 샘플은 구성 요소의 버튼이 오른쪽으로 이동하도록 구성하는 방법을 보여줍니다.

    Keyboard Navigation

    Ignite UI for Web Components W3C 접근성 표준을 준수하며 사용이 편리합니다.

    주요 조합

    • Alt + ↓- 초점이 맞춰진 패널 확장
    • Alt + ↑- 초점이 맞춰진 패널 축소
    • 스페이스바 / Enter- 초점이 맞춰진 패널의 확장 상태를 전환합니다.

    Styling

    Ignite UI for Web Components 여러 CSS 부분(header, indicator, title, subtitlecontent)을 노출하여 스타일을 완벽하게 제어할 수 있습니다.

    API References

    Additional Resources