본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

드로워 컴포넌트

원문 보기 위키 갱신

드로워 컴포넌트 (Angular Drawer Component)

Drawer는 화면 위에 오버레이 형태로 나타나는 컨테이너 컴포넌트예요 visible 바인딩으로 열고 닫기를 제어하고, fullScreen 속성을 켜면 화면 전체를 덮는 형태로도 확장할 수 있어요 위치나 크기 조절, 헤드리스 모드, 템플릿 커스터마이징까지 지원되니까 사이드 패널이나 필터 메뉴를 만들 때 활용하기 좋아요 접근성도 챙겨져 있어서 스크린 리더 역할 지정, 키보드 포커스 이동, ESC로 닫기 같은 동작도 기본으로 제공해요

출처: 문서

본문

접근성

스크린 리더 Drawer 컴포넌트는 기본적으로 complementary 역할을 사용해요. 모든 속성이 루트 엘리먼트로 전달되기 때문에 사용 사례에 따라 aria role을 변경할 수 있고, aria-labelledby 같은 추가 속성도 넣을 수 있어요. 또한 열렸을 때 포커스가 drawer 안에 유지되기 때문에 aria-modal이 추가돼요. 버튼처럼 키보드로 접근할 수 있는 트리거 컴포넌트를 사용하는 게 권장되며, 그렇지 않으면 tabIndex를 추가해야 해요. 트리거 엘리먼트는 aria-expanded와 aria-controls도 명시적으로 처리해야 해요. 오버레이 키보드 지원 키 기능 tab drawer 안에서 다음 포커스 가능한 엘리먼트로 포커스를 이동해요. shift + tab drawer 안에서 이전 포커스 가능한 엘리먼트로 포커스를 이동해요. escape closeOnEscape가 true이면 다이얼로그를 닫아요. 닫기 버튼 키보드 지원 키 기능 enter drawer를 닫아요. space drawer를 닫아요.

기본

Drawer는 컨테이너로 사용되며, visible에 바인딩해서 표시 여부를 제어해요.

import { Component } from '@angular/core';
import { ButtonModule } from 'primeng/button';
import { DrawerModule } from 'primeng/drawer';

@Component({
    template: `
        <div class="card flex justify-center">
            <p-drawer [(visible)]="visible" header="Drawer">
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                    consequat.
                </p>
            </p-drawer>
            <p-button (click)="visible = true" icon="pi pi-arrow-right" />
        </div>
    `,
    standalone: true,
    imports: [ButtonModule, DrawerModule]
})
export class DrawerBasicDemo {
    visible: boolean = false;
}

전체 화면

fullScreen 속성을 활성화하면 Drawer가 페이지 전체를 덮을 수 있어요.

import { Component } from '@angular/core';
import { ButtonModule } from 'primeng/button';
import { DrawerModule } from 'primeng/drawer';

@Component({
    template: `
        <div class="card flex justify-center">
            <p-drawer header="Drawer" [(visible)]="visible" [fullScreen]="true">
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                    consequat.
                </p>
            </p-drawer>
            <p-button (click)="visible = true" icon="pi pi-window-maximize" />
        </div>
    `,
    standalone: true,
    imports: [ButtonModule, DrawerModule]
})
export class DrawerFullscreenDemo {
    visible: boolean = false;
}

Headless

Headless 모드를 사용하면 기본 엘리먼트 대신 전체 사용자 인터페이스를 직접 커스터마이징할 수 있어요.

import { Component } from '@angular/core';
import { AvatarModule } from 'primeng/avatar';
import { ButtonModule } from 'primeng/button';
import { Drawer, DrawerModule } from 'primeng/drawer';
import { RippleModule } from 'primeng/ripple';

