Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Selectbox Component #8663

Open
2 tasks done
mkleinbort-ic opened this issue May 14, 2024 · 2 comments
Open
2 tasks done

Nested Selectbox Component #8663

mkleinbort-ic opened this issue May 14, 2024 · 2 comments
Labels

Comments

@mkleinbort-ic
Copy link

Checklist

  • I have searched the existing issues for similar feature requests.
  • I added a descriptive title and summary to this issue.

Summary

image

A streamlit component (or configuration of selectbox) to allow for nesting options.

Why?

This is an issue when there are logically grouped options in a selectbox.

Currently either the selectbox list of options gets very long, or the user has to use more than one action to choose the selection.

How?

The simplest API change I can imagine is to pass a dict of options and sub-options to st.selectbox

Illustratively, to create this:

image

You could write:

st.selectbox('Nested Selectbox', options={
    'Option 1': ['Option 1.1', 'Option 1.2', 'Option 1.3'],
    'Option 2': ['Option 2.1', 'Option 2.2', 'Option 2.3'],
    'Option 3': ['Option 3.1', 'Option 3.2', 'Option 3.3'],
})

Additional Context

I saw the st_ant_tree custom component, but the styling is far from what I'm looking for.

Admittedly, this could be a good use case for a custom component.

@mkleinbort-ic mkleinbort-ic added the type:enhancement Requests for feature enhancements or new features label May 14, 2024
Copy link

To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post.

Your vote helps us identify which enhancements matter most to our users.

Visits

@mkleinbort-ic
Copy link
Author

streamlit-antd-components's Cascader might be a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants