Skip to main content

Form / Spinbox / Trigger

Enable the trigger attribute in order to handle live changes to a spinbox.

from typing import Optional
from h2o_wave import main, app, Q, ui

def get_form_items(value: Optional[float]):
return [
ui.spinbox(name='spinbox_trigger', label='Pick a number', trigger=True),

async def serve(q: Q):
if not q.client.initialized:['example'] = ui.form_card(box='1 1 4 4', items=get_form_items(None))
q.client.initialized = True
if q.args.spinbox_trigger is not None:['example'].items = get_form_items(q.args.spinbox_trigger)


Tags:  formspinboxtrigger