Description Usage Arguments Details Value Examples
Create a drawer widget, a panel that slides out from the edge of the screen.
1 2 3 4 5 6 7 8 9 10 | chakraDrawer(
inputId,
openButton,
options = chakraDrawerOptions(),
isOpen = FALSE,
closeButton = TRUE,
header,
body,
footer
)
|
inputId |
widget id |
openButton |
a Chakra button to open the drawer |
options |
list of options created with |
isOpen |
Boolean, whether the drawer is initially open |
closeButton |
Boolean, whether to include a closing button |
header |
a |
body |
a |
footer |
a |
Similarly to chakraAlertDialog
, you can set an
action attribute and a value attribute to the Chakra buttons you include
in the Chakra drawer.
A widget to use in chakraComponent
.
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | library(shiny)
library(shinyChakraUI)
ui <- chakraPage(
br(),
chakraComponent(
"mycomponent",
chakraDrawer(
"drawer",
openButton = Tag$Button("Open Drawer"),
options = chakraDrawerOptions(placement = "right"),
header = Tag$DrawerHeader("I'm the header"),
body = Tag$DrawerBody(
Tag$Box("I'm the body")
),
footer = Tag$DrawerFooter(
Tag$ButtonGroup(
spacing = "6",
Tag$Button(
value = "try me",
"Try me"
),
Tag$Button(
action = "close",
variant = "outline",
"Close"
)
)
)
)
)
)
server <- function(input, output, session){
observe({
print(input[["drawer"]])
})
}
if(interactive()){
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.