Dialog

Present focused modal content and require a user decision.

Dialog

Default

Use s-dialog and its slots to compose a custom interface. Give form inputs the block prop to fill the available width.

Type

You can easily create the most common types of dialogs such as Alert, Confirm or Prompt using the different slots for the structure of the header,default, footer dialog

Loading

Add a loading animation to the dialog with the loading property

No close button

Use not-close to hide the top-right close button. Other dismissal methods remain controlled by their respective settings.

Scroll

There are cases where you need a scroll because there is a lot of information within the dialog for this you can use the scroll property

Lock scroll Body

If you need to remove the page scroll when opening the dialog you can do it with the lock-scroll property

Not Padding

If you need to remove the padding from the dialog to make a more personalized interface you can do it with the not-padding property

Nested Dialogs

You can nest as many s-dialog as you need without problem

Full Screen

full-screen dialogs expose minimization by default; set :minimizable="false" to hide it. Minimization preserves content and form state without changing v-model, releasing the mask and scroll lock. Dock bubbles can restore or close dialogs, respecting before-close; multiple bubbles appear together. Use minimized-label to name the bubble.

Overlay blur

You can add a blur style to all the elements behind the dialog with the overlay-blur property, this functionality depends on the css property backdrop-filter

Shape

Change the dialog style by removing the border radius and making it rectangular

Restrict dismissal

Set prevent-close to block closing by clicking the overlay or pressing Escape. Close buttons, confirmation/cancellation actions, and programmatic requests still follow their own closing configuration and the before-close guard.

Customize the action layout with the footer slot. Its confirm and cancel callbacks preserve the confirmation and cancellation flow; pending, closePending, and disabled synchronize buttons and status feedback. This example uses confirm-closable="false" to stay open after asynchronous confirmation so you can observe events. Cancel closes the dialog.

Close animation

The closing dissolve defaults to 220ms. Set close-animation-duration in milliseconds; 0 finishes immediately. Imperative calls and global Dialog configuration use closeAnimationDuration. The surface and overlay are removed together when dissolution finishes, without an additional overlay fade.

Dialogs close with an SVG particle dissolve by default. Set :close-animation="false" to disable it. Only the surface or minimized bubble is filtered; the overlay stays unchanged during the dissolve. With before-close, dissolution begins after approval and loading completion. Rejected closing does not animate. Imperative calls also accept closeAnimation: false. Reduced motion and hidden pages skip the dissolve.

Before close

With before-close, overlay clicks do nothing by default. Explicitly set :mask-closable="true" on this instance to let them request closing and run the guard. Neither the component default nor global dialog.maskClosable enables this entry. Close buttons, Escape, confirmation/cancellation, and programmatic requests still follow their existing configuration.

before-close is () => Promise<void> and takes no callback argument. Return Promise.resolve() or fulfill an async function to continue closing. Promise.reject('reason') or a thrown Error blocks closing and displays its reason. Close buttons, overlay clicks, Escape, cancellation, closing after confirmation, dock bubbles, instance close(), and controlled v-model close requests use the same check. Minimizing does not run it.

While pending, the dialog and overlay stay mounted, close buttons show loading, and repeated requests share one check. Rejecting a controlled close emits v-model=true to restore visibility. Use close-error for logging; custom footers receive closePending. Results from an unmounted or reopened instance cannot close a new instance or display a stale notification. SDialogBox also waits for actual closing and disposal before settling its outer Promise. The close indicator finishes its lead-in, then its colored strands clear at four points before the dialog exits. Confirmation buttons retain the default logo restoration. Instant checks that never show a loader add no wait; reduced-motion mode and hidden pages finish the visual motion immediately.

Global lifetime

By default, dialogs and bubbles are disposed with their owner. Set global when creating the instance to retain the same dialog after its owner unmounts, until the user closes it; page reloads do not preserve it. Changing global at runtime does not migrate an instance. Retained dialogs keep their slots, injected context, and callbacks but stop receiving owner prop updates after unmount. Callers own callback references, asynchronous tasks, and subscriptions, and must avoid accessing destroyed page instances.

Imperative

After app.use(SaxDesignVue), $dialog is available. Import SDialogBox for direct calls, or install it with app.use(SDialogBox) to bind the application context.

SDialogBox and $dialog reuse Dialog rendering and lifecycle without a template. alert() resolves an action; confirm() resolves true on confirmation and rejects with cancel or close otherwise. Calling SDialogBox directly resolves confirm, cancel, or close after the closing animation and disposal. Imperative instances own their lifetime; handle confirmation cancellation explicitly.

Before confirm

before-confirm can run SForm.validate() and await asynchronous work. Return false to keep the dialog open. The confirm button shows loading and ignores duplicate requests while pending; stale results after cancellation or close cannot confirm. Handle confirm-error to display business errors. Custom footers receive confirm, cancel, pending and disabled to reuse the same flow.

API

PROPS

