← Back to Components

Dropdown Menu

Portal-rendered action menu with items, labels, separators, and event-style value reporting.

Interactive Playground

R Code

API Reference

block_dropdown_menu()

Portal-rendered action menu built from item/label/separator parts; choosing an item reports its value to input$id as an event.

ArgumentTypeDefaultDescription
triggercharacter | shiny.tagrequiredTrigger label string or an arbitrary tag (icon button, avatar).
...menu partsrequireddropdown_menu_item(), dropdown_menu_label(), dropdown_menu_separator().
idcharacterNULLOptional input id; input$id reports the chosen item value as an event.
labelcharacterNULLAccessible name for the trigger; recommended for icon-only triggers.
side'bottom' | 'top' | 'left' | 'right''bottom'Side of the trigger to anchor on.
align'start' | 'center' | 'end''start'Alignment along the anchored side.
trigger_variantcharacter'outline'Button variant for a string trigger.
disabledlogicalFALSEWhether the trigger is disabled.
stylecharacter | listNULLInline styles on the menu content container.
classcharacterNULLAdditional classes on the menu content container.

dropdown_menu_item()

A selectable action row. Choosing it reports its value to the parent menu's input$id.

ArgumentTypeDefaultDescription
valuecharacterrequiredValue reported to the parent menu's input$id.
labelcharactervalueItem label.
iconcharacter | shiny.tagNULLOptional leading icon.
shortcutcharacterNULLRight-aligned keyboard-shortcut hint (display only).
disabledlogicalFALSEWhether the item is non-interactive.
variant'default' | 'destructive''default'Item visual variant.

update_block_dropdown_menu()

Server-driven update: replace items, open/close, reposition, disable, or restyle the menu.

ArgumentTypeDefaultDescription
sessionShinySessionrequiredActive R/Shiny session.
input_idcharacterrequiredDropdown-menu input id.
itemsmenu parts-Replacement menu parts.
openlogical-Programmatically open/close the menu.