Dialog API

This page provides an overview of the Dialog component API, detailing its props, emits, slots, and exposed methods/states.

Props

The Dialog component accepts the following props:

PropDefaultTypeDescription
modelValuefalsebooleanControls the visibility of the dialog.
size"2xl"Size or undefinedThe size of the dialog, which determines its width.
position"center"PositionShort or undefinedThe position of the dialog on the screen.
notAnimatefalseboolean or undefinedDisables animations for the dialog.
closeButtonfalseboolean or undefinedEnables a close button inside the dialog.
withoutMarginfalseboolean or undefinedRemoves the default margin inside the dialog.
notCloseBackgroundfalseboolean or undefinedPrevents closing the dialog when clicking the background.
toTeleport"body"string or undefinedSpecifies the target element to teleport the dialog.
class""StyleClass or undefinedCustom CSS class for the dialog container.
classBody""StyleClass or undefinedCustom CSS class for the dialog body.

Slots

The Dialog component provides the following slots:

SlotPayloadDescription
default{ closeDialog(): void }A slot for providing the main content of the dialog. Includes a method to close the dialog.
backgroundNoneA slot for customizing the dialog's background. If left empty, the background will be transparent.

Emits

The Dialog component emits the following events:

EventPayloadDescription
update:modelValuebooleanEmitted when the modelValue is updated, indicating the visibility state of the dialog.

Expose

The Dialog component exposes the following methods and states via ref:

ExposeValueDescription
toTeleportstringThe teleport target for the dialog.
isOpenbooleanIndicates whether the dialog is open.
sizestringThe current size of the dialog.
isCloseButtonbooleanIndicates whether the close button is enabled.
notCloseBackgroundbooleanIndicates whether the background click closes the dialog.
withoutMarginbooleanIndicates whether the dialog has margins removed.
positionstringThe current position of the dialog.
classBodyDialogStyleClassThe CSS class for the body of the dialog.
classPositionStyleClassThe CSS class for the dialog's position styling.
classBaseStyleClassThe base CSS class for the dialog container.
classDialogStyleClassThe CSS class for the dialog itself.
closeDialog() => voidCloses the dialog.

Size

The size prop accepts the following values to define the width of the dialog:

xs, sm, md, lg, xl, 2xl (default), 3xl, 4xl, 5xl, 6xl, 7xl

PositionShort

The PositionShort type defines the relative position of the dialog on the screen:

ValueDescription
"center"Centers the dialog on the screen.
"top"Positions the dialog at the top of the screen.
"bottom"Positions the dialog at the bottom of the screen.
"left"Positions the dialog on the left side of the screen.
"right"Positions the dialog on the right side of the screen.
"bottom-left"Positions the dialog at the bottom-left corner.
"top-left"Positions the dialog at the top-left corner.
"bottom-right"Positions the dialog at the bottom-right corner.
"top-right"Positions the dialog at the top-right corner.
© 2025 FishtVue by Egoka