PrefectHQ/prefab
🎨 The generative UI framework that even humans can use.
What it solves
Prefab simplifies the creation of rich, interactive user interfaces for Python developers, removing the need to switch to JavaScript or other frontend frameworks. It specifically addresses the challenge of building dashboards, data tables, and forms that remain closely integrated with the Python logic and data they present.
How it works
Prefab provides a Python Domain Specific Language (DSL) that uses context managers to nest components. This declarative structure is compiled into a JSON protocol, which is then rendered by a bundled React frontend based on shadcn/ui. It features a reactive state system (Rx class) that enables client-side interactivity without requiring JavaScript. The framework is designed to be portable and serializable, making it compatible with REST and the Model Context Protocol (MCP).
Who it’s for
It is designed for Python developers building tools, APIs, and servers who need to ship interactive interfaces, as well as developers creating MCP Apps and agent-generated UIs.
Highlights
- 100+ prebuilt production-ready components.
- Native support for MCP Apps via FastMCP.
- Token-efficient and streaming-compatible DSL for agent-generated interfaces.
- No JavaScript required for client-side interactivity.
Related
- Project
- Project
- Project
- Project
- Project