Skip to content

Migrating from v1 to v2

Version v2 introduces several breaking changes:

Component properties & custom properties naming

Although the behavior remains unchanged, some component properties have been renamed due to syntax reasons:

Previous nameCurrent name
childrenClassNameclassName
customCancelbuttonNoText
customConfirmbuttonYesText
messagetoastText

Also, there are some custom properties that have been renamed:

Previous nameCurrent name
--confirm-toast-msg-color--confirm-toast-text-color
--confirm-toast-icon-color--confirm-toast-btn-close-color

New required attributes

In this version, the component doesn’t control its own state. This decision has been made to increase the flexibility of the component and to enable its programmatic use.

For this, now there are two new props:

  • showConfirmToast (boolean): the boolean state.
  • setShowConfirmToast (React.Dispatch<React.SetStateAction<boolean>>): the state setter.

Custom properties

  • --confirm-toast-btn-hover has been changed.

    Before, the custom property was engaged to the brightness filter function.

    .button:hover {
    filter: brightness(var(--confirm-toast-btn-hover));
    }

    Now, this custom property sets the filter CSS rule.

    .button:hover {
    filter: var(--confirm-toast-btn-hover);
    }