snapdom

Convert DOM content into SVG, PNG, JPG, or WebP images.

1|Updated Dec 20, 2025
One-click install
npx skills add https://github.com/anliang0306/VIBE-CODING-CN --skill snapdom-anliang0306
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: snapdom
Source: https://github.com/anliang0306/VIBE-CODING-CN/tree/main/i18n/zh/skills/snapdom
Command: npx skills add https://github.com/anliang0306/VIBE-CODING-CN --skill snapdom-anliang0306

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SnapDOM addresses the challenge of turning live DOM content into portable, high-fidelity images that can be embedded in docs, previews, or assets.

Core Features & Use Cases

  • SVG/PDF-like exports: Export DOM to SVG or raster formats such as PNG, JPG, WebP.
  • Font and pseudo-element fidelity: Preserve embedded fonts, ::before/::after styles, and text rendering.
  • Wide applicability: Capture styled elements, shadows, and even Shadow DOM; supports iframe origins with proxy fallback.
  • Use cases: Create thumbnails for dashboards, documentation screenshots, or design mockups.

Quick Start

Install the library and perform a capture. Use npm install @zumer/snapdom and then in code: const result = await snapdom(document.querySelector('#target'));

Frequently Asked Questions about snapdom

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert DOM elements to SVG or PNG images?

To convert DOM elements to SVG or PNG images, use a DOM capture library that serializes styled elements, pseudo-elements, and embedded fonts into scalable SVG or raster formats like PNG, JPG, and WebP.

Does DOM to image conversion preserve CSS pseudo-elements and custom fonts?

DOM to image conversion can preserve CSS pseudo-elements and custom fonts by serializing embedded styles and ::before/::after pseudo-elements during capture, ensuring high-fidelity text rendering and visual accuracy.

Can I capture Shadow DOM content into an image?

Yes, you can capture Shadow DOM content into an image using DOM serialization tools that traverse shadow boundaries to extract and render enclosed styled elements into SVG or raster formats.

What is the best way to capture styled DOM elements for documentation screenshots?

The best way to capture styled DOM elements for documentation screenshots is using a DOM-to-image tool that exports elements while preserving embedded fonts, shadows, and pseudo-element styles into portable image assets.

How do I capture DOM from a different iframe origin?

To capture DOM from a different iframe origin, configure your DOM capture tool to use a proxy fallback mechanism, allowing the serialization process to bypass cross-origin restrictions and render the iframe content.