pydantic /FastUI

Build better UIs faster.

★ 8,923⑂ 340👁 68⑃ 158● 230▤ 9
PythonMITCreated 2023-09-18fastui-demo.onrender.com
下载:v0.9.0 2025-10-28v0.9.0 ↓0.9.02025-10-28
+0
日增长
8,923
stars
340
forks
68
watchers
158
prs
230
issues
9
releases

README

NOTE: this project is inactive, see 368

 FastUI

Find the documentation here.
Join the discussion in the fastui slack channel here






Please note: FastUI is still an active work in progress, do not expect it to be complete.

 The Principle (short version)

You can see a simple demo of an application built with FastUI here.

FastUI is a new way to build web application user interfaces defined by declarative Python code.

This means:

- If you're a Python developer — you can build responsive web applications using React without writing a single line of JavaScript, or touching npm.
- If you're a frontend developer — you can concentrate on building magical components that are truly reusable, no copy-pasting components for each view.
- For everyone — a true separation of concerns, the backend defines the entire application; while the frontend is free to implement just the user interface

At its heart, FastUI is a set of matching Pydantic models and TypeScript interfaces that allow you to define a user interface. This interface is validated at build time by TypeScript and pyright/mypy and at runtime by Pydantic.

 The Practice — Usage

FastUI is made up of 4 things:

- fastui PyPI package — Pydantic models for UI components, and some utilities. While it works well with FastAPI it doesn't depend on FastAPI, and most of it could be used with any python web framework.
- @pydantic/fastui npm package — a React TypeScript package that lets you reuse the machinery and types of FastUI while implementing your own components
- @pydantic/fastui-bootstrap npm package — implementation/customisation of all FastUI components using Bootstrap
- @pydantic/fastui-prebuilt npm package (available on jsdelivr.com CDN) providing a pre-built version of the FastUI React app so you can use it without installing any npm packages or building anything yourself. The Python package provides a simple HTML page to serve this app.

Here's a simple but complete FastAPI application that uses FastUI to show some user profiles:

python
from datetime import date

from fastapi import FastAPI, HTTPException
from fastapi.responses import HTMLResponse
from fastui import FastUI, AnyComponent, prebuilt_html, components as c
from fastui.components.display import DisplayMode, DisplayLookup
from fastui.events import GoToEvent, BackEvent
from pydantic import BaseModel, Field

app = FastAPI()


class User(BaseModel):
    id: int
    name: str
    dob: date = Field(title='Date of Birth')


 define some users
users = [
    User(id=1, name='John', dob=date(1990, 1, 1)),
    User(id=2, name='Jack', dob=date(1991, 1, 1)),
    User(id=3, name='Jill', dob=date(1992, 1, 1)),
    User(id=4, name='Jane', dob=date(1993, 1, 1)),
]


@app.get("/api/", response_model=FastUI, response_model_exclude_none=True)
def users_table() - list[AnyComponent]:
    """
    Show a table of four users, /api is the endpoint the frontend will connect to
    when a user visits / to fetch components to render.
    """
    return [

Top issues

Latest release

v0.9.0 2025-10-28 v0.9.0 2025-10-28
What's Changed
 Add support for Python 3.14, drop 3.9, update dependencies by @Viicos in https://github.com/pydantic/FastUI/pull/383

Full Changelog: https://github.com/pydantic/FastUI/compare/v0.8.0...v0.9.0

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON