# DialogOptions

**Kind**: interface | **Module**: [Windows](https://docs.interop.io/desktop/reference/javascript/windows/index.md)

**Source**: https://docs.interop.io/desktop/reference/javascript/windows/dialogoptions/index.html

Options for showing a dialog.

## Properties

- **`affirmativeButtonName`** (`string`, optional)
  Name for the affirmative response button.
- **`cancelButtonName`** (`string`, optional)
  Name for the canceling button.
- **`context`** (`unknown`, optional)
  Context data that can be used by a custom dialog.
- **`defaultAction`** (`"affirmative" | "negative" | "cancel"`, optional)
  Determines which dialog button to be the default one.
  The action tied to the default button will be executed when the user presses `ENTER` when no button is active
  (i.e., when the buttons aren't on focus and none is selected).
- **`inputMaxLength`** (`number`, optional)
  The amount of characters that can be entered in the input field of a `SingleInputDialog`.
- **`inputPattern`** (`string`, optional)
  String pattern that serves as a regular expression for validating the input from the user in a `SingleInputDialog`.
  If such pattern is specified and the input doesn't match it, an error will be displayed and the input field
  will indicate visually that the user input is invalid.
- **`inputPatternErrorMessage`** (`string`, optional)
  Error message to be displayed if the user input doesn't match the specified validation pattern for a `SingleInputDialog`.
- **`inputPlaceholder`** (`string`, optional)
  Placeholder that will be displayed in the input field of a `SingleInputDialog`.
- **`message`** (`string`, required)
  Message to the user that the dialog will contain.
- **`messageTitle`** (`string`, optional)
  Title for the message that will be displayed in the dialog.
- **`mode`** (`DialogMode`, optional)
  Mode for the dialog.
- **`movable`** (`boolean`, optional) default: `true`
  If `true`, the user will be able to move the dialog.
- **`negativeButtonName`** (`string`, optional)
  Name for the negative response button.
- **`showAffirmativeButton`** (`boolean`, optional) default: `false`
  If `true`, the affirmative response button will be shown in the dialog. The default value is for custom dialogs, as predefined dialog types have different defaults.
- **`showCancelButton`** (`boolean`, optional) default: `false`
  If `true`, the canceling button will be shown in the dialog. The default value is for custom dialogs, as predefined dialog types have different defaults.
- **`showNegativeButton`** (`boolean`, optional) default: `false`
  If `true`, the negative response button will be shown in the dialog. The default value is for custom dialogs, predefined dialog types have different defaults.
- **`showTimer`** (`boolean`, optional) default: `false`
  If `true`, a countdown timer will be shown in the dialog, warning the user that the dialog will close automatically after the specified time.
  You must also specify a value for `timerDuration`, otherwise a timer won't be shown.
- **`size`** (`Size`, optional)
  Size for the dialog to show.
- **`timerDuration`** (`number`, optional)
  Interval in seconds after which the dialog will close automatically.
  If `showTimer` is set to `true`, a countdown timer will be displayed in the dialog,
  otherwise the dialog will close silently without a warning for the user.
  If the user doesn't interact with the dialog before the timer expires,
  the `action` property of the `DialogResult` object will be set to `"expired"`.
- **`title`** (`string`, optional)
  Title for the dialog that will be displayed in the dialog header.
- **`transparent`** (`boolean`, optional) default: `false`
  If `true`, the io.Connect Window containing the dialog will be transparent.
- **`type`** (`DialogType | string`, required)
  Type of the dialog to show. Can be either a predefined io.Connect dialog type, or a custom one.

## Related types

- [DialogMode](https://docs.interop.io/desktop/reference/javascript/windows/dialogmode/index.md)
- [DialogType](https://docs.interop.io/desktop/reference/javascript/windows/dialogtype/index.md)
- [Size](https://docs.interop.io/desktop/reference/javascript/windows/size/index.md)
