inst/examples/progressClassName/server.R

library(shiny)
library(shinyToastify)

shinyServer(
  function(input, output, session){

    toastPositions <- c(
      "top-left", "top-right", "top-center",
      "bottom-left", "bottom-right", "bottom-center"
    )

    observeEvent(input[["btn"]], {

      toastPosition <- toastPositions[1L + (input[["btn"]] %% 6L)]

      showToast(
        session,
        input,
        text = HTML("Here is the <em>", toastPosition, "</em> position"),
        type = "dark",
        transition = "zoom",
        position = toastPosition,
        autoClose = 5000,
        progressClassName = "prgbar"
      )

    })

  }
)

Try the shinyToastify package in your browser

Any scripts or data that you put into this service are public.

shinyToastify documentation built on July 31, 2021, 5:06 p.m.