Page with a sidebar
Description
A collapsible bc_sidebar() beside a <main> region, with a header carrying the sidebar toggle and a title.
Usage
bc_page_sidebar(
...,
sidebar,
title = NULL,
header = NULL,
toggle = TRUE,
toggle_label = "Toggle sidebar"
)
bc_sidebar_toggle(id, label = "Toggle sidebar")
Arguments
| Argument | Description |
|---|---|
... |
Tag attributes and children for the <main> content region. |
sidebar |
A bc_sidebar() tag. |
title |
String or tag. Shown in the header beside the toggle. |
header |
Tag or NULL. Extra header content, aligned to the end, such as bc_theme_switcher() or an avatar. |
toggle |
Bool. Whether the header carries the sidebar toggle. |
toggle_label |
String. Accessible name for the toggle. |
id |
String. The id of the bc_sidebar() to toggle. |
label |
String. Accessible name for the button. |
Value
A htmltools::tagList() of the <aside> and the <main>.
See Also
Examples
bc_page_sidebar(
class = "prose",
htmltools::h2("Overview"),
htmltools::p("Everything is fine."),
sidebar = bc_sidebar(
id = "reports-sidebar",
bc_sidebar_group(
"Reports",
bc_sidebar_item("Daily", href = "#", aria_current = TRUE),
bc_sidebar_item("Weekly", href = "#")
)
),
title = "Dashboard",
header = bc_theme_switcher()
)
Dashboard
Overview
Everything is fine.
bc_sidebar_toggle("sidebar")