express.ui.accordion_panel(title, *, value=MISSING, icon=None, **kwargs)

Context manager for single accordion panel.

This function wraps accordion_panel.


title: TagChild

A title to appear in the accordion_panel’s header.

value: Optional[str] | MISSING_TYPE = MISSING

A character string that uniquely identifies this panel. If MISSING, the title will be used.

icon: Optional[TagChild] = None

A Tag which is positioned just before the title.

**kwargs: TagAttrValue = {}

Tag attributes to the accordion-body div Tag.


#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400

## file:
from import input, render, ui

with ui.accordion(id="acc"):
    for letter in "ABCDE":
        with ui.accordion_panel(f"Section {letter}"):
            f"Some narrative for section {letter}"

def acc_val():
    return "input.acc(): " + str(input.acc())