Accordion#

marimo.accordion(items: dict[str, object], multiple: bool = False, lazy: bool = False) Html#

Accordion of one or more items.

Example.

mo.accordion({
    "Tip": "Use accordions to let users reveal and hide content."
})

Accordion content can be lazily loaded:

mo.accordion({
    "View total": mo.lazy(expensive_component)
}, lazy=True)

Args.

  • items: a dictionary of item names to item content; strings are interpreted as markdown

  • multiple: whether to allow multiple items to be open simultaneously

  • lazy: a boolean, whether to lazily load the accordion content. This is a convenience that wraps each accordion in a mo.lazy component.

Returns.

  • An Html object.