Skip to content

KDialog ​

示例 ​

选择尺寸打开对话框

Modal dialog with composable sub-components. Renders via Teleport to the document body. Supports Escape key and overlay click to close.

Sub-Components ​

  • KDialog — Root dialog container (manages open/close state)
  • KDialogContent — Centered modal content panel
  • KDialogOverlay — Semi-transparent backdrop overlay rendered automatically by KDialog
  • KDialogHeader — Header section with vertical gap layout
  • KDialogTitle — Dialog title (<h2> element)
  • KDialogDescription | Muted description text
  • KDialogFooter | Footer with action buttons

Props (KDialog) ​

NameTypeDefaultDescription
openbooleanfalseWhether the dialog is visible.
showCloseButtonbooleanfalseWhether to show a close button in the top-right corner.
size'sm' | 'md' | 'lg''md'Maximum width of the content panel.

Emits ​

NameParametersDescription
update:open(value: boolean)Emitted when the dialog open state changes (Escape key, overlay click, or close button).

Slots ​

NameDescription
defaultDialog content. Use sub-components for structured layouts.

Basic Usage ​