Overview
NiceGUI is a Python UI framework that renders your interface in a web browser. You write Python code to create elements like buttons, inputs, dialogs, Markdown, plots, tables, and 3D scenes, and NiceGUI handles the frontend for you. It is built on FastAPI on the backend and Vue plus Quasar on the frontend.
It is aimed at Python developers who want a graphical interface without writing HTML, CSS, or JavaScript. The project highlights micro web apps, dashboards, robotics projects, and smart home setups, and it also works well for development tasks such as tuning a machine learning algorithm or configuring a controller.
As a data app builder, NiceGUI keeps the logic backend-first: state lives in your Python code rather than being driven by frontend magic. It can run as a web server accessed by a browser, in native mode as a desktop window, and inside Jupyter notebooks.
What it does
- Standard GUI elements out of the box: label, button, checkbox, switch, slider, input, file upload, and more, grouped with rows, columns, cards, and dialogs
- High-level elements for plotting graphs and charts, rendering 3D scenes, annotating images, and working with tables and tree structures
- Automatic page reload when you change your code, so you see updates without a manual restart
- Runs as a web server, in native desktop-window mode, or inside Jupyter notebooks and Python's interactive mode
- Data binding, refreshable functions, and a built-in timer to refresh data at intervals as short as 10 ms
- Built on FastAPI, Starlette, and Uvicorn, with a pytest-based testing framework included
Getting started
Install the package from PyPI, write a short main.py, and run it to open the GUI in your browser.
Install NiceGUI
Install the package from PyPI with pip.
python3 -m pip install niceguiWrite your GUI
Create a file named main.py with a label, a button, and a call to ui.run().
from nicegui import ui
ui.label('Hello NiceGUI!')
ui.button('BUTTON', on_click=lambda: ui.notify('button was pressed'))
ui.run()Launch it
Run the file with Python, then open http://localhost:8080/ in your browser. NiceGUI reloads the page automatically when you change the code.
python3 main.pyCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Build internal tools and dashboards for a team without setting up a separate frontend stack
- Create a control panel or live UI for a robotics, smart home, or hardware project
- Add a quick interface for tuning or monitoring a machine learning algorithm or controller during development
- Ship a small native desktop app or micro web app from a single Python file
How NiceGUI compares
NiceGUI alongside other open-source data app builders tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Streamlit | ★ 45k | A Python framework that turns scripts into interactive data and ML web apps with simple widget calls and no frontend code. |
| Gradio | ★ 43k | A Python library for quickly building shareable web demos and UIs for machine learning models, APIs, and arbitrary functions. |
| Reflex | ★ 28.6k | A framework for building full-stack web apps entirely in Python, compiling component code to a React frontend and Python backend. |
| Dash | ★ 24.3k | A Python framework from Plotly for building analytical web dashboards and data apps with interactive charts and no JavaScript required. |
| marimo | ★ 21.5k | A reactive Python notebook stored as plain Python that can be run as a script or deployed as an interactive data app. |
| NiceGUI | ★ 15.9k | Build web UIs in pure Python, served straight to your browser |
| Data Formulator | ★ 15.8k | A Microsoft Research tool that combines a UI with AI to help users create rich data visualizations through natural language and direct manipulation. |
| Mesop | ★ 6.6k | A Python UI framework, started at Google, for rapidly building AI demos and internal web apps using composable components. |