@Component({
    template: `
        <div class="card flex justify-center">
            <p-drawer #drawerRef [(visible)]="visible">
                <ng-template #headless>
                    <div class="flex flex-col h-full">
                        <div class="flex items-center justify-between px-6 pt-4 shrink-0">
                            <span class="inline-flex items-center gap-2">
                                <svg width="31" height="33" viewBox="0 0 31 33" fill="none" xmlns="http://www.w3.org/2000/svg" class="block mx-auto">
                                    <path d="M15.1934 0V0V0L0.0391235 5.38288L2.35052 25.3417L15.1934 32.427V32.427V32.427L28.0364 25.3417L30.3478 5.38288L15.1934 0Z" fill="var(--p-primary-color)" />
                                    <mask id="mask0_1_52" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="31" height="33">
                                        <path d="M15.1934 0V0V0L0.0391235 5.38288L2.35052 25.3417L15.1934 32.427V32.427V32.427L28.0364 25.3417L30.3478 5.38288L15.1934 0Z" fill="var(--ground-background)" />
                                    </mask>
                                    <g mask="url(#mask0_1_52)">
                                        <path fill-rule="evenodd" clip-rule="evenodd" d="M15.1935 0V3.5994V3.58318V20.0075V20.0075V32.427V32.427L28.0364 25.3417L30.3478 5.38288L15.1935 0Z" fill="var(--p-primary-color)" />
                                    </g>
                                    <path d="M19.6399 15.3776L18.1861 15.0547L19.3169 16.6695V21.6755L23.1938 18.4458V12.9554L21.4169 13.6013L19.6399 15.3776Z" fill="var(--ground-background)" />
                                    <path d="M10.5936 15.3776L12.0474 15.0547L10.9166 16.6695V21.6755L7.03966 18.4458V12.9554L8.81661 13.6013L10.5936 15.3776Z" fill="var(--ground-background)" />
                                    <path
                                        fill-rule="evenodd"
                                        clip-rule="evenodd"
                                        d="M11.3853 16.9726L12.6739 15.0309L13.4793 15.5163H16.7008L17.5061 15.0309L18.7947 16.9726V24.254L17.8283 25.7103L16.7008 26.843H13.4793L12.3518 25.7103L11.3853 24.254V16.9726Z"
                                        fill="var(--ground-background)"
                                    />
                                    <path d="M19.3168 24.7437L21.4168 22.6444V20.5451L19.3168 22.3214V24.7437Z" fill="var(--ground-background)" />
                                    <path d="M10.9166 24.7437L8.81662 22.6444V20.5451L10.9166 22.3214V24.7437Z" fill="var(--ground-background)" />
                                    <path
                                        fill-rule="evenodd"
                                        clip-rule="evenodd"
                                        d="M13.0167 5.68861L11.7244 8.7568L13.8244 14.8932H14.7936V5.68861H13.0167ZM15.4397 5.68861V14.8932H16.5706L18.5091 8.7568L17.2167 5.68861H15.4397Z"
                                        fill="var(--ground-background)"
                                    />
                                    <path d="M13.8244 14.8932L6.87813 12.3094L5.90888 8.27235L11.8859 8.7568L13.9859 14.8932H13.8244Z" fill="var(--ground-background)" />
                                    <path d="M16.5706 14.8932L23.5169 12.3094L24.4861 8.27235L18.3476 8.7568L16.4091 14.8932H16.5706Z" fill="var(--ground-background)" />
                                    <path d="M18.8321 8.27235L22.2245 7.94938L19.9629 5.68861H17.7013L18.8321 8.27235Z" fill="var(--ground-background)" />
                                    <path d="M11.4013 8.27235L8.00893 7.94938L10.2705 5.68861H12.5321L11.4013 8.27235Z" fill="var(--ground-background)" />
                                </svg>
                                <span class="font-semibold text-2xl text-primary">Your Logo</span>
                            </span>
                            <span>
                                <p-button type="button" (click)="closeCallback($event)" icon="pi pi-times" rounded="true" outlined="true" styleClass="h-8 w-8"></p-button>
                            </span>
                        </div>
                        <div class="overflow-y-auto">
                            <ul class="list-none p-4 m-0">
                                <li>
                                    <div
                                        pRipple
                                        pStyleClass="@next"
                                        enterFromClass="hidden"
                                        enterActiveClass="animate-slidedown"
                                        leaveToClass="hidden"
                                        leaveActiveClass="animate-slideup"
                                        class="p-4 flex items-center justify-between text-surface-600 dark:text-surface-200 cursor-pointer p-ripple"
                                    >
                                        <span class="font-medium">FAVORITES</span>
                                        <i class="pi pi-chevron-down"></i>
                                    </div>
                                    <ul class="list-none p-0 m-0 overflow-hidden">
                                        <li>
                                            <a pRipple class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple">
                                                <i class="pi pi-home mr-2"></i>
                                                <span class="font-medium">Dashboard</span>
                                            </a>
                                        </li>
                                        <li>
                                            <a pRipple class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple">
                                                <i class="pi pi-bookmark mr-2"></i>
                                                <span class="font-medium">Bookmarks</span>
                                            </a>
                                        </li>
                                        <li>
                                            <a
                                                pRipple
                                                pStyleClass="@next"
                                                enterFromClass="hidden"
                                                enterActiveClass="animate-slidedown"
                                                leaveToClass="hidden"
                                                leaveActiveClass="animate-slideup"
                                                class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple"
                                            >
                                                <i class="pi pi-chart-line mr-2"></i>
                                                <span class="font-medium">Reports</span>
                                                <i class="pi pi-chevron-down ml-auto"></i>
                                            </a>
                                            <ul class="list-none py-0 pl-4 pr-0 m-0 hidden overflow-y-hidden transition-all duration-[400ms] ease-in-out">
                                                <li>
                                                    <a
                                                        pRipple
                                                        pStyleClass="@next"
                                                        enterFromClass="hidden"
                                                        enterActiveClass="animate-slidedown"
                                                        leaveToClass="hidden"
                                                        leaveActiveClass="animate-slideup"
                                                        class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple"
                                                    >
                                                        <i class="pi pi-chart-line mr-2"></i>
                                                        <span class="font-medium">Revenue</span>
                                                        <i class="pi pi-chevron-down ml-auto"></i>
                                                    </a>
                                                    <ul class="list-none py-0 pl-4 pr-0 m-0 hidden overflow-y-hidden transition-all duration-[400ms] ease-in-out">
                                                        <li>
                                                            <a
                                                                pRipple
                                                                class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple"
                                                            >
                                                                <i class="pi pi-table mr-2"></i>
                                                                <span class="font-medium">View</span>
                                                            </a>
                                                        </li>
                                                        <li>
                                                            <a
                                                                pRipple
                                                                class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple"
                                                            >
                                                                <i class="pi pi-search mr-2"></i>
                                                                <span class="font-medium">Search</span>
                                                            </a>
                                                        </li>
                                                    </ul>
                                                </li>
                                                <li>
                                                    <a pRipple class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple">
                                                        <i class="pi pi-chart-line mr-2"></i>
                                                        <span class="font-medium">Expenses</span>
                                                    </a>
                                                </li>
                                            </ul>
                                        </li>
                                        <li>
                                            <a pRipple class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple">
                                                <i class="pi pi-users mr-2"></i>
                                                <span class="font-medium">Team</span>
                                            </a>
                                        </li>
                                        <li>
                                            <a pRipple class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple">
                                                <i class="pi pi-comments mr-2"></i>
                                                <span class="font-medium">Messages</span>
                                                <span class="inline-flex items-center justify-center ml-auto bg-primary text-primary-contrast rounded-full" style="min-width: 1.5rem; height: 1.5rem">3</span>
                                            </a>
                                        </li>
                                        <li>
                                            <a pRipple class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple">
                                                <i class="pi pi-calendar mr-2"></i>
                                                <span class="font-medium">Calendar</span>
                                            </a>
                                        </li>
                                        <li>
                                            <a pRipple class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple">
                                                <i class="pi pi-cog mr-2"></i>
                                                <span class="font-medium">Settings</span>
                                            </a>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                            <ul class="list-none p-4 m-0">
                                <li>
                                    <div
                                        pRipple
                                        pStyleClass="@next"
                                        enterFromClass="hidden"
                                        enterActiveClass="animate-slidedown"
                                        leaveToClass="hidden"
                                        leaveActiveClass="animate-slideup"
                                        class="p-4 flex items-center justify-between text-surface-600 dark:text-surface-200 cursor-pointer p-ripple"
                                    >
                                        <span class="font-medium">APPLICATION</span>
                                        <i class="pi pi-chevron-down"></i>
                                    </div>
                                    <ul class="list-none p-0 m-0 overflow-hidden">
                                        <li>
                                            <a pRipple class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple">
                                                <i class="pi pi-folder mr-2"></i>
                                                <span class="font-medium">Projects</span>
                                            </a>
                                        </li>
                                        <li>
                                            <a pRipple class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple">
                                                <i class="pi pi-chart-bar mr-2"></i>
                                                <span class="font-medium">Performance</span>
                                            </a>
                                        </li>
                                        <li>
                                            <a pRipple class="flex items-center cursor-pointer p-4 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple">
                                                <i class="pi pi-cog mr-2"></i>
                                                <span class="font-medium">Settings</span>
                                            </a>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </div>
                        <div class="mt-auto">
                            <hr class="mb-4 mx-4 border-t border-0 border-surface" />
                            <a pRipple class="m-4 flex items-center cursor-pointer p-4 gap-2 rounded-border text-surface-700 dark:text-surface-100 hover:bg-surface-100 dark:hover:bg-surface-700 duration-150 transition-colors p-ripple">
                                <p-avatar image="https://primefaces.org/cdn/primeng/images/demo/avatar/amyelsner.png" shape="circle" />
                                <span class="font-bold">Amy Elsner</span>
                            </a>
                        </div>
                    </div>
                </ng-template>
            </p-drawer>
            <p-button (click)="visible = true" icon="pi pi-bars" />
        </div>
    `,
    standalone: true,
    imports: [AvatarModule, ButtonModule, DrawerModule, RippleModule]
})
export class DrawerHeadlessDemo {
    visible: boolean = false;

