On the top of my streamlit page, I have an aggrid table. I need a method to add multiple aggrid tables in the same section but let the user choose which one to see. Is there a way to do that without having a radio button/drop-down selection? May be left/right arrows as shown in the image (Prevent the Component from Remounting on Prop Change :: Streamlit Components Tutorial)
You could use st.columns([1,8,1]) to create three columns. Put a ‘previous’ button in the first column and a ‘next’ button in the last column. Then you can manually choose what to display in the middle by tracking an index (modulo the length of your list of objects). Alternatively, just put two columns below your full-width display of the selection.
You could also use st.tabs if you are rendering something that causes some delay on rerun. In this instance though, note that tabs are purely an organizational object and the backend doesn’t know which one is being viewed. Hence, you would have to include a button on each tab for the user to declare “Use this one” and proceed.
Thanks a lot for the suggestion @mathcatsand !! The first idea that you have mentioned seems more reasonable to me. I had the same thought but wanted to check if there is a custom component or some other feature that I don’t know about. I will try this and see if it works.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.