Skip to content

Playwright / TypeScript / MIT

Same pixels, every run.

One config file describes your app and the views worth showing. The showcase CLI captures them, frames them and exports README images, portfolio images and a banner.

pnpm add -D @noctcore/showcase-kit playwright
The route from a config to README images: capture, frame and export. Running animations and half-drawn screens stop at capture.The route from a config to README images: capture, frame and export. Running animations and half-drawn screens stop at capture.
Nightjar's Tonight view framed for a README: a dark window with traffic lights and a soft shadow on a teal to indigo gradient.
The same view as the raw capture: the app's pixels with no frame or background.
raw/en/tonight.pngassets/showcase/en/tonight.webp
Drag to compare. Left: what showcase capture wrote. Right: whatshowcase frame made of it.

Every command writes files you can check in.

showcase all runs capture, frame, then the portfolio export when it is configured, then the clips when there are any. The README snippet, the hero banner and the icons are their own commands.

  1. showcase capture, see the Raw captures guide

    Drives the app with Playwright and screenshots every shot in every UI language, pixel exact at a fixed viewport and device scale factor.

    showcase-out/raw/en/tonight.png
  2. showcase frame, see the Frames guide

    Puts each capture in a window, browser or terminal frame on a solid, gradient, mesh, dotted, grainy or transparent background, as WebP or PNG.

    assets/showcase/en/tonight.webp
  3. showcase readme, see the README table guide

    Prints the framed images with captions as HTML to paste into a README: a table, rows, a featured image, collapsible details or a list.

    stdout
  4. showcase portfolio, see the Portfolio guide

    Exact-size 16:9 images with the framed window contained, never cropped, plus a thumbnail and a gallery JSON for your site.

    <dir>/tonight.webp
  5. showcase hero, see the Hero banner guide

    A banner with your logo, name, tagline and framed shots in one of six layouts, 1280x640 by default.

    assets/showcase/hero.webp
  6. showcase record, see the Clips guide

    Short animated WebP and GIF recordings of a terminal app (MP4 opt-in), framed like the stills.

    assets/showcase/en/tour.webp
  7. showcase icons, see the Icons guide

    Web, Electron or Tauri icon sets (PNG, .ico, .icns) from one square image. Needs no config.

    icons/favicon.ico

What stops at capture.

Before every shutter the kit settles the page, so two runs of the same app state write the same file. Your part is stable data: a fixture mode, so dates and counters stay put, and a ready selector that only matches once the app has rendered.

  • motionprefers-reduced-motion is set to reduce for every capture
    web
  • running animationsfinite ones finished, infinite ones reset at the shutter
    web
  • transitions and the carettransitions set to zero, the caret hidden
    web
  • fonts still loadingwaits for document.fonts.ready and two painted frames
    web
  • half-drawn screenwaits until the screen is unchanged for 100 ms
    tty
  • machine differencesa fixed size and a bundled font, TZ=UTC, and an en_US.UTF-8 locale on macOS and Linux
    tty

Web, Electron, terminal and Tauri apps.

  • url
    Web apps. Starts your dev server, or uses a URL that is already up, in headless Chromium.
  • cdp
    Electron. Attaches to the running app over the Chrome DevTools Protocol.
  • tty
    Terminal apps. Runs a TUI or a CLI in a pseudo terminal with a pinned size, font and environment. Records clips too.
  • tauri
    Tauri. The web build in url mode on any OS, or WebView2 over CDP on Windows.
The nightjar queue demo TUI in the terminal frame, the tab bar in the same color as the terminal screen: imaging targets with their progress, one selected, and its details.
tty the gallery's demo TUI, framed with style: 'terminal'

One capture, every size it ships in.

Nightjar's Tonight view in the window frame on the default gradient.
README image1600 x 1009 WebP
Nightjar's Log view as a 16:9 portfolio image, the window contained in the frame.
Portfolio image1600 x 900, plus a thumbnail and a gallery JSON
An animated recording of the nightjar queue: the selection moves down the list, then the log opens.
Terminal clipAnimated WebP and GIF

Six hero layouts, six frame styles, six kinds of background and five README layouts, all shown in the gallery with the config that made each. Four of the hero layouts, for Nightjar, the fixture app behind it:

Is this for you?

Yes, if

  • You keep screenshots of an app in a README or a portfolio and retake them by hand every time the UI changes.
  • Your app runs in a browser, in Electron or in a terminal. The kit drives it with Playwright: a web app in headless Chromium (a dev server it starts for you, or a URL that is already up), an Electron app over the Chrome DevTools Protocol, or a terminal app (a TUI or a CLI) in a pseudo terminal.
  • You have Node 22 or newer and Playwright's Chromium.

Probably not, if

  • Your app is a native desktop app that is neither a web view nor a terminal (Qt, SwiftUI, WinForms): there is nothing for the kit to attach to.
  • It is Tauri on macOS or Linux and you need the real window: neither has the DevTools Protocol, so there you capture the app's web build instead (Tauri explains the trade-off).
  • Every run shows new data. The kit cannot make a changing app look the same twice on its own: the images change with it until you give the app a fixture mode.
  • You want animated recordings of a web app: clips are for terminal apps only, so far.

A minimal config.

npx showcase all starts pnpm dev, waits for the page, captures both views at 1440x900 and device scale factor 2, writes the framed images to assets/showcase/en/, and stops the dev server again.

Getting started walks through it from the install.

showcase.config.mjs
import { defineConfig } from '@noctcore/showcase-kit';
export default defineConfig({
name: 'My App',
target: { mode: 'url', url: 'http://localhost:5173', start: 'pnpm dev' },
ready: '#root > *',
shots: [
{ id: 'dashboard', title: 'Dashboard', nav: '/' },
{ id: 'reports', title: 'Reports', nav: '/reports', waitFor: '[data-testid="chart"]' },
],
});

How these docs are built

The guides are written by hand, and what they say the kit does is checked against the library's source. The reference pages are generated from that source, and the changelog is generated from the repository's CHANGELOG.md, so a release shows up here without anyone editing a page.

Write the config once. Rerun it when the UI changes.