Skip to content

feat: add expanded option to accordion#8559

Draft
ryptotalent wants to merge 3 commits intomarimo-team:mainfrom
ryptotalent:feature/accordion-expanded-option
Draft

feat: add expanded option to accordion#8559
ryptotalent wants to merge 3 commits intomarimo-team:mainfrom
ryptotalent:feature/accordion-expanded-option

Conversation

@ryptotalent
Copy link

Adds expanded parameter to mo.accordion() that expands all items by default when set to True. Defaults to False for backward compatibility.

Closes #8549

Adds user configuration option 'enter_command_mode_on_escape' to control whether pressing Escape enters command mode. Defaults to true for backward compatibility.

Closes marimo-team#7426
@vercel
Copy link

vercel bot commented Mar 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Mar 3, 2026 9:56pm

Request Review

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Adds expanded parameter to mo.accordion() that expands all items by default when set to True. Defaults to False for backward compatibility.

Closes marimo-team#8549
if (
evt.key === "Escape" &&
userConfig.keymap.enter_command_mode_on_escape !== false
) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from another PR?

items: dict[str, object],
multiple: bool = False,
lazy: bool = False,
expanded: bool = False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this expand all? is there a case you may just want to expand first first one? or middle one?

cc @akshayka @dmadisetti regarding API

lazy: a boolean, whether to lazily load the accordion content.
This is a convenience that wraps each accordion in a `mo.lazy`
component.
expanded: if True, all accordion items are expanded by default
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear how expanded and multiple interact. It seems like mutliple=False isn't respected with this?

@mscolnick mscolnick marked this pull request as draft March 4, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accordion layout elements visible by default

3 participants