문서 오버레이

UIDrawer

화면 가장자리에서 탐색이나 설정을 위한 패널을 엽니다.

기본 사용법

화면 가장자리에서 패널 열기

화면 가장자리와 간격을 둔 오른쪽 패널에서 배포 조건을 선택합니다. 적용을 누르면 선택한 조건 수가 버튼에 표시됩니다.

<script setup lang="ts">
import { UIButton, UICheckbox, UIDrawer } from "@connextable/ui";
import { computed, ref } from "vue";

const activeOnly = ref(false);
const failuresOnly = ref(false);
const applied = ref(0);
const conditionCount = computed(
  () => Number(activeOnly.value) + Number(failuresOnly.value),
);

function applyFilters(close: () => void) {
  applied.value = conditionCount.value;
  close();
}
</script>

<template>
  <UIDrawer
    :trigger-label="applied ? `배포 필터 (${applied}개)` : '배포 필터'"
    side="right"
    :swipe-to-dismiss="false"
    title="배포 필터"
    description="배포 목록에 표시할 조건을 선택합니다."
  >
    <template #body>
      <div class="filter-options">
        <UICheckbox v-model="activeOnly" label="진행 중인 배포" />
        <UICheckbox v-model="failuresOnly" label="실패한 배포" />
      </div>
    </template>
    <template #footer-leading>조건 {{ conditionCount }}개 선택</template>
    <template #actions="{ close }"
      ><UIButton @click="applyFilters(close)">적용</UIButton></template
    >
  </UIDrawer>
</template>

<style scoped>
.filter-options {
  display: grid;
  gap: var(--ui-space-sm);
}
</style>

설정과 동작

드로어 열기 버튼의 아이콘

trigger-icon에 Vue 컴포넌트를 전달해 기본 열기 버튼의 라벨 앞에 표시합니다.

네 방향에서 패널 열기

side에 지정한 화면 가장자리에서 패널이 들어옵니다.

바깥을 눌러도 열린 패널 유지

오버레이를 눌러도 패널을 유지합니다. 닫기 버튼이나 Escape로 종료할 수 있습니다.

조합과 확장

긴 패널 본문 끝까지 읽기

활동 기록을 스크롤해도 닫기 버튼은 오른쪽 위에 유지됩니다.

포털에서 패널 표시

포털에 패널과 오버레이를 배치합니다.

구성 컴포넌트

팝업과 위치

UIDrawerPortal

콘텐츠를 현재 DOM 계층 밖의 포털 대상으로 옮깁니다.

포털에서 패널 표시 예제
UIDrawerOverlay

열린 창 뒤에서 배경과 활성 영역을 구분합니다.

네 방향에서 패널 열기 예제
UIDrawerContent

트리거 또는 현재 값에 연결된 콘텐츠를 담습니다.

네 방향에서 패널 열기 예제

탐색과 동작

UIDrawerTrigger

컨트롤을 실행하거나 콘텐츠를 여는 버튼입니다.

네 방향에서 패널 열기 예제
UIDrawerHandle

패널을 끌어 닫는 조작 영역을 표시합니다.

UIDrawerClose

열린 콘텐츠를 닫습니다.

값과 상태 표시

UIDrawerTitle

콘텐츠의 제목을 표시하고 접근성 이름으로 연결합니다.

네 방향에서 패널 열기 예제
UIDrawerDescription

콘텐츠의 목적이나 추가 설명을 연결합니다.

네 방향에서 패널 열기 예제

주요 API

속성과 모델

v-model:open타입boolean | undefined | false | undefined

패널이 열린 상태를 외부에 연결합니다.

side타입"top" | "right" | "bottom" | "left" | undefined

패널이 표시될 화면 가장자리를 지정합니다.

네 방향에서 패널 열기 예제
trigger-icon타입Component

기본 열기 버튼의 텍스트 앞에 표시할 아이콘입니다.

드로어 열기 버튼의 아이콘 예제
Content show-close

오른쪽 위의 기본 닫기 버튼을 표시합니다. 기본값은 true입니다.

Content close-label

기본 닫기 버튼의 접근성 이름입니다.

슬롯

#body / #actions / #footer-leading

패널의 실제 내용, 적용 버튼, 보조 상태를 배치합니다. 각 슬롯에서 close를 사용할 수 있습니다.

화면 가장자리에서 패널 열기 예제
전체 속성, 이벤트와 슬롯

UIDrawer

disabled
boolean | undefined
label
string | undefined
close-on-interact-outside
boolean | undefined
side
"top" | "right" | "bottom" | "left" | undefined
anchor
HTMLElement | null | undefined
close-on-escape
boolean | undefined
modal
boolean | undefined
described-by
string | null | undefined
initial-focus
HTMLElement | undefined
auto-focus
boolean | undefined
restore-focus
boolean | undefined
restore-focus-target
HTMLElement | null | undefined
trap-focus
boolean | undefined
interact-outside-exclusions
readonly HTMLElement[] | undefined
swipe-to-dismiss
boolean | undefined
swipe-threshold
number | undefined
swipe-velocity-threshold
number | undefined
presentation
"overlay" | undefined | "inline"
open
boolean | undefined | false | undefined
default-open
boolean | undefined | false | undefined
unmount-on-exit
boolean | undefined | false
show-close
boolean | undefined
close-label
string | undefined
title
string | undefined
description
string | undefined
trigger-label
string | undefined
trigger-icon
Component | undefined
panel-class
string | undefined
@update:open
(open: boolean) => void
@close-request
(reason: PopupCloseReason) => void
@after-close
() => void
@interact-outside
InteractOutsideHandler
#default
(state: PopupRootSlotProps) => VNodeChild
#trigger
PanelSlot
#body
PanelSlot
#actions
PanelSlot
#footer-leading
PanelSlot

UIDrawerContent

as
PrimitiveAs | undefined
as-child
boolean | undefined
show-close
boolean | undefined
close-label
string | undefined
#default
() => unknown
#footer-leading
() => unknown
#actions
() => unknown