if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
shinyTimer("timer", label = "Countdown Timer", seconds = 10, type = "mm:ss"),
actionButton("update", "Update Timer")
),
server = function(input, output, session) {
observeEvent(input$update, {
updateShinyTimer("timer", seconds = 20, type = "hh:mm:ss")
})
}
)
}
Run the code above in your browser using DataLab