sweetalert2

✨ A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies. 🇺🇦

MIT License

Downloads
2.6M
Stars
16.8K
Committers
122

Bot releases are hidden (Show)

sweetalert2 - v10.3.3

Published by limonte about 4 years ago

10.3.3 (2020-09-23)

Bug Fixes

  • add timeout before calling setScrollingVisibility() (#2066) (c8c28f7)
sweetalert2 - v10.3.2

Published by limonte about 4 years ago

10.3.2 (2020-09-22)

Bug Fixes

  • add 10ms timeout before adding showClass (#2063) (fdc89b7)
sweetalert2 - v10.3.1

Published by limonte about 4 years ago

10.3.1 (2020-09-21)

Bug Fixes

  • add the opacity workaround and timeout for animating popup (#2060) (4362d2b)
sweetalert2 - v10.3.0

Published by limonte about 4 years ago

10.3.0 (2020-09-20)

Features

  • consistent hook names: willOpen, didOpen, didRender, willClose, didClose, didDestroy (#2057) (6434fb5)
sweetalert2 - v10.2.0

Published by limonte about 4 years ago

10.2.0 (2020-09-18)

Features

  • make background and iconColor params updatable (#2054) (ed384ab)
sweetalert2 - v10.1.0

Published by limonte about 4 years ago

10.1.0 (2020-09-17)

Features

sweetalert2 - v10.0.0

Published by limonte about 4 years ago

🔴 Breaking change

For the sake of customization, the loader has been separated from the confirm button into its own DOM element (<div class="swal2-loader"></div>).

As a part of that breaking change, there's a new API param loaderHtml which allows to set custom HTML, e.g. SVG icon inside of the loader.

🎉 NEW FEATURES

🎉 The third DENY button

image

Swal.fire({
  title: 'Do you want to save the changes?',
  showDenyButton: true,
  showCancelButton: true,
  confirmButtonText: `Save`,
  denyButtonText: `Don't save`,
}).then(function (result) {
  console.log(result)
  // Object {
  //   value: false,
  //   isConfirmed: false,
  //   isDenied: true,
  //   isDismissed: false
  // }
})
Swal.clickDeny()

These API params for the DENY button were added:

  • showDenyButton?: boolean; (default false)
  • denyButtonText?: string; (default 'No')
  • denyButtonColor?: string; (default undefined)
  • denyButtonAriaLabel?: string; (default '')
  • focusDeny?: boolean; (default false)
  • customClass.denyButton?: string (default undefined)

These API methods for the DENY button were added:

  • Swal.getDenyButton()
  • Swal.clickDeny()

🎉 New SCSS variables

// ACTIONS
$swal2-actions-padding: 0 1.6em !default;

// DENY BUTTON
$swal2-deny-button-order: null !default;
$swal2-deny-button-border: 0 !default;
$swal2-deny-button-border-radius: .25em !default;
$swal2-deny-button-background-color: #dd6b55 !default;
$swal2-deny-button-color: $swal2-white !default;
$swal2-deny-button-font-size: 1.0625em !default;

// LOADER
$swal2-loader-align-items: center !default;
$swal2-loader-justify-content: center !default;
$swal2-loader-width: 2.2em !default;
$swal2-loader-height: 2.2em !default;
$swal2-loader-margin: 0 1.875em !default;
$swal2-loader-animation: swal2-rotate-loading 1.5s linear 0s infinite normal !default;
$swal2-loader-border-width: .25em !default;
$swal2-loader-border-style: solid !default;
$swal2-loader-border-radius: 100% !default;
$swal2-loader-border-color: #3085d6 transparent #3085d6 transparent !default;

// CONFIRM BUTTON
$swal2-confirm-button-order: null !default;

// CANCEL BUTTON
$swal2-cancel-button-order: null !default;
sweetalert2 - v9.17.2

Published by limonte about 4 years ago

9.17.2 (2020-09-03)

Bug Fixes

  • types: add missing params to SweetAlertUpdatableParameters (#2042) (7142fad)
sweetalert2 - v9.17.1

Published by limonte about 4 years ago

9.17.1 (2020-07-26)

Bug Fixes

sweetalert2 - v9.17.0

Published by limonte over 4 years ago

9.17.0 (2020-07-14)

Features

sweetalert2 - v9.16.0

Published by limonte over 4 years ago

9.16.0 (2020-07-14)

Features

  • styles: add $swal2-header-padding variable (#2001) (11338e6)
sweetalert2 - v9.15.3

Published by limonte over 4 years ago

9.15.3 (2020-07-09)

Bug Fixes

sweetalert2 - v9.15.2

Published by limonte over 4 years ago

9.15.2 (2020-06-23)

Bug Fixes

  • do not fix scrollbar padding in case body has overflow-y: hidden (#2006) (bc90d3c)
sweetalert2 - v9.15.1

Published by limonte over 4 years ago

9.15.1 (2020-06-14)

Bug Fixes

  • do not use Array.find because it's not supported in IE11 (20526ab)
sweetalert2 - v9.15.0

Published by limonte over 4 years ago

9.15.0 (2020-06-13)

Features

  • add support for objects containing toPromise method (#1998) (0d33441)
sweetalert2 - v9.14.4

Published by limonte over 4 years ago

9.14.4 (2020-06-09)

Bug Fixes

sweetalert2 - v9.14.3

Published by limonte over 4 years ago

9.14.3 (2020-06-08)

Bug Fixes

  • types: remove the readonly modifier from 'SweetAlertOptions' (#1996) (12fbea0)
sweetalert2 - v9.14.2

Published by limonte over 4 years ago

9.14.2 (2020-06-06)

Bug Fixes

  • add bottom padding to container for iOS Safari (#1993) (1378a78)
sweetalert2 - v9.14.1

Published by limonte over 4 years ago

9.14.1 (2020-06-06)

Bug Fixes

sweetalert2 - v9.14.0

Published by limonte over 4 years ago

9.14.0 (2020-05-30)

Features