countUp | R Documentation |
Set shinyTimer in motion: count up
countUp(inputId, session = shiny::getDefaultReactiveDomain())
inputId |
The input ID corresponding to the UI element. |
session |
The session object from the shiny server function. |
No return value, called for side effects.
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
shinyTimer("timer", label = "Count Up Timer", seconds = 0, type = "mm:ss.cs"),
actionButton("start", "Start Counting Up")
),
server = function(input, output, session) {
observeEvent(input$start, {
countUp("timer")
})
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.