Function leptos_use::use_web_notification
source · pub fn use_web_notification() -> UseWebNotificationReturn<impl Fn(ShowOptions) + Clone, impl Fn() + Clone>
Expand description
Reactive Notification API.
The Web Notification interface of the Notifications API is used to configure and display desktop notifications to the user.
§Demo
§Usage
let UseWebNotificationReturn {
show,
close,
..
} = use_web_notification_with_options(
UseWebNotificationOptions::default()
.direction(NotificationDirection::Auto)
.language("en")
.renotify(true)
.tag("test"),
);
show(ShowOptions::default().title("Hello World from leptos-use"));
§Server-Side Rendering
This function is basically ignored on the server. You can safely call show
but it will do nothing.