Day 2647 / NiceGUI notes
NiceGUI is freaking awesome.
-
Resources
- nicegui/examples at main · zauberzeug/nicegui the most useful examples I’ve seen in any python project ever.
-
Useful examples
- search_as_you_type for updating a table based on
Misc
- ui.list | NiceGUI hows very pretty complex lists with sections!
- ui.icon | NiceGUI works for icons: Material Symbols & Icons - Google Fonts
- Tooltips can contain all other elements! ui.tooltip | NiceGUI
Snippets
Uploading files
ui.upload(
auto_upload=True, on_upload=lambda e: handle_upload(e)
).classes("max-w-full")
async def handle_upload(e: events.UploadEventArguments):
with tempfile.NamedTemporaryFile(delete=False, prefix="uns") as tmp:
save_path = Path(tmp.name)
await e.file.save(save_path)
return save_path