Skip to main content
Version: Latest

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​

KeyAction
Up / Down, Home / EndMove between the panel's tabs (Content, Blocks, Body, and others).
Enter or Space on a tabOpen the tab.
Enter on a tool, block, row or image tileInsert 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 tileStart 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.

KeyAction
Up / DownMove to the previous or next layer.
Right / LeftMove into a row's columns or a column's content, or back out to its parent.
Home / EndMove to the first or last layer.
Enter or SpaceSelect the layer and open its properties. On a column, select its row with that column's settings open.
Enter or F2 on a selected layerEdit its text. A table starts in its first cell.
EscapeDeselect the layer.
Tab / Shift+TabMove 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 handlePick 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​

KeyAction
Tab / Shift+TabIndent 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+F10Move to the text formatting toolbar. Escape returns to the text.
Escape or F2Stop 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​

KeyAction
Left / RightMove between device tabs (Desktop, Tablet, Mobile) and column tabs. Enter opens a tab.
EscapeClose 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​

KeyAction
] / [Select the next or previous object on the image (text, shape, sticker).
Arrow keysMove the selected object by 1 px, or by 10 px with Shift.
DeleteRemove the selected object.
EnterEdit the selected text.
EscapeDeselect 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​

KeyAction
Arrow keys on an attached imageMove it earlier or later among the images attached to the prompt.
Enter on an attached imageAdd it to the design, after the layer you are on in the canvas.
+ / - / 0 in an image previewZoom in, zoom out, or reset the zoom.
Arrow keys in a zoomed previewMove around the image.
Escape in an image previewClose 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 label prop, the property's label to show, and a labelId prop, the id of its text. Render label, then reference labelId with aria-labelledby={labelId} on the control, or on a role="group" wrapper when the widget has several controls.
  • createWidget widgets: the builder doesn't show the label, so draw your own in render if you want one visible. The node passed to mount is 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.