remove
Function for deleting toast notifications programmatically.
Title | Description | Type | Default |
---|---|---|---|
toastId | The unique identifier of the toast to be removed. | string | undefined |
withAnimation | Whether to remove the toast with an animation effect. | boolean | true |
callback | Function to be called after the toast(s) is(are) removed. | () => void | undefined |
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();