Skip to main content

Form / Picker

Use pickers to allow users to select one or more choices, such as tags or files, from a list.

from h2o_wave import main, app, Q, ui

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 5', items=[
ui.picker(name='picker', label='Place an order (try Spam, Eggs or Ham):', choices=[
ui.choice(name='spam', label='Spam'),
ui.choice(name='eggs', label='Eggs'),
ui.choice(name='ham', label='Ham'),
ui.choice(name='cheese', label='Cheese'),
ui.choice(name='beans', label='Beans'),
ui.choice(name='toast', label='Toast'),
], values=['eggs']),
ui.button(name='show_inputs', label='Submit', primary=True),

Tags:  choiceformpicker