The template prop is a “load this” signal
It is the initial document plus a way to open a different one. Passing an object the editor did not last
emit reloads it; passing back what you received from onChange does nothing. That is what makes
the controlled-looking pattern above safe, and it means “open template” needs no remount and no key trick.
The ref is the whole imperative API
getTemplate(), setTemplate(), setTheme(), setMode(),
undo(), redo(), validate(), exportPdf(),
print(), getLayout(), registerBlock() — available from the first
render after mount, which is what lets you build a toolbar of your own instead of using ours.
Give the wrapper a height
The editor fills its container. It is a three-column grid — palette, canvas, inspector — and below about
820 px it becomes a different layout, with the side panels as drawers over the canvas. It measures its
own root element to decide, not the window, because an embedded designer in a narrow pane of a wide page is
the same problem as a phone.
Feature flags narrow it for non-developers
features turns parts of the designer off: expressions: false hides free-form
expression editing, pageSettings, jsonView and styleOverrides come
off for an audience who should not meet them, and whiteLabel: true removes the BroadPaper mark
from the toolbar. A computed value stays readable when expressions are hidden — it is named after the fields
it reads rather than shown as source.
React 18 and 19, as a peer
The package uses the React your application already has. Note one React 19 consequence if you extend the
editor: ref became an ordinary prop, so anything merging refs has to merge rather than
overwrite.
Next.js: client component, and a webpack flag
The designer mounts into a DOM element, so it belongs behind
dynamic(() => import("./Editor"), { ssr: false }). If you also render PDFs in the
browser, webpack needs experiments.asyncWebAssembly and the @broadpaper/forme
import has to stay out of anything that renders on the server.