If set to false, the user can't dismiss the modal by pressing the Escape key. You can also pass a custom function returning a boolean value, e.g. if you want to disable the escape key for the loading state of a modal.
If set to false, the user can't dismiss the modal by clicking outside it. You can also pass a custom function returning a boolean value, e.g. if you want to disable outside clicks for the loading state of a modal.
If set to false, modal CSS animation will be disabled.
Whether or not SweetAlert2 should show a full screen click-to-dismiss backdrop. Either a boolean value or a css background value (hex, rgb, rgba, url, etc.)
Modal window background (CSS background property).
A custom CSS class for the "Cancel"-button.
Use this to change the background color of the "Cancel"-button (must be a HEX value).
Use this to change the text on the "Cancel"-button.
A custom CSS class for the "Confirm"-button.
Use this to change the background color of the "Confirm"-button (must be a HEX value).
Use this to change the text on the "Confirm"-button.
A custom CSS class for the modal.
Set to true if you want to focus the "Cancel"-button by default.
Set to false if you want to focus the first element in tab order instead of "Confirm"-button by default.
The footer of the modal, as HTML.
Modal window grow direction
By default, SweetAlert2 sets html's and body's CSS height to auto !important. If this behavior isn't compatible with your project's layout, set heightAuto to false.
A HTML description for the modal. If "text" and "html" parameters are provided in the same time, "text" will be used.
An alternative text for the custom image icon.
A custom CSS class for the customized icon.
If imageUrl is set, you can specify imageHeight to describes image height in px.
Add a customized icon for the modal. Should contain a string with the path or URL to the image.
If imageUrl is set, you can specify imageWidth to describes image width in px.
Input field type, can be text, email, password, number, tel, range, textarea, select, radio, checkbox, file and url.
HTML input attributes (e.g. min, max, step, accept...), that are added to the input field.
Automatically remove whitespaces from both ends of a result string. Set this parameter to false to disable auto-trimming.
A custom CSS class for the input field.
If input parameter is set to "select" or "radio", you can provide options. Object keys will represent options values, object values will represent options text values.
Input field placeholder.
Validator for input field, may be async (Promise-returning) or sync.
Input field initial value.
Useful for those who are using SweetAlert2 along with Bootstrap modals. By default keydownListenerCapture is false which means when a user hits Esc, both SweetAlert2 and Bootstrap modals will be closed. Set keydownListenerCapture to true to fix that behavior.
Modal window position
Set to true if you want to invert default buttons positions.
If set to true, a "Cancel"-button will be shown, which the user can click on to dismiss the modal.
Set to true to show close button in top right corner of the modal.
If set to false, a "Confirm"-button will not be shown. It can be useful when you're using custom HTML description.
If set to false, SweetAlert2 will allow keydown events propagation to the document.
The container element for adding modal into (query selector only).
A description for the modal. It can either be added to the object under the key "text" or passed as the second parameter of the function.
Auto close timer of the modal. Set in ms (milliseconds).
The title of the modal, as HTML. It can either be added to the object under the key "title" or passed as the first parameter of the function.
The title of the modal, as text. Useful to avoid HTML injection.
Whether or not an alert should be treated as a toast notification.
This option is normally coupled with the position
parameter and a timer.
Toasts are NEVER autofocused.
The type of the modal. 5 built-in types which will show a corresponding icon animation: 'warning', 'error', 'success', 'info' and 'question'.
Modal window width, including paddings (box-sizing: border-box). Can be in px or %.
If set to false, the user can't confirm the modal by pressing the Enter or Space keys, unless they manually focus the confirm button. You can also pass a custom function returning a boolean value.
true