nightly {Rnightly}R Documentation

Implement a dark/light toggle mode by default

Description

Implement a default dark/light toggle mode that will be triggered by any shiny element. The user can also define other colors to work with.

Usage

nightly(
  trigElement,
  bodyColor = "#282828",
  txtColor = "#f5f5f5",
  inpTxtColor = "#f5f5f5",
  inpBgColor = "#313131"
)

Arguments

trigElement

the id of the shiny element that will trigger the toggle mode

bodyColor

the color of the application's body after clicking on the trigElement. Defaults to #282828 (dark)

txtColor

the color of the text within the application after clicking on the trigElement. Defaults to #f5f5f5 (white)

inpTxtColor

the color of the text within the shiny inputs after clicking on the trigElement. Defaults to #f5f5f5 (white)

inpBgColor

the color of the background of the shiny inputs after clicking on the trigElement. Defaults to #313131 (Very Dark Grey)

Value

A default dark/light toggle mode in shiny ui

Examples

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)


}




[Package Rnightly version 0.1.0 Index]