← Back to Components

Nav Group

Collapsible sidebar groups, section labels, and nested leaf items for block_nav().

Interactive Playground

R Code

API Reference

block_nav()

Wraps leaf nav items, collapsible groups, and section labels. With an id it becomes a Shiny input whose value comes only from clicked block_nav_item() leaves.

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredblock_nav_item(), block_nav_group(), and block_nav_label() children.
idcharacterNULLOptional Shiny input id. Nested leaf values must be unique and non-empty when set.
classcharacterNULLCSS class applied to the navigation wrapper.

block_nav_group()

Creates a collapsible parent row that toggles nested leaf items without reporting a Shiny input value.

ArgumentTypeDefaultDescription
labelcharacterrequiredGroup trigger label.
...block_nav_item()requiredNested leaf navigation items.
iconcharacter | shiny.tagNULLLeading icon shown in the trigger.
valuecharacterNULLOptional group identity stored as data-sb-nav-group-value; not reported as the nav input.
expandedlogicalTRUEInitial disclosure state.
classcharacterNULLAdditional classes for the group wrapper.

block_nav_label()

Creates a non-interactive section caption inside a nav.

ArgumentTypeDefaultDescription
textcharacterrequiredCaption text.
classcharacterNULLAdditional classes for the label element.