Skip to main content
Version: 1.339.0

Accessibility

This feature enables developers to configure and manage accessibility options in the builder. With this API, you can define a custom iframe title for the builder and specify a custom title for the exported HTML.

Editor Configuration​

unlayer.init({
editor: {
title: 'Editor Iframe Title',
},
});

In this example, the builder iframe title is set to "Editor Iframe Title".

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.