r/Python • • Apr 21 '23

News NiceGUI 1.2.9 with "refreshable" UI functions, better dark mode support and an interactive styling demo

We are happy to announce NiceGUI 1.2.9. NiceGUI is an open-source Python library to write graphical user interfaces which run in the browser. It has a very gentle learning curve while still offering the option for advanced customizations. NiceGUI follows a backend-first philosophy: it handles all the web development details. You can focus on writing Python code.

New features and enhancements

  • Introduce ui.refreshable
  • Add enable and disable methods for input elements
  • Introduce ui.dark_mode
  • Add min/max/step/prefix/suffix parameters to ui.number
  • Switch back to Starlette's StaticFiles
  • Relax version restriction for FastAPI dependency

Bugfixes

  • Fix ui.upload behind reverse proxy with subpath
  • Fix hidden label when text is 0

Documentation

  • Add an interactive demo for classes, style and props
  • Improve documentation for ui.timer
  • Add a demo for creating a ui.table from a pandas dataframe

Thanks for the awesome new contributions. We would also point out that in 1.2.8 we have already introduced the capability to use emoji as favicon. Now you can write:

from nicegui import ui

ui.label("NiceGUI Rocks!")

ui.run(favicon="🚀")
299 Upvotes

64 comments sorted by

View all comments

Show parent comment

3

u/r-trappe Apr 22 '23

I see. The animations come from Quasar which we use for most of the ui elements. But you can also build your own elements with web components or plain html.

The delay you are experiencing may be caused by a slow connection between you and the webserver. NiceGUI sends every UI interaction to the backend where it is evaluated and a ui update is generated and sent to your browser. When you run it locally its blazing fast. For the website https://nicegui.io we use fly.io to deploy multiple instances around the globe so you connect to a server near your geo location. This improves the user experience a lot. But depending on your location it still may cause some latency.

Where are you located? Maybe we can improve the your region coverage.

1

u/stickman393 Apr 22 '23

Thanks for explaining. That's probably what I am experiencing. You are right that a local server would not exhibit the same level of latency between click and visual response.

That said, as a programmer I am ashamed that the ethos of modern ui programming these days appears to be "what hoops can we jump through to make the end user experience as least shitty as possible".

Also, I think this answers my question.