zauberzeug /nicegui
Create web-based user interfaces with Python. The nice way.
★ 16,341⑂ 979👁 88⑃ 1,980● 1,614▤ 324
+5
日增长
+14
周增长
+65
月增长
16,341
stars
979
forks
88
watchers
1,980
prs
1,614
issues
324
releases
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 shipTop issues
#5684Slow startup and code re-execution in multiprocessing contexts7 comments · 2026-01-26#6499Choice change callbacks return frontend models or indices as previous_value3 comments · 2026-11-11#6508background_tasks.create fails in async tests that don't start the app1 comments · 2026-11-15#6376Polled bindings re-send the element on every refresh cycle if the target's setter normalizes the value1 comments · 2026-10-05#6507Two tasks awaiting the same ui.dialog: the second one gets None instead of the submitted value0 comments · 2026-11-15
Discussions
#6501Startup procesure when application uses a multiprocessing.Manager1 comments · 2026-11-12#6447for ui.element -- @classmethod default_on_value_change4 comments · 2026-10-29#6436symbion: a keyboard-first NiceGUI PWA over a coding agent's tickets, and what we tripped over1 comments · 2026-10-28#6390Drag-Select1 comments · 2026-10-12#6383Idea: NiceGUI + FastAPI + MongoDB-repo?2 comments · 2026-10-07#6377Pip unable to install NiceGUI0 comments · 2026-10-05#6360BidiLens: native-first mixed-direction fixtures for NiceGUI chat and Markdown1 comments · 2026-09-27#6356Using URL hash as storage3 comments · 2026-09-26
Latest release
v4.0.0 v4.0.0 2026-11-04NiceGUI 4.0 is a major release focused on cleaning up: it removes the APIs deprecated during 3.x, corrects a few defaults and catches up on the bundled JavaScript libraries. Nothing changes as fundamentally as the auto-index page did in 3.0, so most apps should only need small adjustments. Some changes don't raise any error, though, so please read the migration guide before upgrading. How to upgrade 1. Update to the latest 3.19 release, run your app and tests, and fix all deprecation warnings. They name the replacement for most of what is removed in 4.0. 2. Check the new minimum requir