--- id: prefab-ui version: "0.20.2" license: Apache-2.0 license_treatment: permissive maintenance: active --- # prefab-ui — The generative UI framework that even humans can use. License: permissive · Maintenance: active · Downloads: 397.1K/mo ## What it is and what it does Prefab is a Python DSL for composing interactive user interfaces from prebuilt components, compiling them to JSON and rendering via a bundled React frontend. It eliminates the need to write JavaScript or switch to a separate frontend language when building dashboards, forms, data tables, or interactive tools alongside Python logic. The framework uses context managers for natural component nesting and a reactive state system (Rx) for client-side interactivity. It is designed for MCP Apps and integrates with FastMCP, supporting both hand-authored declarative interfaces and agent-generated UIs. The output is serializable and safe for programmatic generation, making it suitable for tools that need to produce interfaces dynamically. Use it for: - Build interactive dashboards and data visualization tools in Python without writing frontend code. - Create MCP Apps with rich interactive interfaces using the native Prefab integration. - Generate UIs programmatically or via agents, since the component tree compiles to a portable JSON protocol. - Ship interactive forms and data-entry tools alongside Python APIs and servers. - Prototype and iterate on UI designs rapidly using Python's familiar syntax and context managers. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Prefab is a Python UI framework for building interactive interfaces with prebuilt components, rendering them through a bundled React frontend without requiring JavaScript or frontend code. Yes, if you need to build interactive Python UIs without frontend expertise. The framework is actively maintained, has low install friction, and solves a real problem for Python developers shipping interfaces. The Apache-2.0 license is permissive. The main caveat is that it's under active development, so expect API changes and verify maturity guarantees for production use. ## Install pip install prefab-ui uv add prefab-ui poetry add prefab-ui ## Installing prefab-ui Before you install: Low friction install with a pure-Python wheel. The project is actively maintained with recent commits and shows healthy engagement. Dependencies are minimal and well-established (cyclopts, pydantic, rich). License in practice: Apache-2.0 is permissive; you can use this in commercial projects and modify it freely, with only attribution and license-notice requirements. Quickstart: pip install prefab-ui from prefab_ui.components import Card, CardContent, H3, Input from prefab_ui.rx import Rx name = Rx("name").default("world") with Card(): with CardContent(): H3(f"Hello, {name}!") Input(name="name") Requires Python 3.10 or later. Verify before relying: - Whether the bundled React renderer works offline or requires network access. - Performance characteristics when rendering large component trees or handling many concurrent users. - Maturity level and backward-compatibility guarantees given the 'very active development' note in the description. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 397.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python ui framework, generative ui components, interactive dashboard python, mcp apps ui, react frontend python dsl, declarative ui framework, python reactive components, ui-framework, mcp-native, generative-ui [View on SkillFed](https://skillfed.io/packages/prefab-ui) · [View on PyPI](https://pypi.org/project/prefab-ui/)