diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index 247b897b8..ce52a9ce6 100644 --- a/reflex/components/sonner/toast.py +++ b/reflex/components/sonner/toast.py @@ -278,7 +278,15 @@ class Toaster(Component): toast = ternary_operation( toast_ref.bool(), toast, - FunctionVar("window.alert").call(message), + FunctionVar("window.alert").call( + Var.create( + message + if isinstance(message, str) and message + else props.get("title", props.get("description", "")) + ) + .to(str) + .replace("
", "\n") + ), ) return run_script(toast)