Record of UI keys to ReactUIDef or UIDef
Optionaloptions: BuildOptionsBuild options (passed to buildReactUIs)
Promise resolving to standard UIDefs
import { buildAndTransform, defineReactUI } from "@mcp-apps-kit/ui-react-builder";
import { defineUI, createApp } from "@mcp-apps-kit/core";
const uis = await buildAndTransform({
"react-widget": defineReactUI({ component: MyWidget }),
"html-widget": defineUI({ html: "./widget.html" }),
});
// All are now standard UIDefs
console.log(uis["react-widget"].html.startsWith("<!DOCTYPE html>")); // true
console.log(uis["html-widget"].html); // "./widget.html"
Convenience function to build and transform React UIs in one step.
This combines
buildReactUIsandtransformToCoreDefsfor simpler usage.