I can’t seem to find much on these topics. Does anyone know:
If it’s possible to / how to access the click events of an st.tab element?
If it’s possible to set which tab is displayed as selected when a page opens?
If possible, what I would like to do is use the tab click event to navigate to a new page using some previous code I found on the forum and set a default tab as displayed for that page (basically use the tabs for page navigation).
Unfortunately, no. For now st.tab is purely a visual organizing element, and doesn’t support any sort of programmatic access, either getting or setting the current tab. That’s something we’ll think about for the future, but for now it’s not possible.
Would like to know, is there any feature we can implement where there are 2 tabs. Clicking on the first tab the sidebar should display the elements and clicking on the second tab we can make the sidebar empty or fill with different elements.
+1 for this feature!
Currently, I have a use-case where the user programmatically adds and removes the “visible” tabs from the sidebar. However, when currently visualizing a tab that is removed (from the sidebar), the screen remains in a blank “ghost tab” until another tab is clicked.
Would love the option to “move” the user to the right tab when deleting the tab currently being shown.