Skip to contents

A full-height page built on shad_sidebar_layout(): a collapsible sidebar, a bar carrying the sidebar trigger and page title, and a scrolling main region. input$<inputId> reports the sidebar state (including active, the clicked shad_sidebar_item()); toggle it from the server with shad_sidebar_toggle().

Usage

shad_page_sidebar(
  sidebar,
  ...,
  inputId = "sidebar",
  title = NULL,
  header = NULL,
  header_end = NULL,
  container = TRUE,
  page_title = title,
  theme_preset = NULL,
  dark = NULL,
  theme = NULL,
  lang = "en"
)

Arguments

sidebar

A shad_sidebar().

...

Main content, or named HTML attributes for the scope container.

inputId

Input id for the sidebar layout.

title

Optional page title shown in the bar.

header

Optional content appended to the bar (after the title).

header_end

Optional content pinned to the end of the bar (e.g. a dark mode switch).

container

If TRUE (default), wrap the main content in a shad_container(). Pass a list of arguments to configure it, or FALSE to place content flush.

page_title, theme_preset, dark, theme, lang

Passed to page_shad().

Value

A page UI object.

Examples

if (interactive()) {
  shiny::shinyApp(
    shad_page_sidebar(
      sidebar = shad_sidebar(shad_sidebar_group("Menu",
        shad_sidebar_item("home", "Home", icon = "home"))),
      title = "Acme", shad_p("Main content")
    ),
    function(input, output, session) {}
  )
}