sidebar {bslib} | R Documentation |
Create a collapsing sidebar layout by providing a sidebar()
object to the sidebar
argument of:
Creates a "page-level" sidebar.
Creates a multi-page app with a "page-level" sidebar.
Creates a multi page/tab UI with a singular sidebar()
(which is
shown on every page/tab).
layout_sidebar()
navset_card_tab()
and navset_card_pill()
Creates a multi-tab card with a sidebar inside of it.
See this article to learn more.
sidebar(
...,
width = 250,
position = c("left", "right"),
open = c("desktop", "open", "closed", "always"),
id = NULL,
title = NULL,
bg = NULL,
fg = NULL,
class = NULL,
max_height_mobile = NULL,
gap = NULL,
padding = NULL
)
layout_sidebar(
...,
sidebar = NULL,
fillable = TRUE,
fill = TRUE,
bg = NULL,
fg = NULL,
border = NULL,
border_radius = NULL,
border_color = NULL,
padding = NULL,
gap = NULL,
height = NULL
)
toggle_sidebar(id, open = NULL, session = get_current_session())
sidebar_toggle(id, open = NULL, session = get_current_session())
... |
Unnamed arguments can be any valid child of an htmltools tag and named arguments become HTML attributes on
returned UI element. In the case of |
width |
A valid CSS unit used for the width of the sidebar. |
position |
Where the sidebar should appear relative to the main content. |
open |
The initial state of the sidebar, choosing from the following options:
In |
id |
A character string. Required if wanting to re-actively read (or
update) the |
title |
A character title to be used as the sidebar title, which will be
wrapped in a |
bg , fg |
A background or foreground color. If only one of either is
provided, an accessible contrasting color is provided for the opposite
color, e.g. setting |
class |
CSS classes for the sidebar container element, in addition to
the fixed |
max_height_mobile |
The maximum height of the horizontal sidebar when
viewed on mobile devices. The default is |
gap |
A CSS length unit defining the
vertical |
padding |
Padding within the sidebar itself. This can be a numeric
vector (which will be interpreted as pixels) or a character vector with
valid CSS lengths. |
sidebar |
A |
fillable |
Whether or not the |
fill |
Whether or not to allow the layout container to grow/shrink to fit a
fillable container with an opinionated height (e.g., |
border |
Whether or not to add a border. |
border_radius |
Whether or not to add a border radius. |
border_color |
The border color that is applied to the entire layout (if
|
height |
Any valid CSS unit (e.g.,
|
session |
A Shiny session object (the default should almost always be used). |
toggle_sidebar()
: Toggle a sidebar()
state during an active Shiny user
session.
sidebar_toggle()
: An alias for toggle_sidebar()
.