express.ui.accordion_panel
*, value=MISSING, icon=None, **kwargs) express.ui.accordion_panel(title,
Context manager for single accordion panel.
This function wraps accordion_panel
.
Parameters
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
, thetitle
will be used. icon : Optional[TagChild] = None
-
A
Tag
which is positioned just before thetitle
. ****kwargs** : TagAttrValue = {}
-
Tag attributes to the
accordion-body
div Tag.
Examples
#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
## file: app.py
from shiny.express 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}"
@render.code
def acc_val():
return "input.acc(): " + str(input.acc())