    closeCallback(e): void {
        this.drawerRef.close(e);
    }
}

위치

Drawer 위치는 left , right , top , bottom 값을 가질 수 있는 position 프로퍼티로 설정돼요.

import { Component } from '@angular/core';
import { ButtonModule } from 'primeng/button';
import { Drawer, DrawerModule } from 'primeng/drawer';

@Component({
    template: `
        <div class="card">
            <p-drawer header="Left Drawer" [(visible)]="visible1" position="left">
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                    consequat.
                </p>
            </p-drawer>
            <p-drawer header="Right Drawer" [(visible)]="visible2" position="right">
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                    consequat.
                </p>
            </p-drawer>
            <p-drawer header="Top Drawer" [(visible)]="visible3" position="top" [style]="{ height: 'auto' }">
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                    consequat.
                </p>
            </p-drawer>
            <p-drawer header="Bottom Drawer" [(visible)]="visible4" position="bottom" [style]="{ height: 'auto' }">
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                    consequat.
                </p>
            </p-drawer>
            <div class="flex gap-2 justify-center">
                <p-button type="button" (click)="visible1 = true" icon="pi pi-arrow-right" />
                <p-button type="button" (click)="visible2 = true" icon="pi pi-arrow-left" />
                <p-button type="button" (click)="visible3 = true" icon="pi pi-arrow-down" />
                <p-button type="button" (click)="visible4 = true" icon="pi pi-arrow-up" />
            </div>
        </div>
    `,
    standalone: true,
    imports: [ButtonModule, DrawerModule]
})
export class DrawerPositionDemo {
    visible1: boolean = false;
    visible2: boolean = false;
    visible3: boolean = false;
    visible4: boolean = false;
}

