Prompt

Confirmation and alert dialogs with built-in Accept/Cancel actions. Use Dialog for fully custom modal layouts.

Prompt

Prompt is the confirmation / alert dialog — not a duplicate of Dialog.

Prompt (s-prompt)Dialog (s-dialog)
PurposeQuick confirm, alert, or short forms with validationGeneral-purpose modal shell
LayoutFixed: title bar + body + Accept / Cancel footerFully custom #header, default, #footer slots
Typical use“Delete this item?”, security code, name validationLogin panel, nested modals, fullscreen content
Overlay (confirm)Shakes to hint “use a button”Closes or uses prevent-close

In Vuesax 3.x both come from the Dialogs family (vs-prompt is a preset on the same dialog primitive). Popup (vs-popup) is yet another component — a titled content panel, not yet migrated here.

Rule of thumb: need built-in OK/Cancel → Prompt. Need to own the whole layout → Dialog.

Default

Use the default slot to place inputs, selects, or any custom content inside the prompt.

Code copied

Alert

type="alert" adds a header close button and closes when the overlay is clicked.

Code copied

Validation

Use is-valid to disable the accept button until the form inside the slot is valid.

Code copied

Programmatic

After app.use(SaxDesignVue), call $prompt (Options API) or import SPromptBox — no template required. This matches the official $vs.dialog() helper.

import { SPromptBox } from 'sax-design-vue'

// Alert — resolves when dismissed
await SPromptBox.alert('Saved successfully.', 'Notice')

// Confirm — resolves on Accept, rejects on Cancel / close
try {
  await SPromptBox.confirm('Delete this item?', 'Confirm')
  // user accepted
} catch {
  // user cancelled
}

// Full options + action result
const action = await SPromptBox({
  title: 'Confirm',
  text: 'Continue?',
  type: 'confirm',
  color: 'danger',
})
// action: 'accept' | 'cancel' | 'close'
Code copied

API

PROPS

PropertyTypeValuesDescriptiondefaultExampleMore
button-accept / button-cancel / accept-text / cancel-textBoolean / Boolean / String / Stringaction visibility and labelsConfigure prompt action buttons and their text.-
close-iconStringIconify icon nameCustomize the close control icon.-
v-modelBooleantruefalseDialog visibility.
titleStringStringDialog title.Dialog
textStringStringDialog body text when the default slot is empty.
typeStringalertconfirmAlert shows a header close button and closes on overlay click. Confirm shakes on overlay click.alert
colorStringprimarysuccessdangerwarningdarkAccent color for the title and accept button.primary
is-validBoolean | StringtruefalsenoneWhen false, the accept button stays disabled. Use none to skip validation.none
accept-textStringStringAccept button label.Accept
cancel-textStringStringCancel button label.Cancel
buttons-hiddenBooleantruefalseHide action buttons.
No matching data

EVENTS

PropertyTypeValuesDescriptiondefaultExampleMore
update:modelValueVisibility change.
acceptAccept button clicked.
cancelCancel button clicked.
closeDialog closed.
No matching data
Last Updated: 2026-08-17, 08:33:54