Accessibility
This feature enables developers to configure and manage accessibility options in the builder. With this API, you can name the builder's iframe for screen readers and specify a custom title for the exported HTML.
Editor Configuration
unlayer.init({
editor: {
title: 'Editor Iframe Title',
},
});
In this example, screen readers announce the builder's iframe as "Editor Iframe Title".
If you don't set editor.title, the iframe is named after the display mode, for example "Email editor" or "Web page editor", so screen reader users always know what the frame contains. The name is the iframe's aria-label, not its title, so no tooltip appears when the pointer rests on the builder. The builder also sets its document language from the locale.
Keyboard Navigation
The builder can be used without a mouse. Tab moves between the action bar, the tools panel, the design canvas and the properties panel, and the arrow keys move within each of them. Actions such as inserting, deleting, duplicating, undoing and switching devices are announced to screen readers.
Tools Panel
| Key | Action |
|---|---|
| Up / Down, Home / End | Move between the panel's tabs (Content, Blocks, Body, and others). |
| Enter or Space on a tab | Open the tab. |
| Enter on a tool, block, row or image tile | Insert it after the layer you are on in the canvas, or at the end of the design. "Add Content" in an empty column targets that column. When an image is being chosen for an Image block, Enter or Space picks it instead. |
| Space on a tile | Start a keyboard drag: the arrow keys move it, Tab and Shift+Tab jump to the next or previous place it can be dropped, Space drops it and Escape cancels. |
Design Canvas
The canvas is a tree of layers: rows (including the header and footer), their columns, and the content inside each column. Tab and Shift+Tab move through the layers in that order: a row, then each of its columns followed by the content in it, then the next row. Moving to a layer does not select it.
| Key | Action |
|---|---|
| Up / Down | Move to the previous or next layer. |
| Right / Left | Move into a row's columns or a column's content, or back out to its parent. |
| Home / End | Move to the first or last layer. |
| Enter or Space | Select the layer and open its properties. On a column, select its row with that column's settings open. |
| Enter or F2 on a selected layer | Edit its text. A table starts in its first cell. |
| Escape | Deselect the layer. |
| Tab / Shift+Tab | Move to the next or previous layer. From a selected layer, Tab first reaches its actions, such as Move, Duplicate and Delete. |
| Enter or Space on a Move handle | Pick the selected layer up: the arrow keys move it, Tab and Shift+Tab jump to the next or previous place it can be dropped, Space or Enter drops it and Escape cancels. |
Links, buttons and form fields inside the design are left out of the Tab order while you are in the editor. The exported HTML is unchanged.
Editing Text
| Key | Action |
|---|---|
| Tab / Shift+Tab | Indent and outdent the text, or nest a list item. In a table, move to the next or previous cell. In headings and buttons from older designs, they do nothing. |
| Alt+F10 | Move to the text formatting toolbar. Escape returns to the text. |
| Escape or F2 | Stop editing and return to the layer. From there, Tab and Shift+Tab move through the design as usual. |
Screen readers announce these keys when the text receives focus. In the properties panel, the HTML editor and rich text fields also keep Tab for indenting: press Escape (or F2), then Tab or Shift+Tab, to move on to the next field.
Properties Panel
| Key | Action |
|---|---|
| Left / Right | Move between device tabs (Desktop, Tablet, Mobile) and column tabs. Enter opens a tab. |
| Escape | Close the panel and deselect the layer. Inside a nested panel, close just that panel. |
Reorderable lists, such as social icons, menu items and form fields, have a "Move" handle for keyboard dragging (Enter or Space picks the item up) and Move up / Move down buttons.
Image Editor
| Key | Action |
|---|---|
| ] / [ | Select the next or previous object on the image (text, shape, sticker). |
| Arrow keys | Move the selected object by 1 px, or by 10 px with Shift. |
| Delete | Remove the selected object. |
| Enter | Edit the selected text. |
| Escape | Deselect the object. In a menu or color picker, close just that menu. |
The Crop panel has Left, Top, Width and Height fields, and each object has Position fields, as alternatives to dragging on the image.
AI Assistant Images
| Key | Action |
|---|---|
| Arrow keys on an attached image | Move it earlier or later among the images attached to the prompt. |
| Enter on an attached image | Add it to the design, after the layer you are on in the canvas. |
| + / - / 0 in an image preview | Zoom in, zoom out, or reset the zoom. |
| Arrow keys in a zoomed preview | Move around the image. |
| Escape in an image preview | Close the preview. |
Screen readers announce when an image is added to the design or the prompt, replaced, or the change undone.
Custom Property Editors
Connect your widget's controls to the property's label so screen readers announce them together:
- React widgets receive a
labelprop, the property's label to show, and alabelIdprop, the id of its text. Renderlabel, then referencelabelIdwitharia-labelledby={labelId}on the control, or on arole="group"wrapper when the widget has several controls. createWidgetwidgets: the builder doesn't show the label, so draw your own inrenderif you want one visible. Thenodepassed tomountis already a group named by the property label. To name a single control after it, copy the reference:
mount(node, value, updateValue) {
var input = node.querySelector('input');
input.setAttribute('aria-labelledby', node.getAttribute('aria-labelledby'));
}
Give icon-only buttons an aria-label. See Create a Custom Tool for the full widget API.
HTML Title Tag for Exported HTML
You can set the HTML <title> tag for exported HTML in three ways, with the following priority order:
1. Export Options (Highest Priority)
You can pass a title when calling exportHtml:
unlayer.exportHtml(
function (data) {
var html = data.html;
},
{
title: 'My Custom Page Title',
},
);
2. Design Body Properties (Medium Priority)
Users can set the HTML <title> tag directly in the editor UI through the Body panel under the Accessibility section. This allows non-technical users to configure the title without code changes.
3. Editor Configuration (Lowest Priority)
If no title is specified in the export options or the body properties, the title from the editor configuration will be used:
unlayer.init({
editor: {
title: 'Default Page Title',
},
});
This fallback ensures that there's always a <title> tag value available for the exported HTML.