모달 (Modal)

제목, 콘텐츠 영역 및 작업 버튼을 제공하는 모달 대화 상자를 표시합니다.

언제 사용하나요

사용자의 작업 흐름을 방해하기 위해 새 페이지로 이동하지 않고 애플리케이션과 상호 작용해야 하는 경우, Modal을 사용하여 현재 페이지 위에 새 오버레이 레이어를 만들어 사용자로부터 피드백이나 정보를 얻을 수 있습니다.

기본

기본 모달입니다.

Edit Profile

Make changes to your profile here. Click save when you're done.

정보 모달 대화 상자

다양한 유형의 정보 모달 대화 상자에서는 대화 상자를 닫는 버튼이 하나만 제공됩니다.

사용자 정의 부분

사용자 정의 바닥글 버튼 표시줄 또는 헤더를 정의하는 더 복잡한 예제입니다.

A

Custom Header

This modal cannot be closed by clicking outside or pressing Escape because `closable=`. You must provide a button to close it.

Utility Methods

The Modal component automatically exposes window.Modal.open(id) and window.Modal.close(id) global utilities to make it easy to trigger modals from anywhere in your client-side JavaScript.

script.html
<script>
  // Open a modal programmatically
  window.Modal.open('my-modal');

  // Close a modal programmatically
  window.Modal.close('my-modal');
</script>

API Reference

속성
설명
타입
기본값

id

모달의 고유 식별자, 열기/닫기에 필요합니다. string -

title

모달 헤더의 선택적 제목 텍스트. string -

description

제목 아래에 표시되는 선택적 설명 텍스트. string -

variant

아이콘과 테두리 색상을 결정하는 의미론적 스타일 변형. 'default' | 'success' | 'error' | 'info' | 'warning' 'default'

closable

true인 경우, 닫기 버튼을 표시하고 배경이나 ESC 키로 닫을 수 있습니다. boolean true

draggable

true인 경우, 사용자가 헤더를 통해 모달을 드래그할 수 있습니다. boolean false

resizable

true인 경우, 사용자가 오른쪽 하단에서 모달 크기를 조정할 수 있습니다. boolean false

width

사용자 지정 너비 (예: "600px", "80vw"). string -

height

사용자 지정 높이 (예: "400px", "50vh"). string -