Skip to content

Form Mode displays a canvas alongside an auto-generated form panel. End-users fill in text, images, and colors through the form; the canvas updates in real-time. Designed for embedding via iframe when you want users to customize templates without the full editor UI.

Check out how it looks like:

Form Mode — canvas with auto-generated form panel

Use the form base path: /editor/form/{TEMPLATE_ID}?embed={CONFIG_ID}.

Basic Form Embed
<iframe
id="template-embed"
src="https://app.templated.io/editor/form/{$TEMPLATE_ID}?embed={$CONFIG_ID}"
width="100%"
height="600"
frameborder="0"
></iframe>
  • form-panel-position (left|right) — form panel position, default right

Example with flags:

<iframe
src="https://app.templated.io/editor/form/{$TEMPLATE_ID}?embed={$CONFIG_ID}
&form-panel-position=left&allow-download=true"
width="100%" height="600" frameborder="0"
></iframe>

Lock layers in the editor to hide them from the form.
Unlocked layers automatically appear as form fields.
This lets you control exactly which layers end-users can customize.

Each layer type renders a different set of form controls:

Layer typeForm controls
TextText input + color picker
ImageURL input
ShapeFill color picker + stroke color picker
QR CodeText input for data
BarcodeText input for data
RatingNumber input

After the iframe loads, you can control Form Mode at runtime using postMessage. The editor will also send events back.

Parent → Editor
// Toggle form mode on or off
iframe.contentWindow.postMessage({
type: 'SET_FORM_MODE',
enabled: true
}, '*');
// Change the form panel position
iframe.contentWindow.postMessage({
type: 'SET_FORM_PANEL_POSITION',
position: 'left' // 'left' | 'right'
}, '*');
Editor → Parent
window.addEventListener('message', (event) => {
// Optional: verify origin: if (event.origin !== 'https://app.templated.io') return;
const msg = event.data;
switch (msg?.type) {
// Form mode toggled
case 'FORM_MODE_UPDATED':
console.log('Form mode:', msg.enabled, 'Success:', msg.success);
break;
// Panel position changed
case 'FORM_PANEL_POSITION_UPDATED':
console.log('Panel position:', msg.position, 'Success:', msg.success);
break;
// A form field value changed
case 'FORM_VALUES_CHANGED':
// msg.data contains { layerName: { prop: value } }
console.log('Form values changed:', msg.data);
break;
// User clicked the render button in the form
case 'FORM_RENDER_REQUESTED':
console.log('Render requested:', msg.format, msg.templateId);
break;
}
});

On screens narrower than 1024px, the form panel automatically stacks below the canvas for a mobile-friendly layout.

Comprehensive working example
<iframe id="template-embed" width="100%" height="700" frameborder="0"></iframe>
<div>
<button onclick="toggleFormMode()">Toggle Form Mode</button>
<button onclick="switchPanelPosition()">Switch Panel Position</button>
</div>
<script>
const iframe = document.getElementById('template-embed');
const CONFIG_ID = 'YOUR_EMBED_CONFIG_ID';
const TEMPLATE_ID = 'tpl_ABC123';
let formEnabled = true;
let panelPosition = 'right';
// 1) Initial URL-based load
const url = new URL(`https://app.templated.io/editor/form/${TEMPLATE_ID}`);
url.searchParams.set('embed', CONFIG_ID);
url.searchParams.set('form-panel-position', 'right');
iframe.src = url.toString();
// 2) Listen for editor events
window.addEventListener('message', (event) => {
const msg = event.data;
console.log('Received message:', msg);
switch (msg?.type) {
case 'EDITOR_READY':
console.log('Editor ready for interactions');
break;
case 'FORM_MODE_UPDATED':
formEnabled = msg.enabled;
console.log('Form mode:', formEnabled ? 'enabled' : 'disabled');
break;
case 'FORM_PANEL_POSITION_UPDATED':
panelPosition = msg.position;
console.log('Panel position:', panelPosition);
break;
case 'FORM_VALUES_CHANGED':
console.log('Form values changed:', msg.data);
break;
case 'FORM_RENDER_REQUESTED':
console.log('Render requested:', msg.format, msg.templateId);
break;
}
});
// 3) Control functions
function toggleFormMode() {
formEnabled = !formEnabled;
iframe.contentWindow.postMessage({
type: 'SET_FORM_MODE',
enabled: formEnabled
}, '*');
}
function switchPanelPosition() {
panelPosition = panelPosition === 'right' ? 'left' : 'right';
iframe.contentWindow.postMessage({
type: 'SET_FORM_PANEL_POSITION',
position: panelPosition
}, '*');
}
</script>