← Back to Components
Accordion
Collapsible content sections with single or multiple open modes and animated panel height.
Interactive Playground
R Code
API Reference
block_accordion()
Vertically stacked collapsible sections built from block_accordion_item(); reports open value(s) to input$id when id is set.
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | block_accordion_item() | required | One or more block_accordion_item() sections. |
| id | character | NULL | Optional input id; input$id reports the open value(s). |
| type | 'single' | 'multiple' | 'single' | One open at a time, or any number open independently. Create-only. |
| collapsible | logical | FALSE | Single mode: whether the open item can collapse to none. Create-only. |
| open | character | NULL | Item value(s) open initially. Must match item values. |
| style | character | NULL | Inline styles on the accordion wrapper. |
| class | character | NULL | Additional classes on the accordion wrapper. |
block_accordion_item()
A single collapsible section: a trigger title that expands or collapses arbitrary body content.
| Argument | Type | Default | Description |
|---|---|---|---|
| value | character | required | Unique item id; reported to input$id and targeted by updates. |
| title | character | shiny.tag | required | Trigger label. |
| ... | shiny.tag | tagList | required | Panel body content. |
| icon | character | shiny.tag | NULL | Optional leading icon before the title. |
| disabled | logical | FALSE | Whether the item cannot be toggled. |
| class | character | NULL | Additional classes on the item wrapper. |
update_block_accordion()
Server-driven update: open or close items by value.
| Argument | Type | Default | Description |
|---|---|---|---|
| session | ShinySession | required | Active R/Shiny session. |
| input_id | character | required | Accordion input id. |
| open | character | - | Item value(s) that should be open after the update; NULL/character(0) closes all. |
| notify | logical | TRUE | Whether Shiny receives an input event after the update. |