Skip to main content

Form / File Upload / Compact

Use a compact file upload component to take less form space.

from h2o_wave import main, app, Q, ui

async def serve(q: Q):
if 'file_upload' in q.args:['example'] = ui.form_card(box='1 1 4 10', items=[
ui.button(name='show_upload', label='Back', primary=True),
else:['example'] = ui.form_card(
box='1 1 4 7',
ui.file_upload(name='file_upload', label='Select one or more files to upload', compact=True,
multiple=True, file_extensions=['jpg', 'png'], max_file_size=1, max_size=15),
ui.button(name='submit', label='Submit', primary=True)

Tags:  compactfile_uploadformupload