The generative UI framework that even humans can use.
Maintained. Last release 5 weeks ago, commits in 3 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install prefab-uiPrefab 🎨
The generative UI framework that even humans can use.
🚧 Don't panic. Prefab is under very active development. 🚧
Docs · Playground · GitHub
Prefab is a UI framework for building rich, interactive interfaces in Python. Create MCP Apps, data dashboards, interactive tools, and more with 100+ prebuilt components. A bundled React renderer turns everything into a self-contained application.
Composing frontends in Python is blasphemous surprisingly natural. Prefab's DSL uses context managers for nesting components, making it both token-efficient and streaming-compatible. As a result, you (or your agent) can declare UIs in advance or generate them on the fly. A reactive state system handles client-side interactivity with no JavaScript required, and MCP and REST backends are (optionally!) supported out of the box.
The "hello world" of Prefab is an interactive card. It looks like something you might see in any frontend framework... except, of course, that it's written entirely in Python. Context managers define the component hierarchy, and the reactive Rx class binds the form input to client-side state. The heading and badge update in real time as you type. You can try an interactive version in the Prefab docs.