Property
Type
Values
Description
default
Example
More
close-animation-duration
Number
non-negative milliseconds
Duration of the closing dissolve. Defaults to 220ms; 0 finishes immediately. Applies only to the surface or bubble.
220
close-animation
Boolean
true | false
Dissolve the dialog surface or minimized bubble when closing; false disables close animation. The overlay is never filtered.
true
before-confirm
—
Validate before confirming, synchronously or asynchronously. Returning false keeps the dialog open; success emits confirm and follows confirm-closable. Errors emit confirm-error and keep it open.
—
confirm-disabled
Boolean
—
Disable the built-in confirmation action.
false
minimizable
Boolean
—
Show the minimize action. Defaults to enabled for full-screen dialogs and disabled otherwise.
—
global
Boolean
—
Set at creation time to retain an opened dialog and its bubble after the owner unmounts; closing releases the retained instance.
false
minimized-label
String
—
Bubble label. Falls back to title, then a localized generic label.
—
before-close
() => Promise<void>
Async close approval with no arguments. Only Promise resolution permits closing. Rejection or an exception keeps it open and displays the string or Error.message in a Notification. A non-Promise return blocks closing.
—
color
String
primary | success | danger | warn | warning | dark | text | light | secondary | RGB | RGBA | HEX | HSL | HSLA
Set the dialog accent color.
primary
—
top
String | Number
CSS length
Set the dialog's top offset.
—
—
height
String | Number
CSS length
Set the dialog height.
—
—
min-width
String | Number
CSS length
Set the dialog minimum width.
—
—
min-height
String | Number
CSS length
Set the dialog minimum height.
—
—
cancel-closable
Boolean
true | false
Close the dialog after the cancel action.
true
—
confirm-closable
Boolean
true | false
Close the dialog after the confirm action.
true
—
cancel-button-text
String
button label
Set the built-in cancel button label.
—
—
confirm-button-text
String
button label
Set the built-in confirm button label.
—
—
v-model
Boolean
truefalse
Determine whether the dialog is visible.
false
not-center
Boolean
truefalse
By default the header centers the elements, with this property the centering is eliminated.
false
width
String
px
Determine the width of the dialog.
—
loading
Boolean
truefalse
Add a loading animation to the dialog.
false
not-close
Boolean
truefalse
Remove the close button from the dialog.
false
scroll
Boolean
truefalse
Makes the content a maximum high and gives the possibility to overflow the content add scroll.
false
lock-scroll
Boolean
truefalse
When the dialog is opened, the page scroll is deleted.
false
auto-width
Boolean
truefalse
It makes the dialog have an automatic width to its content.
false
not-padding
Boolean
truefalse
Eliminates the padding of the base elements of the dialog.
false
full-screen
Boolean
truefalse
Makes the dialog the size of the window.
false
overlay-blur
Boolean
truefalse
Makes all elements blur when the dialog opens.
false
shape
String
rounded | square
Set rounded or square dialog geometry.
rounded
prevent-close
Boolean
truefalse
Block overlay-click and Escape dismissal without disabling explicit close actions.
false
title
String | Number
header text
Set the built-in title when the header slot is not used.
—
content
String | Number
content text
Set built-in content when the default slot is not used.
—
show-header
Boolean
true | false
Render the built-in header area.
true
show-footer
Boolean
true | false
Render built-in action footer and modal events.
false
show-cancel-button
Boolean
true | false
Render built-in action footer and modal events.
false
show-confirm-button
Boolean
true | false
Render built-in action footer and modal events.
false
mask
Boolean
true | false
Control overlay and dismissal behavior.
true
mask-closable
Boolean
true | false
Request closing on overlay clicks. With before-close, only an explicit true on this instance enables it; component and global defaults do not opt in.
true without before-close; guarded dialogs require explicit true
show-close
Boolean
true | false
Control overlay and dismissal behavior.
true

EVENTS

Event
Type
Payload
Description
default
Example
More
close-error
(error: unknown) => void
—
Emitted when close approval is rejected, throws, or returns no Promise. Dialog also displays the rejection reason.
—
confirm-error
(error: unknown) => void
—
Emitted when before-confirm throws or rejects.
—
minimize
—
—
Emitted after minimizing; does not change v-model.
—
—
restore
—
—
Emitted after restoring from the dock.
—
—
close
Function
null
triggers when the Dialog closes
—

SLOTS

Slot
Scope
Description
default
Example
More
default
null
slot default of Dialog
—
header
null
slot header of Dialog
—
footer
slot footer of Dialog
—

EXPOSES

Method
Type
Description
default
Example
More
closePending
Boolean
Whether close approval, loading completion or dissolution is pending. Repeated close requests share the same task.
—
confirm
() => Promise<void> | undefined
Run the same validation and confirmation flow as the built-in button.
—
minimize
() => void
Minimize an open dialog when minimization is enabled.
—
restore
() => void
Restore a minimized dialog and its focus.
—
open
() => void
Open the dialog.
—
—
close
() => Promise<boolean> | undefined
Request closing through before-close and return whether closing was approved. Observe closed for animation and disposal completion.
—
—
Last Updated: 2026-10-28, 06:17:56 UTC
Copied