Description Usage Arguments Examples
Show a tabler toast on the client
1 | show_tabler_toast(id, options = NULL, session = getDefaultReactiveDomain())
|
id |
Toast id. |
options |
Toast options: see https://getbootstrap.com/docs/4.3/components/toasts/. |
session |
Shiny session |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | if (interactive()) {
library(shiny)
ui <- tabler_page(
tabler_toast(
id = "toast",
title = "Hello",
subtitle = "now",
"Toast body",
img = "https://preview-dev.tabler.io/static/logo.svg"
),
tabler_button("launch", "Go!", width = "25%")
)
server <- function(input, output, session) {
observe(print(input$toast))
observeEvent(input$launch, {
removeNotification("notif")
show_tabler_toast(
"toast",
options = list(
animation = FALSE,
delay = 3000
)
)
})
observeEvent(input$toast, {
showNotification(
id = "notif",
"Toast was closed",
type = "warning",
duration = 1,
)
})
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.