.designjs.json in your project directory. This file is the complete, self-contained representation of your design — the component tree, all styles, and any CSS variables you’ve defined. It’s plain JSON, human-readable, and designed from the start to live in your git repository alongside your application code.
What gets saved
The.designjs.json file contains two top-level sections:
GrapesJS project data — the component tree and all associated styles, serialized by GrapesJS into its standard project format. This includes:
- Every component on the canvas with its tag name, CSS classes, attributes, and text content.
- The full nesting hierarchy (children of children, and so on).
- Per-component CSS rules written through the Style panel or via
update_styles.
:root when you reload the canvas.
A minimal example
A canvas with a single<div> containing a heading might produce a file like this:
When saves happen
DesignJS writes to.designjs.json in two ways:
The save status is displayed in the top bar of the editor (
Saving…, Saved, or an error message if the write fails). Both triggers overwrite the file completely — there is no incremental patch format.
Auto-save runs on a 30-second interval from when the canvas finishes loading. If you close the browser tab before 30 seconds have elapsed since your last change, use
Cmd+S to save manually first.Reload and restore
When you reload the canvas (or reopen the browser tab), DesignJS reads.designjs.json at startup and reconstructs the exact state it was in when last saved:
- The GrapesJS project data is loaded, restoring the full component tree.
- The
cssVariablesmap is reapplied to the iframe:root.
Committing to git
The.designjs.json file is designed to be committed. Because it’s plain JSON with a stable structure, git can diff it meaningfully:
What is not saved
The file does not contain:- Selection state — whatever is selected in the editor is not persisted. After a reload, nothing is selected by default.
- Editor UI state — panel sizes, scroll positions, and zoom level are not saved.
- Assets — the
assetsarray in the GrapesJS project data is present but image uploads are not yet supported in v0.1. External image URLs referenced in your HTML are preserved as-is.
CSS variables via the agent
If your agent callsset_variables, the changes are saved to .designjs.json under the cssVariables key at the next auto-save or manual save. The variables take effect immediately in the iframe without a save, but they won’t survive a reload until the file is written. To force an immediate save from the editor, press Cmd+S after the agent updates variables.