---
title: Editor code and published code
project: UI Builder
version: 1.0
section: development
language: en
license: MIT
url: https://totaljs.es/docs/uibuilder/1-0/development/editor-and-render/
updated: 2026-11-19T11:56:06.259Z
---

# Editor code and published code

> What runs in the editor, what runs in a published design and how the design is published.

UI Builder runs your component in two places. The editor runs `exports.make` of `editor.html`, and the published design runs `exports.make` of `render.html`.

## What each one does

| | Editor | Published design |
|---|---|---|
| Purpose | Show what the component will look like, and react to its settings. | Do the real work: read input, keep the value, talk to other components. |
| Settings change | Yes, emits `configure`. | No. |
| Last argument of `make` | `true` | `undefined` |
| `UIBuilder.editor` | `true` | not set |

Keep the editor code light: a field can show its label and a placeholder without working. **Textbox** shows a grey box in the editor and a real input in the published design.

One source for both is possible: use the last argument of `make` to tell them apart.

```js
exports.make = function(instance, config, element, cls, iseditor) {
	if (!iseditor) {
		instance.state.bind = true;
	}
};
```

## How a design is published

When the user selects **Publish**, UI Builder:

1. Serializes every instance with its configuration. Each instance can change its data in the `stringify` handler.
2. Replaces each component in `components` with the address of its `render.html`.
3. With **Download components' to the source in compiling** on in [Global settings](/uibuilder/1-0/reference/global-settings/), downloads each `render.html` and puts its source into the design, without the readme and the settings.

The published page loads `render.html` from its address, so the file must stay there, on a server that allows requests from the page (CORS). A component created in the editor has no address: its source goes into the design.

## Clean the configuration

Remove what the published design does not need in `stringify`. The second argument is `true` when the design is published.

```js
instance.on('stringify', function(meta, isbuild) {
	if (isbuild)
		delete meta.config.note;
});
```

## Where a published design runs

The page from **Download HTML** loads the Total.js UI library and the UI Builder runtime and builds the design with `UIBuilder.build()`. An app can do the same with the `_render.json` file. See [App reference](../app-api/).
