reopt design
DocsExploreTemplatesCanvasToolsPricing
Login
opt-uiopt-chartsopt-datagridopt-editoropt-calendaropt-filemanageropt-chatopt-shellbrandapp-ui
Overview205Core74Shells99Blocks32
Dialog
reopt designreopt design

A design system for the AI era

  • Docs
  • Pricing
  • Releases
  • About
  • Contact
  • Terms of Service
  • Privacy Policy

reopt Inc.Business registration no. 217-88-02453contact@reopt.ai

© 2026 reopt Inc. All rights reserved.

Dialog

Component

Compose accessible modal dialogs with triggers, headings, descriptions, dismissal controls, and header, body, and footer regions.

overlay
Related docs
bun add @reopt-ai/opt-ui
Install and import
bash
bun add @reopt-ai/opt-ui
tsx
import { DialogRoot, DialogDisclosure, DialogPanel, AlertDialogPanel, DialogHeading, DialogDescription, DialogDismiss, DialogHeader, DialogBody, DialogFooter } from "@reopt-ai/opt-ui";

Live preview

Change the width and theme, then interact with the components.

100%

기본 구조 — Header / Body / Footer

DialogDisclosure — 비제어 모드

DialogDisclosure를 사용하면 open/setOpen 상태 관리 없이 다이얼로그를 열고 닫을 수 있습니다.

사이즈 변형 — xs ~ full

접근성 — aria-labelledby / aria-describedby 자동 연결

DialogHeading은 자동으로 aria-labelledby를, DialogDescription은 aria-describedby를 다이얼로그에 연결합니다. 수동 ID 관리가 필요 없습니다.

스크롤 가능한 본문 — DialogBody overflow

다이얼로그 닫기 패턴

다이얼로그를 닫는 여러 방법을 확인할 수 있습니다. ESC, 배경 클릭, 또는 Button의 onClick으로 setOpen(false)을 호출합니다.

중첩 다이얼로그 — 다이얼로그 안에 다이얼로그

커스텀 레이아웃 — Header/Body/Footer 선택적 사용

Header, Body, Footer는 모두 선택적입니다. 필요한 부분만 사용할 수 있습니다.

Usage guidance

Anatomy

  • Connect Disclosure and Panel through DialogRoot, and place Heading and Description inside Panel.

Best practices

  • Provide open and onOpenChange together for controlled visibility. Expose a close action through DialogDismiss.

Usage to avoid

  • Every modal needs a title and a way to close it. Use AlertDialogPanel for confirmation of destructive actions.

Usage examples

Modal dialog

DialogRoot

PropTypeDefaultDescription
openboolean—제어 모드: 열림 상태
setOpen(open: boolean) => void—제어 모드: 상태 변경 핸들러

DialogDisclosure

PropTypeDefaultDescription
childrenRequiredReactNode—트리거 버튼 내용
classNamestring—기본 스타일 오버라이드

DialogPanel

PropTypeDefaultDescription
childrenRequiredReactNode—다이얼로그 콘텐츠
size"xs" | "sm" | "md" | "lg" | "xl" | "full""md"최대 너비 프리셋
backdropReactElement<div> (반투명 배경)배경 오버레이 요소
classNamestring—기본 스타일 오버라이드

DialogHeading

PropTypeDefaultDescription
childrenRequiredReactNode—제목 텍스트 (자동 aria-labelledby 연결)

DialogDescription

PropTypeDefaultDescription
childrenRequiredReactNode—설명 텍스트 (자동 aria-describedby 연결)

DialogDismiss

PropTypeDefaultDescription
childrenReactNode—닫기 버튼 내용

DialogHeader

PropTypeDefaultDescription
childrenRequiredReactNode—Heading, Description, Dismiss 등 헤더 콘텐츠

DialogBody

PropTypeDefaultDescription
childrenRequiredReactNode—스크롤 가능한 본문 콘텐츠

DialogFooter

PropTypeDefaultDescription
childrenRequiredReactNode—액션 버튼 영역

컴포넌트 의존 관계

깊이
▲ USED BY (4)command-paletteconfirm-dialogsave-query-dialogcustom-dashboardDialog
View test results

테스트 커버리지

2026년 7월 9일7/7 통과
7성공
0실패
7전체
  • open=true일 때 dialog role을 갖는다
  • AlertDialogPanel은 alertdialog role을 갖는다
  • open=false일 때 dialog role이 없다
  • DialogDismiss를 렌더링한다
  • DialogHeading이 aria-labelledby를 자동 연결한다
  • DialogDescription이 aria-describedby를 자동 연결한다
  • DialogHeader/Body/Footer 구조를 렌더링한다

키보드 동작

키동작
Esc다이얼로그 닫기
Tab다이얼로그 내 포커스 이동 (트랩)

Blocks that use this component

opt-ui

CustomDashboard

Blocks

Arrange custom dashboard widgets with WidgetGrid, ReportBuilder, ReportWidget, and FilterBar.

Related components

opt-ui

Disclosure

Core

Expand and collapse content with Root, Trigger, and Content components.

opt-ui

Popover

Core

Show floating content anchored to a trigger using the Popover primitive.

opt-ui

Drawer

Core

Open accessible side or bottom sliding panels with a Dialog-based compound API.

opt-ui

Menu

Core

Compose menu bars and individual menus with checkbox items, radio items, separators, and popovers.

opt-ui

DropdownMenu

Core

Create a single-trigger dropdown with a convenient wrapper around Menu Core.

opt-ui

FieldToken

Core

Display field types with consistent glyphs and optional labels for strings, numbers, dates, IP addresses, and geographic data.

PreviousSelectNextCombobox