ui.accordion_panel
ui.accordion_panel(title, *args, value=MISSING, icon=None, **kwargs)Single accordion panel.
Parameters
- title : TagChild
- 
A title to appear in the panel’s header. 
- *args : TagChild | TagAttrs = ()
- 
UI elements for the panel’s body. Can also be a dict of tag attributes for the body’s HTML container. 
- value : Optional[str] | MISSING_TYPE = MISSING
- 
A character string that uniquely identifies this panel. If MISSING, thetitlewill be used.
- icon : Optional[TagChild] = None
- 
A TagChildwhich is positioned just before thetitle.
- ****kwargs** : TagAttrValue = {}
- 
Tag attributes for the body’s HTML container. 
Returns
- : AccordionPanel
- 
AccordionPanelobject.
References
See Also
Examples
#| '!! shinylive warning !!': |
#|   shinylive does not work in self-contained HTML documents.
#|   Please set `embed-resources: false` in your metadata.
#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
## file: app.py
from shiny import App, Inputs, Outputs, Session, reactive, render, ui
items = [
    ui.accordion_panel(f"Section {letter}", f"Some narrative for section {letter}")
    for letter in "ABCDE"
]
app_ui = ui.page_fluid(
    # Provide an id to create a shiny input binding
    ui.accordion(*items, id="acc"),
    ui.h4("Accordion:"),
    ui.output_text_verbatim("acc_val", placeholder=True),
)
def server(input: Inputs, output: Outputs, session: Session):
    @reactive.effect
    def _():
        print(input.acc())
    @render.text
    def acc_val():
        return "input.acc(): " + str(input.acc())
app = App(app_ui, server)