Skip to content

Dialogs

Install

bash
npm install gooddialogs

Import single

ts
import 'gooddialogs/dist/base.min.css';
import {goodDialogs} from 'gooddialogs';

Import and create instance

ts
import 'gooddialogs/dist/base.min.css';
import {GoodDialogs} from 'gooddialogs';
const goodDialogs = new GoodDialogs('Message');

Use

ts
const resDialog = await goodDialogs.confirm('Message')

With Options

Light Mode
Theme:
Message:
Title
Subtitle
Confirm Button Text
Cancel Button Text
Dark Force
Light Force
Persistent
ts
const resDialog = await goodDialogs.confirm('Mensaje', {/* Options */})

Confirm Dialog

ts
const resDialog = await goodDialogs.confirm('Mensaje')

Option Properties

ParameterTypeExplanation
alertClassstringAdditional CSS class for the alert.
alertInstringDefines the entry animation for the alert.
alertOutstringDefines the exit animation for the alert.
cancelButtonClassstringCSS class for the cancellation button.
cancelButtonTextstringText for the cancellation button.
confirmButtonClassstringCSS class for the confirmation button.
confirmButtonTextstringText for the confirmation button.
containerClassstringCSS class for the alert container.
darkForcebooleanForces the use of the dark theme.
divIconClassstringCSS class for the icon within the alert.
footerClassstringCSS class for the alert footer.
lightForcebooleanForces the use of the light theme.
onConfirm() => voidFunction that executes when the user confirms the alert.
persistentbooleanIndicates whether the alert should remain visible until the user manually closes it.
position'top' | 'left' | 'right' | 'center' | 'top-left' | 'top-center' | 'top-right'Defines the position of the alert on the screen.
subtitlestring | nullSubtitle of the alert.
themeOptionThemeTheme of the alert, defined by OptionTheme.
timernumber | nullSets the time in milliseconds before the alert automatically closes.
titlestring | nullTitle of the alert.