Page with a Sidebar

Description

Create a page with a collapsible sidebar.

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
... Page content.
sidebar A bc_sidebar().
title String or tag. The page title.
header Tag or NULL. Extra content for the top of the page, such as bc_theme_switcher() or an avatar.
toggle Bool. Whether to show a button that opens and closes the sidebar. Defaults to TRUE.
toggle_label String. Accessible name for the toggle. Defaults to "Toggle sidebar".
id String. The ID of the bc_sidebar() to toggle.
label String. Accessible name for the button.

Value

An htmltools::tagList().

See Also

bc_page_navbar()

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")