Skip to main content

remove

Function for deleting toast notifications programmatically.

TitleDescriptionTypeDefault
toastIdThe unique identifier of the toast to be removed.stringundefined
withAnimationWhether to remove the toast with an animation effect.booleantrue
callbackFunction to be called after the toast(s) is(are) removed.() => voidundefined

Example

Simply pass the unique identifier of the toast you received during creation to remove one.

const id = add();
remove(id);

Leave it blank to remove all at once.

add();
add();
remove();