Skip to main content

Form / Choice Group

Use choice groups to let users select one option from two or more choices.

from h2o_wave import main, app, Q, ui

choices = [
ui.choice('A', 'Option A'),
ui.choice('B', 'Option B'),
ui.choice('C', 'Option C', disabled=True),
ui.choice('D', 'Option D'),

async def serve(q: Q):
if q.args.show_inputs:['example'].items = [
ui.button(name='show_form', label='Back', primary=True),
else:['example'] = ui.form_card(box='1 1 4 7', items=[
ui.choice_group(name='choice_group', label='Pick one', value='B', required=True, choices=choices),
ui.button(name='show_inputs', label='Submit', primary=True),

Tags:  choicechoice_groupform