# NOT RUN {
## Only run examples in interactive R sessions
if (interactive()) {
library(shiny)
shinyApp(
ui = fluidPage(
dq_drawer(
id = "myDrawer",
Config = div(actionButton("hide", "Close drawer")),
Red = div(style = "background: red;width: 100%;height: 100%;"),
"Green Color!" = div("RED!!!!", style = "background: green;"),
direction = "left", size = 250
),
fluidRow(column(
3, offset = 5,
"Current page:", textOutput("drawerVal"),
actionButton("show", "Show Green")
))
),
server = function(input, output) {
output$drawerVal <- renderText(input$myDrawer)
observeEvent(input$show, update_dq_drawer("myDrawer", "Green Color!"))
observeEvent(input$hide, update_dq_drawer("myDrawer", NULL))
}
)
}
# }
Run the code above in your browser using DataLab