문서 오버레이

UISheet

정렬이나 작업 선택을 화면 가장자리의 짧은 패널로 표시합니다.

기본 사용법

아래에서 열리는 정렬 시트

정렬 기준을 선택하면 버튼에 반영됩니다. 시트 상단의 손잡이를 아래로 끌어 닫을 수도 있습니다.

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

const choices = ["최근 수정순", "이름순", "생성일순"];
const chosen = ref(choices[0]);

function choose(value: string, close: () => void) {
  chosen.value = value;
  close();
}
</script>

<template>
  <UISheet
    :trigger-label="`정렬 (${chosen})`"
    side="bottom"
    swipe-to-dismiss
    title="문서 정렬"
    description="문서 목록을 정렬할 기준을 선택합니다."
  >
    <template #body="{ close }">
      <div class="sort-options">
        <UIButton
          v-for="choice in choices"
          :key="choice"
          :variant="choice === chosen ? 'outline' : 'ghost'"
          @click="choose(choice, close)"
          >{{ choice }}</UIButton
        >
      </div>
    </template>
  </UISheet>
</template>

<style scoped>
.sort-options {
  display: grid;
  gap: var(--ui-space-xs);
}

.sort-options > .ui-button {
  justify-content: start;
}
</style>

설정과 동작

시트 열기 버튼의 아이콘

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

가용 너비에서 지점별 재고 비교

block을 지정하면 시트가 양쪽 여백 사이를 채웁니다. 화면이 좁아지면 재고 카드가 세로로 배치됩니다.

화면 위쪽에서 공지 보기

side=top으로 열리는 방향을, CSS의 --ui-sheet-width로 화면에 따른 너비를 지정합니다. 손잡이를 위로 밀거나 확인을 눌러 닫습니다.

손잡이를 끌어 닫기

손잡이를 아래로 끌거나 닫기 버튼을 누릅니다.

실전 예제

보고서 작업 선택

짧은 작업 목록에 size=sm을 적용합니다. 사본을 만들거나 보고서를 보관하면 버튼 옆에 결과가 표시됩니다.

공유 범위 적용과 취소

보고서에 접근할 범위를 고릅니다. 적용을 눌러야 선택이 반영됩니다.

긴 목록에서 수령 지점 선택

주소와 운영 시간을 함께 표시하도록 size=lg를 적용합니다. 목록을 스크롤해 방문할 지점을 선택합니다.

구성 컴포넌트

팝업과 위치

UISheetPortal

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

가용 너비에서 지점별 재고 비교 예제
UISheetOverlay

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

가용 너비에서 지점별 재고 비교 예제
UISheetContent

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

가용 너비에서 지점별 재고 비교 예제

탐색과 동작

UISheetTrigger

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

가용 너비에서 지점별 재고 비교 예제
UISheetHandle

시트를 가장자리 쪽으로 끌어 닫는 조작 영역입니다.

손잡이를 끌어 닫기 예제
UISheetClose

열린 콘텐츠를 닫습니다.

가용 너비에서 지점별 재고 비교 예제

값과 상태 표시

UISheetTitle

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

가용 너비에서 지점별 재고 비교 예제
UISheetDescription

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

가용 너비에서 지점별 재고 비교 예제

주요 API

속성과 모델

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

시트가 열린 상태를 외부에 연결합니다.

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

시트가 들어오는 방향입니다. 기본값은 bottom입니다.

화면 위쪽에서 공지 보기 예제
trigger-icon타입Component

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

시트 열기 버튼의 아이콘 예제
swipe-to-dismiss타입boolean | undefined

시트를 화면 가장자리 방향으로 밀어 닫을 수 있게 합니다.

화면 위쪽에서 공지 보기 예제
size / block

size는 sm, md, lg 중 하나를 선택합니다. 기본값은 md입니다. block을 지정하면 안전 영역과 바깥 여백을 뺀 가용 너비를 채웁니다.

가용 너비에서 지점별 재고 비교 예제
panel-class타입string | undefined

시트 패널에 CSS 클래스를 적용합니다.

슬롯

#body타입PanelSlot

시트에 담을 내용을 배치합니다. close를 사용해 선택 후 닫을 수 있습니다.

아래에서 열리는 정렬 시트 예제

스타일

--ui-sheet-width

맞춤 너비가 필요한 경우 Content의 CSS 클래스에서 지정합니다. 화면이 좁아지면 양쪽 여백을 유지하며 줄어듭니다.

전체 속성, 이벤트와 슬롯

UISheet

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
size
"sm" | "md" | "lg" | undefined
block
boolean | 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

UISheetContent

as
PrimitiveAs | undefined
as-child
boolean | undefined
size
"sm" | "md" | "lg" | undefined
block
boolean | undefined
#default
(props: {}) => any