def send_toast(
        message: str | Var = "",
        level: str | None = None,
        fallback_to_alert: bool = False,
        **props,
    ) -> EventSpec:
        """Send a toast message.

        Args:
            message: The message to display.
            level: The level of the toast.
            fallback_to_alert: Whether to fallback to an alert if the toaster is not created.
            **props: The options for the toast.

        Raises:
            ValueError: If the Toaster component is not created.

        Returns:
            The toast event.
        """
        toast_command = (
            ObjectVar.__getattr__(toast_ref.to(dict), level) if level else toast_ref
        ).to(FunctionVar)

        if isinstance(message, Var):
            props.setdefault("title", message)
            message = ""
        elif message == "" and "title" not in props and "description" not in props:
            msg = "Toast message or title or description must be provided."
            raise ValueError(msg)

        if props:
            args = LiteralVar.create(ToastProps(component_name="rx.toast", **props))  # pyright: ignore [reportCallIssue]
            toast = toast_command.call(message, args)
        else:
            toast = toast_command.call(message)

        if fallback_to_alert:
            toast = ternary_operation(
                toast_ref.bool(),
                toast,
                FunctionVar("window.alert").call(
                    Var.create(
                        message
                        if isinstance(message, str) and message
                        else props.get("title", props.get("description", ""))
                    )
                    .to(str)
                    .replace("<br/>", "\n")
                ),
            )

        return run_script(toast)
Send a toast message.

        Args:
            message: The message to display.
            level: The level of the toast.
            fallback_to_alert: Whether to fallback to an alert if the toaster is not created.
            **props: The options for the toast.

        Raises:
            ValueError: If the Toaster component is not created.

        Returns:
            The toast event.
        
reflex/components/sonner/toast.py