Description Usage Arguments Note Examples
Initialize with use_push
in UI before using push
server-side.
Close all notifications with push_close
.
1 2 3 4 5 6 |
title |
Title of the notification. |
text |
Optional text for the notification. |
timeout |
Time in milliseconds until the notification closes automatically. |
session |
Shiny session. |
push.js sends desktop notifications, user need to allow permission to show notification.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | library(shiny)
library(shinypop)
ui <- fluidPage(
tags$h2("Push notification"),
use_push(),
actionButton("show", "Show notification"),
textInput("title", "Text to display", "Hello world :)")
)
server <- function(input, output, session) {
observeEvent(input$show, {
push(title = input$title)
})
}
if (interactive())
shinyApp(ui, server)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.