Show HN: I created snapDOM to capture DOM nodes as images with exceptional speed
a year ago
- #DOM capture
- #SVG conversion
- #web development
- snapDOM is a high-fidelity DOM capture tool that converts HTML elements into scalable SVG images.
- Preserves styles, fonts, backgrounds, shadow DOM content, and pseudo-elements.
- Supports export to SVG, PNG, JPG, WebP, or canvas.
- Lightweight with no dependencies and based on standard Web APIs.
- Can be included via CDN, script tag, or as a module.
- Offers multiple capture methods like snapdom(el), snapdom.toPng(el), etc.
- Captures shadow DOM, pseudo-elements, backgrounds, and fonts.
- Supports exclusion and placeholder attributes for elements.
- External images must be CORS-accessible; fonts must be loaded before capturing.
- Outperforms other libraries in speed, especially for larger DOM structures.