Skip to content

Commit

Permalink
docs: clarify how to control the active tab
Browse files Browse the repository at this point in the history
See #476
  • Loading branch information
maartenbreddels committed Feb 29, 2024
1 parent 5f3946f commit 7bf2ce5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions solara/lab/components/tabs.py
Expand Up @@ -120,7 +120,13 @@ def Page():
@solara.component
def Page():
def next_tab():
tab_index.value = (tab_index.value + 1) % 2
solara.Title(f"Tab {tab_index.value + 1}")
solara.Button('Next Tab', on_click=next_tab)
with solara.lab.Tabs(value=tab_index):
with solara.lab.Tab("Tab 1"):
solara.Markdown("Hello")
Expand Down

0 comments on commit 7bf2ce5

Please sign in to comment.