Build validation checks deck data, HTML, links, and local assets. Fit inspection opens the rendered deck in Chromium and checks every active slide in presentation mode at the sizes you choose. It reports overflow, content clipped by hidden containers, and images that fail to load.
Set up the optional browser tool
In the site app:
npm i -D playwright
npx playwright install chromium
npm run build
npm run preview
Leave the built preview running. In another terminal, inspect the deck URLs:
npx slidepig inspect http://localhost:8787/pitch
npx slidepig inspect http://localhost:8787/pitch http://localhost:8787/update \
--viewport 1440x810 --viewport 1024x768 \
--screenshots artifacts/fit --json
Use the port printed by your preview command. For the public monorepo example:
pnpm --filter slidepig-example-workspace-site build
pnpm --filter slidepig-example-workspace-site preview
# In a second terminal:
pnpm --filter slidepig-example-workspace-site exec slidepig inspect \
http://localhost:4921/partner-pitch http://localhost:4921/team-update
The default viewport is 1440 × 810. Repeat --viewport to check several sizes.
--browser chrome or --browser msedge uses an installed browser instead of
Playwright's Chromium. Playwright documents these
browser channels.
The command exits nonzero if a slide fails or a page cannot be inspected.
--json prints a machine-readable report with each URL, slide ID, viewport,
issues, and optional screenshot path. Screenshots contain the viewport where
the problem occurs; they are saved only for failing slides. Add your chosen
artifacts directory to .gitignore if you do not want to commit it.
Pass deck pages directly, including unlisted URLs. A page containing more
than one embedded deck can select one with --selector '.my-deck'. Inspection
requires the standard <Deck> presentation controls and slide attributes.
It supports custom layouts and React visuals inside that deck.
What is measured
The inspector activates the real presentation controller, visits every slide, waits for fonts and images, and measures the visible content at the requested viewport. It does not estimate presentation fit from reading-mode heights or silently shrink text. A one-pixel tolerance avoids subpixel rounding noise.
Bounded areas with overflow: auto or overflow: scroll are treated as
deliberately scrollable; their outer box must fit, but their scrollable contents
may exceed it. Hidden or clipped containers are reported when they cut content.
Image cropping, decorative SVG internals, hidden content, and the visual tuner
are excluded from content measurements.
Use a built preview so hot reload does not interrupt inspection. A fit report checks geometry and asset loading, not the quality of a composition, contrast, or the correctness of its copy. Check the failure screenshots and inspect any custom interaction states that a slide opens only after a click.
Use from a script
slidepig/inspect is a Node-only entry; it loads Playwright only when called.
Browser entries never import it.
import { inspectDecks } from "slidepig/inspect";
const report = await inspectDecks(["http://localhost:8787/pitch"], {
viewports: [{ width: 1440, height: 810 }],
screenshots: "artifacts/fit",
});
if (report.errors.length || report.slides.some((slide) => !slide.fits)) {
process.exitCode = 1;
}