# NOT RUN {
if (interactive()) {
ui <- fluidPage(
use_nightly(),
h1("Click on the Plot to Toggle a Dark/Light Mode in you Shiny Application"),
plotOutput(outputId = "plt1"),
nightly(trigElement = "plt1")
)
server <- function(input, output) {
output$plt1 <- renderPlot({
plot(mtcars)
})
}
shinyApp(ui = ui, server = server)
}
# }
Run the code above in your browser using DataLab