countDown: Set shinyTimer in motion: count down

View source: R/timer.R

countDownR Documentation

Set shinyTimer in motion: count down

Description

Set shinyTimer in motion: count down

Usage

countDown(inputId, session = shiny::getDefaultReactiveDomain())

Arguments

inputId

The input ID corresponding to the UI element.

session

The session object from the shiny server function.

Value

No return value, called for side effects.

Examples

if (interactive()) {
  library(shiny)
  shinyApp(
    ui = fluidPage(
      shinyTimer("timer", label = "Countdown Timer", seconds = 20, type = "mm:ss"),
      actionButton("start", "Start Countdown")
    ),
    server = function(input, output, session) {
      observeEvent(input$start, {
        countDown("timer")
      })
    }
  )
}

shinyTimer documentation built on April 4, 2025, 3:30 a.m.