← Back to Components

Layout

Page, sidebar, header, and body primitives that form the application frame.

Interactive Playground

R Code

API Reference

block_page()

Creates the main high-level responsive page layout container framing the application.

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredUI content elements placed inside the body.
titlecharacterNULLOptional browser page window title.
sidebarshiny.tagNULLLayout sidebar element created by block_sidebar().
headershiny.tagNULLLayout header element created by block_header().
themeshiny.tagNULLOptional theme tags created by block_theme().

block_sidebar()

Builds a sleek side navigation panel containing brand titles and interactive link hierarchies.

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredNavigation links or sidebar content elements.
titlecharacterNULLSidebar branding or header title text.
idcharacterNULLOptional unique ID for sidebar state.
collapsiblelogicalFALSEWhether the sidebar can be collapsed.
classcharacterNULLAdditional custom styling classes.

block_header()

Renders the standard horizontal top header hosting actions and titles.

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredHeader elements (e.g. title, search bar, dark mode toggles).
classcharacterNULLCustom wrapper stylesheet class.

block_body()

Houses main dashboard contents inside a token-aligned wrapper.

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredMain dashboard grid/content components.
classcharacterNULLCSS class applied to the body container.

block_nav()

Wraps navigation items in a list. With an id it becomes a Shiny input: the selected item's value is reported as input[[id]], so a sidebar can drive page navigation like a tabset (pair with conditionalPanel()/renderUI() and update_block_nav()).

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredList of block_nav_item() elements.
idcharacterNULLOptional Shiny input id. When set, the selected item's value is reported as input[[id]]; every item must then carry a non-empty value.
classcharacterNULLCSS class applied to the navigation wrapper.

block_nav_item()

A navigation link element featuring custom glyphs and reactive selection highlight styling. Inside an input block_nav(id=), clicking it reports its value as input[[id]] and selects the item instead of following href.

ArgumentTypeDefaultDescription
labelcharacterrequiredLabel text shown for the item.
valuecharacterNULLValue reported as the input when the parent block_nav() has an id. Defaults to label when it is a single string; required for tag labels.
hrefcharacter'#'Destination URL. Ignored when the parent block_nav() is an input.
iconcharacterNULLLucide icon glyph name.
selectedlogicalFALSEInitial selected state class highlight.
classcharacterNULLAdditional classes for the .sb-nav-item element.