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.
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.