ToastConfig

ToastConfig

Configuration for a toast notification.

type ToastConfig = {
  /**
   * The duration, in seconds, to show the toast. 0 if it should
   * show until the user dismisses it. Defaults to 5 seconds.
   */
  duration?: number | undefined;
  /**
   * The message to show in the toast.
   */
  message: string;
  /**
   * Icon name from the configured Espalier SVG sprite.
   *
   * Prefer this for icons from the shared sprite; `<esp-toaster>`
   * resolves it through the nearest `<esp-root icon-sprite-url>`.
   */
  icon?: string | undefined;
  /**
   * Full SVG href to use as the icon, for example:
   * "/assets/icons.svg#info-i"
   *
   * This remains available for custom sprites or fully controlled
   * hrefs. When both `icon` and `svgPath` are provided, `svgPath`
   * takes precedence.
   */
  svgPath?: string | undefined;
  /**
   * The intent of the toast — `neutral`, `success`, `warning`, `danger`,
   * or `info` (the default treatment when omitted).
   */
  intent?: EspalierIntentVariant;
  /**
   * Callback fired when the toast is closed.
   */
  onClosed?: (() => void) | undefined;
}
Components API Guides Getting started Styling Espalier Browser support GitHub npm package Taproot I/O