Skip to content

Commit 7bf2ce5

Browse files
docs: clarify how to control the active tab
See #476
1 parent 5f3946f commit 7bf2ce5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

solara/lab/components/tabs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ def Page():
120120
121121
@solara.component
122122
def Page():
123+
124+
def next_tab():
125+
tab_index.value = (tab_index.value + 1) % 2
126+
123127
solara.Title(f"Tab {tab_index.value + 1}")
128+
solara.Button('Next Tab', on_click=next_tab)
129+
124130
with solara.lab.Tabs(value=tab_index):
125131
with solara.lab.Tab("Tab 1"):
126132
solara.Markdown("Hello")

0 commit comments

Comments
 (0)