크기

Drawer 크기는 style이나 class 프로퍼티로 정의할 수 있어요. 이 반응형 예제는 Tailwind를 활용해요.

import { Component } from '@angular/core';
import { ButtonModule } from 'primeng/button';
import { DrawerModule } from 'primeng/drawer';

@Component({
    template: `
        <div class="card flex justify-center">
            <p-drawer header="Drawer" [(visible)]="visible" styleClass="!w-full md:!w-80 lg:!w-[30rem]">
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                    consequat.
                </p>
            </p-drawer>
            <p-button (click)="visible = true" icon="pi pi-arrow-right" />
        </div>
    `,
    standalone: true,
    imports: [ButtonModule, DrawerModule]
})
export class DrawerSizeDemo {
    visible: boolean = false;
}

템플릿

Drawer는 header , content , footer 템플릿으로 커스터마이징할 수 있어요.

import { Component } from '@angular/core';
import { AvatarModule } from 'primeng/avatar';
import { DrawerModule } from 'primeng/drawer';
import { ButtonModule } from 'primeng/button';

@Component({
    template: `
        <div class="card flex justify-center">
            <p-drawer [(visible)]="visible" [closable]="false">
                <ng-template #header>
                    <div class="flex items-center gap-2">
                        <p-avatar image="https://primefaces.org/cdn/primeng/images/demo/avatar/amyelsner.png" shape="circle" />
                        <span class="font-bold">Amy Elsner</span>
                    </div>
                </ng-template>
                <p>
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
                    consequat.
                </p>
                <ng-template #footer>
                    <div class="flex items-center gap-2">
                        <button pButton label="Account" icon="pi pi-user" class="w-full" outlined></button>
                        <button pButton label="Logout" icon="pi pi-sign-out" class="w-full" severity="danger" text></button>
                    </div>
                </ng-template>
            </p-drawer>
            <button pButton (click)="visible = true" icon="pi pi-plus"></button>
        </div>
    `,
    standalone: true,
    imports: [AvatarModule, DrawerModule, ButtonModule]
})
export class DrawerTemplateDemo {
    visible: boolean = false;
}

