shinyTimer | R Documentation |
shinyTimer widget
shinyTimer(
inputId,
label = NULL,
hours = 0,
minutes = 0,
seconds = 0,
type = "simple",
background = "none",
...
)
inputId |
The input id. |
label |
The label to display above the countdown. |
hours |
An integer, the starting time in hours for the countdown. |
minutes |
An integer, the starting time in minutes for the countdown. |
seconds |
An integer, the starting time in seconds for the countdown. |
type |
The type of the countdown timer display ("simple", "mm:ss", "hh:mm:ss", "mm:ss.cs"). |
background |
The shape of the timer's container ("none", "circle", "rectangle"). |
... |
Any additional parameters you want to pass to the placeholder for the timer ( |
A shiny UI component for the countdown timer.
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
shinyTimer("timer", label = "Countdown Timer", seconds = 10)
),
server = function(input, output, session) {
observeEvent(input$start, {
countDown("timer", session)
})
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.