16,330
stars
+3+2+63
976
forks
–
watchers
–
prs
–
issues
–
releases
–
discussions
README
NiceGUI
NiceGUI is an easy-to-use, Python-based UI framework, which shows up in your web browser.
You can create buttons, dialogs, Markdown, 3D scenes, plots and much more.
It is great for micro web apps, dashboards, robotics projects, smart home solutions and similar use cases.
You can also use it in development, for example when tweaking/configuring a machine learning algorithm or tuning motor controllers.
NiceGUI is available as PyPI package, Docker image and on conda-forge as well as GitHub.
Features
- browser-based graphical user interface
- implicit reload on code change
- acts as webserver (accessed by the browser) or in native mode (e.g. desktop window)
- standard GUI elements like label, button, checkbox, switch, slider, input, file upload, ...
- simple grouping with rows, columns, cards and dialogs
- general-purpose HTML and Markdown elements
- powerful high-level elements to
- plot graphs and charts
- render 3D scenes
- show interactive maps
- edit code, JSON and rich text
- get steering events via virtual joysticks
- annotate and overlay images
- interact with tables
- navigate foldable tree structures
- embed video and audio files
- built-in timer to refresh data in intervals (even every 10 ms)
- straightforward data binding and refreshable functions to write even less code
- notifications, dialogs and menus to provide state-of-the-art user interaction
- multi-page and single-page applications
- easy-to-use per-user and general persistence
- ability to add custom routes and data responses
- capture keyboard input for global shortcuts etc.
- customize look by defining primary, secondary and accent colors, including dark mode
- lifecycle events and session data
- runs in Python's interactive mode
- styling with Tailwind CSS and Quasar
- SVG, Base64 and emoji favicon support
- testing framework based on pytest
Installation
bash
python3 -m pip install nicegui
Or with uv:
bash
uv add nicegui
Usage
Write your nice GUI in a file main.py:
python
from nicegui import ui
ui.label('Hello NiceGUI!')
ui.button('BUTTON', on_click=lambda: ui.notify('button was pressed'))
ui.run()
Launch it with:
bash
python3 main.py
The GUI is now available through http://localhost:8080/ in your browser.
Note: NiceGUI will automatically reload the page when you modify the code.
Documentation and Examples
The documentation is hosted at https://nicegui.io/documentation and provides plenty of live demos.
The whole content of https://nicegui.io is implemented with NiceGUI itself
and can be started locally with docker run -p 8080:8080 zauberzeug/nicegui or by executing main.py from this repository.
You may also have a look at our in-depth examples of what you can do with NiceGUI.
In our wiki we have a list of great NiceGUI projects from the community, a section with Tutorials and a growing list of FAQs.
When building NiceGUI projects with AI assistants, point them at nicegui/llms.md — a concise reference that ship