SnapDOMGitHub8K
zumerlab/snapdom

Extend SnapDOM

Add HTML, context for agents, PDF and recordings to SnapDOM. Transform captures with filters, timestamps and input redaction, or build your own plugin.

Mr. SnapDOM holding a plugin puzzle piece
SnapDOM Pro · Launch offer

PDF & Vector. 50% off your first year.

PDF Pro adds selectable, searchable text and pagination. Vector exports editable shapes and text for SVG and Figma. Each is a separate paid plugin.

From $19.50 for the first year, then $39/year. First 30 purchases across both plugins. Ends , or when sold out.

Source element

Hello SnapDOM

Captured with plugins in real time

🚀🧠🖼️🎛️🧪 💡🧩📦🧭⚙️🛡️
docs Live content

Plugins (combine freely)

filter
timestamp-overlay
replace-text
ascii-export
pdf-image

Captured output

Select plugins and click Capture

Generated code

// Select plugins to see the code
Back to top
Install · Install instructions
Install core
npm i @zumer/snapdom@latest
Install plugins
npm i @zumer/snapdom-plugins@latest
CDN (no install)
<script type="importmap"> { "imports": {   "@zumer/snapdom":     "https://unpkg.com/@zumer/snapdom@latest/dist/snapdom.mjs" } } </script> <script type="module">   import { snapdom } from '@zumer/snapdom';   import { filter } from     'https://esm.sh/@zumer/snapdom-plugins@latest/filter?external=@zumer/snapdom'; </script>

Use matching core and plugin versions. The import map lets recording plugins share the same core runtime.

Usage example
import { snapdom } from '@zumer/snapdom';
import { filter } from '@zumer/snapdom-plugins/filter';
import { timestampOverlay } from '@zumer/snapdom-plugins/timestamp-overlay';

const result = await snapdom(element, {
  plugins: [filter({ preset: 'grayscale' }), timestampOverlay()]
});
const png = await result.toPng();
Back to top
Official — @zumer/snapdom-plugins
T
transform

timestamp-overlay

Adds a timestamp to the capture, with configurable date formats and positions.

afterClone
F
transform

filter

Applies CSS filters to the capture, using presets or a custom filter string.

afterClone
R
transform

replace-text

Replaces text in the capture using strings or regular expressions.

afterClone
C
transform

color-tint

Tints the capture with a color overlay. Set the color and opacity.

afterClone
A
export

ascii-export

Converts the capture to ASCII art with toAscii(). Set the width, character set and contrast direction.

defineExports
D
export

pdf-image

Exports the capture as a JPEG embedded in a downloadable PDF, in portrait or landscape.

defineExports
A
export

agent-map

Returns an annotated image and a map of interactive elements, with names, roles and bounding boxes.

afterClonedefineExports
C
export

context-export

Exports a text outline or JSON tree with text, roles, states and optional bounding boxes.

beforeClonedefineExports
R
transform

redact-inputs

Masks fields, hides private blocks and removes named attributes from images, HTML and structured exports.

beforeSnapafterClonebeforeRender*
M
export

html-export

Exports a self-contained HTML snapshot with styles, fonts and images inlined.

afterRenderdefineExports
G
export

gif-export

Records the live element frame by frame and returns an animated GIF with toGif().

defineExports
V
export

video-export

Records the live element with toMp4(). The browser selects a supported MP4 or WebM format.

defineExports
Community Plugins & Integrations

Built something with SnapDOM? Tag your repo with the snapdom-plugin GitHub topic to make it discoverable, then open a PR to list it here.

+
yours here

Your Plugin

Build a plugin and add it here. Just open a PR adding one line to community-plugins.md.

Build a plugin

Use lifecycle hooks to transform captures and register custom exporters. Start with the template and the plugin specification.

01
npx degit zumerlab/snapdom/packages/plugin-template my-plugin
Clone the template
02
export function myPlugin() {}
Write your hook logic
03
Add a line to community-plugins.md
Open a PR to get listed