---
title: UI Builder compiler
project: Total.js V4
version: 0.0.99
section: reference
language: en
license: MIT
url: https://totaljs.es/docs/total-js-v4/0-0-99/reference/ui-builder-compiler/
updated: 2026-11-18T16:57:44.579Z
---

# UI Builder compiler

> F.uibuildercompiler().

## API

### F.uibuildercompiler(opt, [callback])

Type: `method`

Compiles a UI Builder schema so it can be rendered without the designer.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `opt.schema` | `String|Object` | yes |  | The UI Builder schema (JSON string or object). |
| `opt.origin` | `String` | no |  | The origin for relative component URLs. |
| `opt.download` | `Boolean` | no | `false` | Embeds the component HTML. |
| `opt.local` | `Boolean` | no | `false` | Skips resolving components. |
| `callback` | `Function(err, response)` | no |  | Receives the compiled schema. |

Returns: `Promise` Only without a callback.

Finds the components used in the schema and resolves their render URLs from `schema.components` (relative URLs use `opt.origin` or `schema.origin`; a `.json` value is a list of more components). With `opt.download` the HTML of each component is downloaded and embedded as `base64`. With `opt.local` the components are not downloaded at all. The result is the schema without the editor data, with `compiled: true` and `css` taken from `cssoutput`. Without a callback it returns a Promise.

Example: Compile and store
```js
var app = await F.uibuildercompiler({ schema: body, download: true });
PATH.fs.writeFile(PATH.databases('app.json'), JSON.stringify(app), NOOP);
```