Drawer

Sidebar는 화면 가장자리에 오버레이로 표시되는 패널 컴포넌트예요.

프로퍼티

이름 타입 기본값 설명
dt InputSignal undefined 컴포넌트의 스코프 디자인 토큰을 정의해요.
unstyled InputSignal undefined 컴포넌트를 스타일 없이 렌더링할지 여부를 나타내요.
pt InputSignal undefined 컴포넌트 내부의 DOM 엘리먼트에 속성을 전달하는 데 사용돼요.
ptOptions InputSignal undefined 컴포넌트의 passthrough(pt) 옵션을 설정하는 데 사용돼요.
appendTo InputSignal 'self' 오버레이를 붙일 대상 엘리먼트예요. 유효한 값은 "body" 또는 다른 엘리먼트의 로컬 ng-template 변수예요 (참고: 템플릿 변수에는 대괄호 바인딩을 사용하세요. 예를 들어 #mydiv를 변수 이름으로 가지는 div 엘리먼트라면 [appendTo]="mydiv"처럼 작성해요).
motionOptions InputSignal ... 모션 옵션이에요.
blockScroll boolean false Drawer가 활성화됐을 때 문서 스크롤을 막을지 여부예요.
style { [klass: string]: any } - 컴포넌트의 인라인 스타일이에요.
styleClass string - 컴포넌트의 스타일 클래스예요.
ariaCloseLabel string - 닫기 아이콘의 Aria 라벨이에요.
autoZIndex boolean true 레이어 관리를 자동으로 할지 여부예요.
baseZIndex number 0 레이어링에 사용할 기본 zIndex 값이에요.
modal boolean true Drawer 뒤에 오버레이 마스크를 표시할지 여부예요.
closeButtonProps ButtonProps ... ButtonProps의 모든 프로퍼티를 Button 컴포넌트에 전달하는 데 사용돼요.
dismissible boolean true 마스크를 클릭하면 drawer를 닫을지 여부예요.
showCloseIcon boolean true 닫기 아이콘을 표시할지 여부예요. (지원 중단됨)
closeOnEscape boolean true Escape 키를 눌렀을 때 drawer를 숨길지 여부를 지정해요.
transitionOptions string 150ms cubic-bezier(0, 0, 0.2, 1) 애니메이션의 전환 옵션이에요. (지원 중단됨)
visible boolean - visible 프로퍼티는 컴포넌트의 표시 여부를 결정하는 input이에요.
position InputSignal<"right" | "left" | "top" | "bottom" | "full"> 'left' Drawer의 위치를 지정해요. 유효한 값은 "left", "right", "bottom", "top"이에요.
fullScreen InputSignal false 다이얼로그를 숨길 수 있는 닫기 아이콘을 헤더에 추가해요.
header string - 다이얼로그의 제목 내용이에요.
maskStyle { [klass: string]: any } - 마스크의 스타일이에요.
closable boolean true 닫기 버튼을 표시할지 여부예요.

이벤트

이름 파라미터 설명
onShow value: any 다이얼로그가 표시될 때 호출되는 콜백이에요.
onHide value: any 다이얼로그가 숨겨질 때 호출되는 콜백이에요.
visibleChange value: boolean 다이얼로그 표시 여부가 변경될 때 호출되는 콜백이에요.

템플릿

이름 타입 설명
header TemplateRef 커스텀 헤더 템플릿이에요.
footer TemplateRef 커스텀 푸터 템플릿이에요.
content TemplateRef 커스텀 콘텐츠 템플릿이에요.
closeicon TemplateRef 커스텀 닫기 아이콘 템플릿이에요.
headless TemplateRef Drawer 전체 콘텐츠를 대체하는 커스텀 headless 템플릿이에요.

Pass Through 옵션

이름 타입 설명
host PassThroughOption<HTMLElement, I> 호스트의 DOM 엘리먼트에 속성을 전달하는 데 사용돼요.
root PassThroughOption<HTMLDivElement, I> 루트의 DOM 엘리먼트에 속성을 전달하는 데 사용돼요.
header PassThroughOption<HTMLDivElement, I> 헤더의 DOM 엘리먼트에 속성을 전달하는 데 사용돼요.
title PassThroughOption<HTMLDivElement, I> 타이틀의 DOM 엘리먼트에 속성을 전달하는 데 사용돼요.
pcCloseButton ButtonPassThrough 닫기 Button 컴포넌트에 속성을 전달하는 데 사용돼요.
content PassThroughOption<HTMLDivElement, I> 콘텐츠의 DOM 엘리먼트에 속성을 전달하는 데 사용돼요.
footer PassThroughOption<HTMLDivElement, I> 푸터의 DOM 엘리먼트에 속성을 전달하는 데 사용돼요.
motion MotionOptions 모션 컴포넌트/디렉티브에 옵션을 전달하는 데 사용돼요.

테마

CSS 클래스

클래스 설명
p-drawer-mask 마스크 엘리먼트의 클래스 이름이에요
p-drawer 루트 엘리먼트의 클래스 이름이에요
p-drawer-header 헤더 엘리먼트의 클래스 이름이에요
p-drawer-title 타이틀 엘리먼트의 클래스 이름이에요
p-drawer-close-button 닫기 버튼 엘리먼트의 클래스 이름이에요
p-drawer-content 콘텐츠 엘리먼트의 클래스 이름이에요

디자인 토큰

토큰 CSS 변수 설명
drawer.background --p-drawer-background 루트의 배경이에요
drawer.border.color --p-drawer-border-color 루트의 테두리 색상이에요
drawer.color --p-drawer-color 루트의 색상이에요
drawer.shadow --p-drawer-shadow 루트의 그림자예요
drawer.header.padding --p-drawer-header-padding 헤더의 패딩이에요
drawer.title.font.size --p-drawer-title-font-size 타이틀의 폰트 크기예요
drawer.title.font.weight --p-drawer-title-font-weight 타이틀의 폰트 굵기예요
drawer.content.padding --p-drawer-content-padding 콘텐츠의 패딩이에요
drawer.footer.padding --p-drawer-footer-padding 푸터의 패딩이에요

더 알아보기 (Learn more)

이 문서에는 원문에서 추출한 별도의 관련 문서 링크가 없어요.