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.
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | shiny.tag | tagList | required | UI content elements placed inside the body. |
| title | character | NULL | Optional browser page window title. |
| sidebar | shiny.tag | NULL | Layout sidebar element created by block_sidebar(). |
| header | shiny.tag | NULL | Layout header element created by block_header(). |
| theme | shiny.tag | NULL | Optional theme tags created by block_theme(). |
block_sidebar()
Builds a sleek side navigation panel containing brand titles and interactive link hierarchies.
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | shiny.tag | tagList | required | Navigation links or sidebar content elements. |
| title | character | NULL | Sidebar branding or header title text. |
| id | character | NULL | Optional unique ID for sidebar state. |
| collapsible | logical | FALSE | Whether the sidebar can be collapsed. |
| class | character | NULL | Additional custom styling classes. |
block_header()
Renders the standard horizontal top header hosting actions and titles.
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | shiny.tag | tagList | required | Header elements (e.g. title, search bar, dark mode toggles). |
| class | character | NULL | Custom wrapper stylesheet class. |
block_body()
Houses main dashboard contents inside a token-aligned wrapper.
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | shiny.tag | tagList | required | Main dashboard grid/content components. |
| class | character | NULL | CSS 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()).
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | shiny.tag | tagList | required | List of block_nav_item() elements. |
| id | character | NULL | Optional Shiny input id. When set, the selected item's value is reported as input[[id]]; every item must then carry a non-empty value. |
| class | character | NULL | CSS 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.
| Argument | Type | Default | Description |
|---|---|---|---|
| label | character | required | Label text shown for the item. |
| value | character | NULL | Value 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. |
| href | character | '#' | Destination URL. Ignored when the parent block_nav() is an input. |
| icon | character | NULL | Lucide icon glyph name. |
| selected | logical | FALSE | Initial selected state class highlight. |
| class | character | NULL | Additional classes for the .sb-nav-item element. |