Alert Dialog

Replace browser native alert dialog with a customizable dialog component.

Installation

npx shadcn-vue@latest add https://dsn-ui.pages.dev/r/dsn-alert-dialog.json
Note: You only need to place the <DsnAlertDialog /> component once at the root layout of your application. The dialog is automatically controlled globally via the showAlertDialog and showConfirmDialog functions.

Usage

Basic Alert

Show a simple alert dialog using showAlertDialog(). It only displays a message with a close button.

Without Title

Show an alert dialog without a title. The title is purely optional.

Confirm Dialog

Show a confirmation dialog using showConfirmDialog(). This resolves a boolean indicating whether the user proceeded or cancelled.

Props

PropTypeDescription
locale

string

Default: 'en'

Locale to use for formatting default action buttons. Built-in support for 'en' and 'id'.

Example: 'id'

lang

Partial<LangItems>

Default: undefined

Language override object to manually specify translations for 'cancel', 'continue', and 'close'.

Example: { continue: 'Yes, proceed' }