Skip to main content


Create a multi-step wizard using form cards.

from h2o_wave import Q, ui, main, app

async def serve(q: Q):
if not q.client.initialized: # First visit, create an empty form card for our wizard['wizard'] = ui.form_card(box='1 1 2 4', items=[])
q.client.initialized = True

wizard =['wizard'] # Get a reference to the wizard form
if q.args.step1:
wizard.items = [
ui.text_xl('Wizard - Step 1'),
ui.text('What is your name?', name='text'),
ui.textbox(name='nickname', label='My name is...', value='Gandalf'),
ui.buttons([ui.button(name='step2', label='Next', primary=True)]),
elif q.args.step2:
q.client.nickname = q.args.nickname
wizard.items = [
ui.text_xl('Wizard - Step 2'),
ui.text(f'Hi {q.args.nickname}! How do you feel right now?', name='text'),
ui.textbox(name='feeling', label='I feel...', value='magical'),
ui.buttons([ui.button(name='step3', label='Next', primary=True)]),
elif q.args.step3:
wizard.items = [
ui.text_xl('Wizard - Done'),
f'What a coincidence, {q.client.nickname}! I feel {q.args.feeling} too!',
ui.buttons([ui.button(name='step1', label='Try Again', primary=True)]),
wizard.items = [
ui.text_xl('Wizard Example'),
ui.text("Let's have a conversation, shall we?"),
ui.buttons([ui.button(name='step1', label='Of course!', primary=True)]),


Tags:  formwizard