Global options

You can configure options globally by assigning an object to the variable "window.UseBootstrapToasterOptions". For example:

window.UseBootstrapToasterOptions = {
  delay: 2000,
  placement: 'top-left',
}

Options

Alternatively, you can customize the options for a specific instance by passing an object directly to the toast function.

toast component prioritizes object options followed by global options and lastly default options

NameTypeDefaultDescription
animationbooleantrueApply a CSS fade transition to the toast.
autohidebooleantrueAutomatically hide the toast after the delay.
delaynumber4000Delay in milliseconds before hiding the toast.
gapnumber16Gap between toasts (px).
marginstring'1rem'Margin of the corner. Can also be filled with a CSS variable. Example: var(--toast-margin).
placementstring'top-right'Corner position of the toast. Available values: top-right, top-left, bottom-right, bottom-left.
classesstring''Additional classes to apply to the toast element.
headerstring''Additional information for the toast header section. It can be an object with properties such as icon, title, ago (time), and close button (closeBtn), or a string for the header title.
bodystring''The content of the toast message to be displayed to the user.