2025emma/vibe-coding-cn/snapdom
Claude Code and agent skill by 2025emma/vibe-coding-cn
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install 2025emma/vibe-coding-cn/snapdomSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
TRANSLATED CONTENT:
name: snapdom description: snapDOM is a fast, accurate DOM-to-image capture tool that converts HTML elements into scalable SVG images. Use for capturing HTML elements, converting DOM to images (SVG, PNG, JPG, WebP), preserving styles, fonts, and pseudo-elements.
SnapDOM Skill
Fast, dependency-free DOM-to-image capture library for converting HTML elements into scalable SVG or raster image formats.
When to Use This Skill
Use SnapDOM when you need to:
- Convert HTML elements to images (SVG, PNG, JPG, WebP)
- Capture styled DOM with pseudo-elements and shadows
- Export elements with embedded fonts and icons
- Create screenshots with custom dimensions or scaling
- Handle CORS-blocked resources using proxy fallback
- Implement custom rendering pipelines with plugins
- Optimize performance on large or complex elements
Key Features
Universal Export Options
- SVG - Scalable vector format, embeds all styles
- PNG, JPG, WebP - Raster formats with configurable quality
- Canvas - Get raw Canvas element for further processing
- Blob - Raw binary data for custom handling
Performance
- Ultra-fast capture (1.6ms for small elements, ~171ms for 4000×2000)
- No dependencies - Uses standard Web APIs only
- Outperforms html2canvas by 10-40x on complex elements
Style Support
- Embedded fonts (including icon fonts)
- CSS pseudo-elements (::before, ::after)
- CSS counters
- CSS line-clamp
- Transform and shadow effects
- Shadow DOM content
Advanced Capabilities
- Same-origin iframe support
- CORS proxy fallback for blocked assets
- Plugin system for custom transformations
- Straighten transforms (remove rotate/translate)
- Selective element exclusion
- Tight bounding box calculation
Installation
NPM/Yarn
CDN (ES Module)
CDN (UMD)
Quick Start Examples
Basic Reusable Capture
One-Step Export
Download Element
With Options
Essential Options Reference
| Option | Type | Purpose | ||
|---|---|---|---|---|
scale | Number | Scale output (e.g., 2 for 2x resolution) | ||
width | Number | Custom output width in pixels | ||
height | Number | Custom output height in pixels | ||
embedFonts | Boolean | Include non-icon @font-face rules | ||
useProxy | String\ | Boolean | Enable CORS proxy (URL or true for default) | |
exclude | String | CSS selector for elements to hide | ||
straighten | Boolean | Remove translate/rotate transforms | ||
noShadows | Boolean | Strip shadow effects |
Common Patterns
Responsive Screenshots
Exclude Elements
Fixed Dimensions
CORS Handling
Plugin System (Beta)
Performance Comparison
SnapDOM significantly outperforms html2canvas:
| Scenario | SnapDOM | html2canvas | Improvement | |
|---|---|---|---|---|
| Small (200×100) | 1.6ms | 68ms | 42x faster | |
| Medium (800×600) | 12ms | 280ms | 23x faster | |
| Large (4000×2000) | 171ms | 1,800ms | 10x faster |
Development
Setup
Build
Testing
Browser Support
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Mobile browsers (iOS Safari 14+, Chrome Mobile)
Resources
Documentation
- Official Website: https://snapdom.dev/
- GitHub Repository: https://github.com/zumerlab/snapdom
- NPM Package: https://www.npmjs.com/package/@zumer/snapdom
- License: MIT
scripts/
Add helper scripts here for automation, e.g.:
batch-screenshot.js- Capture multiple elementspdf-export.js- Convert snapshots to PDFcompare-outputs.js- Compare SVG vs PNG quality
assets/
Add templates and examples:
- HTML templates for common capture scenarios
- CSS frameworks pre-configured with snapdom
- Boilerplate projects integrating snapdom
Related Tools
- html2canvas - Alternative DOM capture (slower but more compatible)
- Orbit CSS Toolkit - Companion toolkit by Zumerlab (https://github.com/zumerlab/orbit)
Tips & Best Practices
- Performance: Use
scaleinstead ofwidth/heightfor better performance - Fonts: Set
embedFonts: trueto ensure custom fonts appear correctly - CORS Issues: Use
useProxy: trueif images fail to load - Large Elements: Break into smaller chunks for complex pages
- Quality: For PNG/JPG, use
quality: 0.95for best quality - SVG Vectors: Prefer SVG export for charts and graphics
Troubleshooting
Elements Not Rendering
- Check if element has sufficient height/width
- Verify CSS is fully loaded before capture
- Try
straighten: falseif transforms are causing issues
Missing Fonts
- Set
embedFonts: true - Ensure fonts are loaded before calling snapdom
- Check browser console for font loading errors
CORS Issues
- Enable
useProxy: true - Use custom proxy URL if default fails
- Check if resources are from same origin
Performance Issues
- Reduce
scalevalue - Use
noShadows: trueto skip shadow rendering - Consider splitting large captures into smaller sections
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingi18n/en/skills/snapdom/SKILL.md
Popularity
- Repository stars
- 13,651
- Repository forks
- 1,510
- 7-day trend score
- 48
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Mar 2026, 8 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/2025emma/vibe-coding-cn/snapdom)