Skip to main content

Tabs / Navigation

Navigate between two or more tabs. Delete the cards when switching between tabs.

from h2o_wave import main, app, Q, ui

TABS = 'abcde'

async def display_tab(q):[f'example_{}'] = ui.markup_card(
box='1 2 4 3',,
content='\n'.join([''.join([] * 10) for _ in range(50)])

async def remove_cards(q: Q):
for tab in TABS:

async def serve(q: Q):
if not q.client.initialized: = 'a'['tabs'] = ui.tab_card( # Initialize once
box='1 1 4 1',
items=['#{t}', label=t.upper()) for t in TABS]
q.client.initialized = True

if q.args['#']: = str(q.args['#'])

await remove_cards(q)
await display_tab(q)

Tags:  navigationtabs