Any PrefabApp can be exported as a standalone HTML file. The exported file is a static artifact: open it in a browser, embed it as an iframe in a blog post, or deploy it to any static host. There’s no server, no build step, no runtime Python. This is useful when you want to share a Prefab UI outside of an MCP host, for example embedding an interactive dashboard in documentation or a static site. If your app needs a backend (database queries, authentication, server-side logic), use an API server withDocumentation Index
Fetch the complete documentation index at: https://prefab.prefect.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
Fetch actions or an MCP server with CallTool instead. Export is for UIs where all the data and behavior is self-contained in the HTML.
Exported apps run entirely in the browser. Client-side features all work: state, forms, conditionals,
Fetch actions, and client-side interactivity. CallTool actions require an MCP server and will not function in exported files.Usage
Given a Python file that defines aPrefabApp:
app.py
prefab export:
app.html to the current directory, derived from the input filename. Override the output path with --output:
PrefabApp instances, specify which one:
CDN vs Bundled
By default, the exported HTML loads the Prefab renderer from CDN (jsDelivr), pinned to your installedprefab-ui version. The file itself stays small, around 1 KB of boilerplate plus your component data, but requires a network connection to render.
For fully self-contained output with all JS and CSS inlined, pass --bundled:
Version Pinning
CDN exports are pinned to your installed version by default. On dev builds, the version defaults tolatest. You can pin to any published version explicitly:
Embedding
The exported file works as a standalone page or inside an iframe:Options
| Flag | Default | Description |
|---|---|---|
--output, -o | <input_stem>.html | Output file path |
--bundled | false | Inline all JS/CSS (no network needed) |
--cdn-version | Installed version | Pin CDN renderer to a specific version |