The component id of the current view instance.
The configuration of the component to render.
The rendered HTML of the view.
The configuration of the view to render.
The viewFields of the view.
Changes the type, message, title and timeout of a specific toast.
// Creates a info toast and changes it to a success toast which will be cleared after 5 seconds.
const toastId = CSL.toast.info('Processing!');
/// Do some async code.
CSL.toast.change(toastId, 'success', 'Done processing!', null, 5000);
The toast to change.
Specify the toast type: error, info, success or warning.
Optional
message: stringThe message to display.
Optional
title: stringThe title to display above the message. The title is marked in bold.
The toast id which can be used to change the toast.
Clears a specific toast when passing the toastId as an argument. Clears all toasts when no argument is passed.
// Clear all toasts.
CSL.toast.clear();
// Clears a specific toast.
const toastId = CSL.toast.success('Done processing!');
CSL.toast.clear(toastId);
Optional
toastId: numberThe toast id to clear. If null, all toast are cleared
Creates a new error toast which has the default red color.
// Simple error toast with message and ERROR title.
CSL.toast.error('Something went wrong!', 'ERROR');
// Error toast cleared after 5 seconds.
CSL.toast.error('Something went wrong!', 'ERROR', 5000);
The toast id which can be used to change the toast.
Optional
message: stringThe message to display.
Optional
title: stringThe title to display above the message. The title is marked in bold.
The time in milliseconds after the toast is cleared. Default 0 which means it is not cleared unless the user clicks on the toast.
Creates a new info toast which has the default blue color.
// Info toast cleared after 5 seconds.
CSL.toast.info('Please hold on ...', null, 5000);
The toast id which can be used to change the toast.
Optional
message: stringThe message to display.
Optional
title: stringThe title to display above the message. The title is marked in bold.
The time in milliseconds after the toast is cleared. Default 0 which means it is not cleared unless the user clicks on the toast.
Creates a new toast info which has the default green color.
// Success toast cleared after 2 seconds.
CSL.toast.success('Done processing!', null, 2000);
The toast id which can be used to change the toast.
Optional
message: stringThe message to display.
Optional
title: stringThe title to display above the message. The title is marked in bold.
The time in milliseconds after the toast is cleared. Default 0 which means it is not cleared unless the user clicks on the toast.
Creates a new toast info message.
// Warning toast displaying a message only.
CSL.toast.warning('Wow, this is not good.');
The toast id which can be used to change the toast.
Optional
message: stringThe message to display.
Optional
title: stringThe title to display above the message. The title is marked in bold.
The time in milliseconds after the toast is cleared. Default 0 which means it is not cleared unless the user clicks on the toast.
Generated using TypeDoc
This class supports the functionality for custom scripting on the toasts. You can access all the methods by using the namespace
CSL.toast
.