Unlayer Documentation

Unlayer Documentation

Welcome to Unlayer Documentation. It takes less than 5 minutes to get our editor up and running on your project.

These guides will take you through the process and get you up and running.

Get Started    Changelog

Installation

This page will help you get started with Unlayer. You'll be up and running in a jiffy!

Add JavaScript Library

The first step is to add the following JavaScript library to your web app. This will load all the required assets for you to initialize the editor.

<script src="//editor.unlayer.com/embed.js"></script>

If you are using React.js, use our React Component available on NPM.


Initialize Editor

The Unlayer editor needs a container HTML element on your page to be rendered inside. Let's add a blank div first.

<div id="editor-container"></div>

Recommended Size

It is recommended that the container has a minimum width of 1024px and minimum height of 700px. The editor is designed to be fluid and will take full width and height of the container.

Now, we'll initialize the editor in the blank div above by passing it's id.

unlayer.init({
  id: 'editor-container',
  projectId: 1234,
  displayMode: 'email'
})
Attribute
Type
Required

id

String

Yes

This is the HTML div id of the container where the editor will be embedded.

displayMode

String

No

This is the template display mode which can be email or web. Default value is web.

projectId

Integer

No

This is the project ID from Unlayer. You can get it from the project settings page.