Flame

Drawer

화면 가장자리에서 슬라이드되어 나타나는 헤드리스 드로어 컴포넌트. 네이티브 <dialog>의 top layer를 사용해 포커스 트랩, ESC 키 처리, 중첩 드로어 스태킹을 제공합니다. Trigger, Content, Closer 하위 컴포넌트로 구성합니다.

데모

Drawer 패널

이 드로어는 네이티브 <dialog> top layer 기반으로 포커스 트랩, ESC 키 처리, 중첩 스태킹을 제공합니다.

Drawer 패널

이 드로어는 네이티브 <dialog> top layer 기반으로 포커스 트랩, ESC 키 처리, 중첩 스태킹을 제공합니다.

Drawer 패널

이 드로어는 네이티브 <dialog> top layer 기반으로 포커스 트랩, ESC 키 처리, 중첩 스태킹을 제공합니다.

Drawer 패널

이 드로어는 네이티브 <dialog> top layer 기반으로 포커스 트랩, ESC 키 처리, 중첩 스태킹을 제공합니다.

API 레퍼런스

Drawer

PropTypeDefaultDescription
placement"top" | "right" | "bottom" | "left""right"드로어가 슬라이드되어 나올 화면 가장자리
idstring-콘텐츠 요소의 커스텀 id. 생략 시 자동 생성
closeOutsidebooleanfalse콘텐츠 영역 외부(백드롭) 클릭 시 드로어 닫기
keepMountedbooleantrue드로어가 닫힌 상태에서도 DOM에 콘텐츠 유지
animationDrawerAnimation | falseauto slide슬라이드 애니메이션 설정 (Web Animations API). 기본값은 placement에 따른 슬라이드이며, false로 비활성화할 수 있습니다. prefers-reduced-motion을 따릅니다.
onOpen() => void-드로어가 열릴 때 호출
onClose() => void-드로어가 닫힐 때 호출
childrenReactNode-Drawer 하위 컴포넌트 (Trigger, Content, Closer)

Drawer.Trigger

PropTypeDefaultDescription
childrenReactElement | ((props: { open: () => void }) => ReactNode)-클릭 가능한 요소 또는 open 핸들러를 받는 렌더 함수

Drawer.Content

PropTypeDefaultDescription
...propsOmit<ComponentPropsWithoutRef<"dialog">, "onClose" | "onClick">-네이티브 dialog 요소 속성 (onClose/onClick 제외). showModal로 top layer에 렌더링되어 포커스 트랩 적용

Drawer.Closer

PropTypeDefaultDescription
childrenReactElement | ((props: { close: () => void }) => ReactNode)-클릭 가능한 요소 또는 close 핸들러를 받는 렌더 함수