use std::time::Duration; use leptos::prelude::*; use leptos_animate::animate; use leptos_animate::animations::classes::{In, Out}; #[component] pub fn Toast( #[prop(into)] on_close: Callback<()>, #[prop(into)] message: Signal, #[prop(into)] title: Signal ) -> impl IntoView { set_timeout( move || { on_close.run(()) }, Duration::from_secs(3) ); view! {

{title}

{message}

} }