# NiceGUI — Build Web UIs with Python, the Nice Way > Create beautiful web interfaces with pure Python. Auto-reload, Tailwind, charts, 3D, and more. No JS needed. 15K+ GitHub stars. ## Install Copy the content below into your project: # NiceGUI — Build Web UIs with Python, the Nice Way ## Quick Use ```bash pip install nicegui ``` ```python from nicegui import ui ui.label('Hello NiceGUI!') ui.button('Click me', on_click=lambda: ui.notify('Button clicked!')) ui.run() ``` Open `http://localhost:8080` — your UI is live with auto-reload. ```python # AI Chat interface in 15 lines from nicegui import ui from openai import OpenAI client = OpenAI() messages = [] async def send(text): messages.append({"role": "user", "content": text}) response = client.chat.completions.create(model="gpt-4o", messages=messages) reply = response.choices[0].message.content messages.append({"role": "assistant", "content": reply}) chat.refresh() with ui.column(): chat = ui.chat_message ui.input(on_change=lambda e: send(e.value)) ui.run() ``` --- ## Intro NiceGUI is a Python UI framework with 15,500+ GitHub stars for building web interfaces with pure Python — no HTML, CSS, or JavaScript required. It wraps Vue.js and Quasar components behind a clean Python API, offering buttons, tables, charts, 3D scenes, Markdown rendering, file upload, and 40+ more components. With auto-reload during development, Tailwind CSS integration, and native support for async/await, NiceGUI is the fastest way to put a web UI on any Python script, ML model, or AI application. Works with: Python, FastAPI (underlying), any Python library, Tailwind CSS. Best for Python developers who need a quick web UI for scripts, dashboards, or AI demos. Setup time: under 1 minute. --- ## NiceGUI Components ### 40+ Built-in Components | Category | Components | |----------|------------| | **Basic** | label, button, input, textarea, slider, toggle, switch | | **Layout** | row, column, card, tabs, stepper, dialog, drawer | | **Data** | table, aggrid, tree, json_editor | | **Charts** | plotly, matplotlib, echarts, highcharts | | **Media** | image, video, audio, 3D scene | | **AI/ML** | chat_message, markdown, code, mermaid | | **Upload** | upload, download | ### AI Dashboard Example ```python from nicegui import ui import plotly.express as px import pandas as pd df = pd.DataFrame({"epoch": range(20), "loss": [1/(i+1) for i in range(20)]}) with ui.card(): ui.label("Training Dashboard").classes("text-2xl font-bold") ui.plotly(px.line(df, x="epoch", y="loss", title="Training Loss")) with ui.card(): ui.label("Model Inference") prompt = ui.input("Enter prompt") ui.button("Generate", on_click=lambda: run_inference(prompt.value)) output = ui.markdown("") ui.run() ``` ### Tailwind CSS Integration ```python ui.label("Styled text").classes("text-xl font-bold text-blue-500 p-4") ui.button("Fancy button").classes("bg-gradient-to-r from-purple-500 to-pink-500") ``` ### Auto-Reload Edit your Python file and the browser refreshes automatically — no manual restart needed during development. ### Multi-Page Apps ```python @ui.page("/") def home(): ui.label("Home Page") ui.link("Go to Dashboard", "/dashboard") @ui.page("/dashboard") def dashboard(): ui.label("Dashboard") ``` ### Docker Deployment ```dockerfile FROM python:3.11-slim RUN pip install nicegui COPY main.py . CMD ["python", "main.py"] ``` --- ## FAQ **Q: What is NiceGUI?** A: NiceGUI is a Python UI framework with 15,500+ GitHub stars for building web interfaces with pure Python. 40+ components, Tailwind CSS, auto-reload, and no JavaScript required. **Q: How is NiceGUI different from Streamlit?** A: NiceGUI gives you more control — proper component layout, custom styling with Tailwind, multi-page routing, and FastAPI integration. Streamlit is simpler but more limited. NiceGUI is closer to "real web development" while staying in Python. **Q: Is NiceGUI free?** A: Yes, open-source under MIT license. --- ## Source & Thanks > Created by [Zauberzeug](https://github.com/zauberzeug). Licensed under MIT. > > [nicegui](https://github.com/zauberzeug/nicegui) — ⭐ 15,500+ --- ## 快速使用 ```bash pip install nicegui ``` ```python from nicegui import ui ui.label('你好 NiceGUI!') ui.button('点我', on_click=lambda: ui.notify('按钮被点击!')) ui.run() ``` --- ## 简介 NiceGUI 是一个拥有 15,500+ GitHub stars 的 Python UI 框架,用纯 Python 构建 Web 界面 40+ 组件、Tailwind CSS、自动重载、无需 JavaScript。是给任何 Python 脚本加 Web UI 的最快方式。 --- ## 来源与感谢 > Created by [Zauberzeug](https://github.com/zauberzeug). Licensed under MIT. > > [nicegui](https://github.com/zauberzeug/nicegui) — ⭐ 15,500+ --- Source: https://tokrepo.com/en/workflows/05be3215-8d99-43e8-b10d-c724db986d4b Author: AI Open Source