NiceGUI
Open-source Python UI framework that renders web-based interfaces in the browser from pure Python code.
At a Glance
About NiceGUI
NiceGUI is an open-source Python library from Zauberzeug for building graphical user interfaces that run in the browser. You write buttons, dialogs, charts, tables and 3D scenes as Python code, and NiceGUI handles the web layer. It is distributed via PyPI, conda-forge and Docker, and the latest release listed is v3.18.0.
What It Is
NiceGUI is a backend-first UI framework: all UI logic lives in Python while the framework manages HTML, CSS and JavaScript details. The docs describe it as suited to short scripts, dashboards, robotics projects, IoT, smart home automation and machine learning work. An app is a single script that assembles elements into pages and calls ui.run() to start a local server, which can be opened in a browser or in a native window.
How It Works
UI elements are arranged declaratively using Python's with statement. User interactions trigger events handled by Python functions, and elements can be bound to data models so the interface updates automatically. Styling uses Tailwind CSS classes, Quasar props and custom CSS. The framework runs on an async event loop, with helpers for running CPU-bound and IO-bound work without blocking the UI.
Components and Capabilities
The documentation lists over a hundred elements, including inputs, dialogs, menus, tables, AG Grid, ECharts, Plotly, Matplotlib, Leaflet maps, 3D scenes, joysticks, audio and video. Additional features include sub-pages for single-page apps, per-user and general storage, auto-reload on code change, and lifecycle hooks. Custom routes can be added through FastAPI.
Testing and Deployment
A pytest-based testing framework offers a screen fixture using a real headless browser and a faster user fixture that simulates interaction at the Python level. Apps can run locally, on a server serving many clients, in native mode, or through a multi-arch Docker image. The stack builds on Vue, Quasar, FastAPI, Starlette and Uvicorn, and requires Python 3.10+.
AI Assistant Support
The project ships an LLM reference at nicegui.io/llms.txt and a machine-readable JSON documentation index that AI assistants or RAG pipelines can use when generating NiceGUI code.
Community Discussions
Be the first to start a conversation about NiceGUI
Share your experience with NiceGUI, ask questions, or help others learn from your insights.
Pricing
Open Source
NiceGUI core framework released under the MIT License; free to use, copy, modify and distribute.
- MIT License
- Install via pip, Docker or conda-forge
- Browser-based UI framework in Python
- 100+ components, data binding, charts, 3D scenes
- Native desktop mode
Capabilities
Key Features
- Browser-based GUI written entirely in Python
- 100+ UI elements including buttons, dialogs, tables, charts and 3D scenes
- Reactive data binding and refreshable functions
- Auto-reload on code change
- Native window mode
- Single-page apps with ui.sub_pages
- Per-user and general persistent storage
- Tailwind CSS and Quasar customization
- Pytest-based testing framework with screen and user fixtures
- Custom FastAPI routes
- Jupyter Notebook support
- Docker image
- LLM reference and machine-readable documentation index
