Description Usage Arguments Value Author(s) Examples
Creates a drawer element with buttons to draw out different content elements.
1 2 3 4 5 6 7 8 9 10 |
id |
optional element id, useful if current state is needed |
... |
content elements, must be named since those will be used as button labels, can also be a named list |
drawer_style, btn_style |
optional character specifying additional styles |
size |
optional size of the drawer (width or height depending on
direction), can be any valid CSS unit (see
|
direction |
optional, specifies the direction the drawer comes from, one of c("left", "right", "top", "bottom) |
open |
name of the content element to show, NULL to close drawer |
drawer element tag
richard.kunze
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## 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))
}
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.