Skip to content
Star

PxDialog

A modal dialog component. Supports header, content, and footer slots. Renders with an overlay backdrop and traps focus when open.

Usage

Demo

Props

PropTypeDefaultDescription
visiblerequiredbooleanControls dialog visibility. Use with v-model:visible.
headerstringundefinedDialog title text. Also overridable via the header slot.
modalbooleantrueWhen true, shows an overlay backdrop and clicking it closes the dialog.
closablebooleantrueShows the × close button in the header and enables closing with the Escape key.
maxWidthstring'560px'Max-width of the dialog box.
styleRecord<string, string>undefinedInline styles for the dialog container.

Emits

EventPayloadDescription
update:visiblebooleanEmitted with false when the dialog should close (backdrop click, Escape, or the × button).

Slots

SlotDescription
defaultMain dialog body content.
headerCustom header content (replaces header prop text).
footerFooter content, typically action buttons.

Built with VitePress