Drawer
Description
Create a modal panel that slides in from the edge of the screen.
Usage
bc_drawer(
...,
id = NULL,
side = "bottom",
trigger = "Open Drawer",
title = NULL,
description = NULL,
actions = NULL,
class = NULL
)
Arguments
| Argument | Description |
|---|---|
... |
Drawer content. |
id |
String. The drawer's ID. Defaults to a random ID. With bc_shiny_deps(), input$id is TRUE while the drawer is open when bc_drawer() is given an id. |
side |
String. The edge the drawer slides from. One of "bottom" (default), "top", "right", or "left". |
trigger |
String. Label for a button that opens the drawer, or NULL for no button. Defaults to "Open Drawer". |
title |
String. A title shown above the content. |
description |
String. Text under the title, shown only with a title. |
actions |
Tag or tag list. Buttons pinned below the content. |
class |
String. Extra CSS classes. |
Value
A tag list of the button and the drawer. With trigger = NULL, an htmltools tag.
Examples
bc_drawer(
bc_switch(
"cookies-essential",
"Essential",
checked = TRUE,
disabled = TRUE,
description = "Needed for the site to work. Always on."
),
bc_switch(
"cookies-analytics",
"Analytics",
description = "Counts visits so we know which pages earn their keep."
),
bc_switch(
"cookies-marketing",
"Marketing",
description = "Lets advertisers follow you between sites."
),
title = "Cookies",
description = "Choose what this site may store on your device.",
trigger = "Cookie settings",
actions = htmltools::tagList(
bc_dialog_close("Reject non-essential", variant = "outline"),
bc_dialog_close("Accept all")
)
)