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

Drawer

원문 보기 위키 갱신

Drawer (서랍 패널)

화면 가장자리에서 슬라이드되어 나타나는 패널 컴포넌트예요. 페이지 위에 겹쳐서 옆에서 밀려 들어오는 형태로 정보나 동작을 담아요.

출처: 문서

본문

언제 사용하나요

Drawer는 보통 페이지 위에 겹쳐서 옆에서 밀려 들어오는 패널이에요. 정보나 동작 집합을 담고 있어요. Drawer와 상호작용하면서 현재 페이지를 벗어날 필요가 없으므로, 같은 컨텍스트 안에서 작업을 더 효율적으로 완료할 수 있어요.

  • Form을 사용해 정보 집합을 만들거나 편집할 때 사용해요.
  • 하위 작업 처리. 하위 작업이 Popover로는 너무 무겁고 메인 작업의 컨텍스트 안에 유지하고 싶을 때 Drawer가 아주 유용해요.
  • 같은 Form을 여러 곳에서 사용해야 할 때.

API

🚨 참고: v4에서는 Modal과 API를 맞추기 위해 class와 style 대신 rootClassName와 rootStyle로 래퍼 스타일을 구성해요.

속성 설명 타입 기본값 버전
autofocus 열린 후 Drawer에 포커스가 가는지 여부 boolean true 3.0.0
bodyStyle Drawer 콘텐츠 부분의 스타일 CSSProperties -
class Drawer 패널 className 구성. 최상위 dom 스타일을 구성하려면 rootClassName을 사용하세요 string -
closable Drawer 대화상자 왼쪽 위에 닫기(x) 버튼 표시 여부 boolean true
closeIcon 커스텀 닫기 아이콘 VNode | slot <CloseOutlined /> 3.0.0
contentWrapperStyle 콘텐츠 부분의 drawer 래퍼 스타일 CSSProperties - 3.0.0
destroyOnClose drawer를 닫을 때 자식 컴포넌트를 언마운트할지 여부 boolean false
extra 모서리의 추가 동작 영역 VNode | slot - 3.0.0
footer Drawer의 푸터 VNode | slot - 3.0.0
footerStyle drawer 푸터 부분의 스타일 CSSProperties - 3.0.0
forceRender Drawer 컴포넌트를 강제로 사전 렌더링 boolean false 3.0.0
getContainer Drawer의 마운트 노드와 표시 창 HTMLElement | () => HTMLElement | Selectors 'body'
headerStyle drawer 헤더 부분의 스타일 CSSProperties - 3.0.0
height 배치가 top 또는 bottom일 때 Drawer 대화상자의 높이 string | number 378
keyboard esc 키로 닫기 지원 여부 boolean true
mask 마스크 표시 여부 Boolean true
maskClosable 마스크(Drawer 바깥 영역)를 클릭해 Drawer를 닫을지 여부 boolean true
maskStyle Drawer 마스크 요소의 스타일 CSSProperties {}
placement Drawer의 배치 'top' | 'right' | 'bottom' | 'left' 'right'
push 중첩 drawer의 밀어내기 동작 boolean | {distance: string | number} { distance: 180 } 3.0.0
rootClassName Drawer 대화상자 컨테이너의 클래스 이름 string - 4.0
rootStyle style과 달리 마스크를 포함하는 래퍼 요소의 스타일 CSSProperties - 4.0
style Drawer 패널의 스타일. body만 구성하려면 bodyStyle을 사용하세요 CSSProperties -
size 사전 설정된 drawer 크기, 기본 378px, large 736px default | large default 3.0.0
style drawerStyle과 달리 마스크를 포함하는 래퍼 요소의 스타일 CSSProperties -
title Drawer의 제목 string | slot -
open(v-model) Drawer 대화상자 표시 여부 boolean - 4.0
width Drawer 대화상자의 너비 string | number 378
zIndex Drawer의 z-index Number 1000

Events

이벤트 이름 설명 타입 기본값 버전
afterOpenChange drawer 전환 시 애니메이션 종료 후 콜백 function(open) - 4.0
close 사용자가 마스크, 닫기 버튼 또는 취소 버튼을 클릭했을 때 호출되는 콜백 지정 function(e) -

더 알아보기 (Learn more)