Skip to main content
Live Preview renders your front-end application directly within the Admin Panel. As you type, changes appear without saving a draft or publishing. It works with both server-side and client-side frontends. The preview window loads your application in an iframe. The Admin Panel sends document changes through window.postMessage, and the application re-renders with the data it receives. Configure Live Preview with admin.livePreview in your FrogBot config:
You can instead define admin.livePreview on an individual collection. Collection settings override root settings.

Options

Once configured, a Live Preview button appears at the top of enabled documents. A collection is enabled when its slug is in the root collections list or when it sets its own admin.livePreview. Its options are merged key by key over the root options, so a collection can override only breakpoints and keep the root url.

URL

The url property determines the iframe location. Use a function when it depends on the document, locale, or collection. The function runs on the server when a saved document opens and again after each save, including autosaves, so avoid expensive work inside it.
The function can return an absolute or relative URL. Relative URLs use the protocol, domain, and port from the browser window.
Return undefined or null to disable Live Preview for a request or document:

Breakpoints

Breakpoints provide device sizes in the preview toolbar. Selecting one resizes the iframe to its configured dimensions.
The Responsive option is always available and fills the available area. Editors can also enter custom dimensions or open the preview in a separate resizable window.
A preview page that does not use a Live Preview hook or refresh component will load in the iframe but will not update as the document changes.