Examples for 'shinyjs::useShinyjs'


Set up a Shiny app to use shinyjs

Aliases: useShinyjs

Keywords:

### ** Examples

if (interactive()) {
  library(shiny)

  shinyApp(
    ui = fluidPage(
      useShinyjs(),  # Set up shinyjs
      actionButton("btn", "Click me"),
      textInput("element", "Watch what happens to me")
    ),
    server = function(input, output) {
      observeEvent(input$btn, {
        # Run a simply shinyjs function
        toggle("element")
      })
    }
  )
}
Attaching package: 'shiny'
The following object is masked from 'package:shinyjs':

    runExample
Error in loadNamespace(name): there is no package called 'webshot'

[Package shinyjs version 2.1.0 Index]