Cette page est affichée en anglais. Une traduction française est en cours.
KnowledgeApr 3, 2026·2 min de lecture

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.

Introduction

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

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

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

@ui.page("/")
def home():
    ui.label("Home Page")
    ui.link("Go to Dashboard", "/dashboard")

@ui.page("/dashboard")
def dashboard():
    ui.label("Dashboard")

Docker Deployment

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 et remerciements

Created by Zauberzeug. Licensed under MIT.

nicegui — ⭐ 15,500+

Discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires