Install
Search for “Forme PDF Preview” in the VS Code Extensions view, or install from the Marketplace.Preview
Open a Forme template and run Forme: Preview or Forme: Preview to Side from the Command Palette. The extension previews every framework Forme supports, identically — same component tree, inspector, and overlays:- React / Preact — a
.tsx/.jsxfile importing@formepdf/reactor@formepdf/preact - Svelte — a
.sveltefile importing@formepdf/svelte - Vue — a
.vuefile importing@formepdf/vue - Python — a
.pyscript that writes PDF bytes to stdout - HTML — any
.htmldocument (run the command once to opt in)
npm install svelte, vue, etc.) and previewing just works.
The preview updates automatically when you save. Toggle debug overlays (layout, margins, breaks) from the toolbar.
Component Tree
The sidebar shows a tree of every element on every page. Hover over a tree node to highlight the corresponding element on the canvas. Click to select it and open the inspector. Click an element directly on the canvas to select it in the tree and inspector.Inspector
The inspector panel shows:- Box model diagram with margin, border, and padding values
- Computed styles grouped by category (sizing, spacing, typography, background, etc.)
- Open in Editor button to jump to the source location
- Copy Style button to copy the element’s style as a JSX object
Auto-Open
Enableforme.autoOpen in VS Code settings to automatically open the preview when you open a Forme template file.