Getting started
This page takes a web app from nothing to framed README images and a table to paste into the README.
Electron, Tauri and terminal apps use the same commands with a different target; their guides are
linked at the end.
Prerequisites
Section titled “Prerequisites”- Node 22 or newer. A
showcase.config.tsneeds Node 22.18 or newer (the kit imports it with Node’s built-in type stripping); ashowcase.config.mjsworks on any Node 22. - Playwright 1.50 or newer and its Chromium. Playwright is a peer dependency, so the kit uses the
same Playwright, and the same downloaded browser, as your end to end tests if you have them. To skip
the download, set
browser: { channel: 'chrome' }(or'msedge') in the config and the kit launches the installed browser instead. - Terminal apps only: the optional peer
@lydell/node-pty. Web projects never load it. See Terminal apps.
Install
Section titled “Install”npm install --save-dev @noctcore/showcase-kit playwrightnpx playwright install chromiumpnpm add -D @noctcore/showcase-kit playwrightpnpm exec playwright install chromiumbun add -d @noctcore/showcase-kit playwrightbunx playwright install chromiumThe CLI is called showcase. The commands below use npx showcase; pnpm exec showcase and
bunx showcase run the same thing (bunx runs it with Node).
Your first images
Section titled “Your first images”-
Write a starter config. From the directory that holds your app’s
package.json:Terminal window npx showcase initThis writes
showcase.config.mjs(pass--tsforshowcase.config.ts, or--ttyto start from a terminal app config). It takes the app name frompackage.jsonand the start command from itsdev:web,devorstartscript, run with the package manager whose lockfile it finds. It refuses to overwrite an existing config unless you pass--force. -
Point the target at your app and list the views. The starter captures one view,
home, athttp://localhost:5173. Changeurlto where your dev server listens, setreadyto a selector that only exists once the app has booted, and add a shot for each view worth showing:showcase.config.mjs import { defineConfig } from '@noctcore/showcase-kit';export default defineConfig({name: 'My App',target: {mode: 'url',url: 'http://localhost:3000',start: 'pnpm dev',},ready: '[data-testid="app-ready"]',// viewport, deviceScaleFactor, colorScheme, langs, frame, outputs: as init wrote themshots: [{ id: 'home', title: 'Home', caption: 'The home screen.', nav: '/' },{ id: 'settings', title: 'Settings', nav: '/settings', waitFor: 'form' },],});navis how the kit gets to a view: a path to visit, a selector to click, or a function. The web apps guide covers every form, and the config is checked before anything runs, so a typo in a key name is an error, not a silent default. -
Run everything.
Terminal window npx showcase allThe kit runs
start(or reuses the app ifurlalready answers), waits forready, captures each shot, frames the captures, exports the portfolio images ifoutputs.portfoliois set, and stops the dev server it started. A failed shot does not stop the others: they are still captured, then the run lists every failure, skips the later steps and exits with code 1. -
Print the README table.
Terminal window npx showcase readmeIt prints an HTML table of the framed images with their captions (
--layoutpicks one of four other arrangements). Paste it into your README, or redirect it to a file: the table goes to standard output and warnings to standard error.
Where the files land
Section titled “Where the files land”With the starter’s outputs, one language and the two shots above:
- showcase.config.mjs
Directoryshowcase-out/ add this to .gitignore
Directoryraw/
Directoryen/
- home.png raw capture, 2880x1800
- settings.png
Directoryassets/
Directoryshowcase/ commit these
Directoryen/
- home.webp framed, 3168x2168
- settings.webp
The raw captures are the viewport (1440x900) times the device scale factor (2). The framed images add
the title bar and the padding around the window; Frames explains the
size and how to cap it with maxWidth. Relative paths in the config resolve against the config file’s
directory.
Next steps
Section titled “Next steps”Every key is in the config reference, and every command and option in the CLI reference.