Guide · Agent skill
How to use the SnapDOM agent skill to capture HTML as images
Updated · written with AI from the project's own documentation and checked against our catalogue data
The snapdom skill gives an AI agent a working reference for SnapDOM, a JavaScript library that captures an HTML element on a web page and converts it into an image. This guide explains what the skill does, how to install it from a ZIP or the Claude apps, how to phrase requests that trigger it, and what to check before using the output. By the end you will know how to get the agent to write capture code for your own page.
Quick start
- 1Download and unzip the skill. Download the snapdom ZIP from this page and unzip it so you have a snapdom folder containing SKILL.md.
- 2Place it in the skills folder. Move the folder to ~/.claude/skills/ for personal use, or to .claude/skills/ inside a project to limit it to that project.
- 3Or upload it in the Claude apps. In the Claude apps, open Settings, go to Capabilities, then Skills, and upload the snapdom skill.
- 4Install the library in your project. Run npm install @zumer/snapdom or yarn add @zumer/snapdom, or load the library from unpkg with a script tag.
- 5Ask for a specific capture. Describe the element, the output format and any options, such as a selector to exclude, in plain language.
- 6Run and check the output. Run the generated code in a browser, then check fonts, images and shadows in the exported file before you rely on it.
What the snapdom skill makes the agent do
Once installed, the agent knows how to write JavaScript that takes a snapshot of an HTML element and converts it into an image file. The supported output formats are SVG, PNG, JPG and WebP. The skill says the capture keeps styles, embedded fonts and pseudo-elements such as ::before and ::after.
The agent can also trigger a download of the result and apply common options such as scaling, excluding elements, and using a CORS proxy for blocked images. The skill is a reference guide for the snapdom library, so the agent writes code that uses it. It does not take screenshots itself.
- Exports SVG, PNG, JPG and WebP, plus a raw canvas or blob if you need further processing
- Keeps fonts, icon fonts, pseudo-elements, transforms and shadows, according to the skill
- Offers options for scale, custom width and height, excluding selectors and a CORS proxy
Install the snapdom skill from a ZIP file
Download the snapdom ZIP from the skill's page on this directory and unzip it. The skill folder contains SKILL.md, plus references/index.md and references/other.md.
For a personal install, place the unzipped skill folder in ~/.claude/skills/. To limit it to one project, place it in that project's .claude/skills/ folder instead. Restart or reopen your agent session if it does not pick up the new skill straight away.
- Personal: ~/.claude/skills/snapdom
- Project only: .claude/skills/snapdom inside your project folder
Upload the skill in the Claude apps
If you use the Claude apps rather than a local folder, you can upload the skill instead. Open Settings, go to Capabilities, then go to Skills and add the snapdom skill from the ZIP you downloaded.
The skill does not need a separate install of its own. The library it documents is installed in your web project, as described in the next section.
Install the snapdom library in your web project
The skill tells the agent how to use snapdom, but the library must be available to the page that runs the code. The skill lists two routes: install the @zumer/snapdom package with npm or yarn, or load the library from a CDN such as unpkg.
Use the npm or yarn route for a build-based project. Use a CDN script tag when you have no build step, for example a single HTML page.
- npm: npm install @zumer/snapdom
- yarn: yarn add @zumer/snapdom
- CDN ES module: import from https://unpkg.com/@zumer/snapdom/dist/snapdom.mjs
- CDN UMD: script tag pointing to https://unpkg.com/@zumer/snapdom/dist/snapdom.umd.js
npm install @zumer/snapdomHow to trigger the skill with natural requests
You do not need special syntax. Describe the capture you want in plain language, and mention the element, the output format and any options. The skill is most useful for requests about rendered web page content inside JavaScript.
Good requests name a target such as a CSS selector or a component, a format, and what to leave out. Vague requests such as 'screenshot my app' point to something this skill does not do, because it only works inside a web page's JavaScript.
- Write JavaScript that saves the #report-card element as a PNG with 2x scale.
- Add a button that downloads the .share-card section as an SVG file.
- Export the pricing table as a JPG and hide anything with the class .controls.
- Capture the chart container at 1200 by 630 for a social share image.
Options the agent can use
The skill documents a set of options passed to the capture call. The agent will usually pick the ones that match your request. You can also ask for a specific option by name.
- scale: multiplies output resolution, for example 2 for double resolution
- width and height: set a custom output size in pixels
- embedFonts: includes non-icon @font-face rules so custom fonts appear
- useProxy: enables a CORS proxy, either a URL you supply or true for the default
- exclude: a CSS selector for elements to hide during capture
- straighten: removes translate and rotate transforms
- noShadows: strips shadow effects
const result = await snapdom(element, { scale: 2, embedFonts: true, exclude: '.no-capture' });
const png = await result.toPng({ quality: 0.95 });Safety notes: scripts, network and CORS proxies
This skill does not run scripts. Its code-generating role means the agent writes JavaScript for your project, and you run that code in your own browser environment. Review the generated code before you ship it.
The skill does use the network. The library is loaded from npm or from a CDN such as unpkg, and the useProxy option sends blocked asset requests through a proxy URL. If your project cannot load third-party scripts, or your images are sensitive, do not use the CDN route or the proxy without checking where the data goes.
- Runs scripts: no, according to the skill metadata
- Uses network: yes, for loading the library and for the optional CORS proxy
- Use a proxy URL you control rather than a public one when images contain private data
Tips for better results
The skill's own tips are practical. Prefer scale over setting width and height when you only need a sharper image. Set embedFonts to true when custom or Google fonts are missing from the output. Use SVG for charts and graphics, and PNG or JPG for photo-like content.
If a capture fails, check that the element has real width and height, that CSS and fonts have loaded before the call, and that the browser console shows no font or image errors. For very large pages, the skill suggests splitting the capture into smaller sections.
- Use scale instead of width and height for better performance
- Set embedFonts: true for custom fonts
- Use useProxy when images fail to load
- Lower scale or set noShadows: true if rendering is slow
- Break large captures into smaller chunks
What people use it for
- Generating a PNG share card for a report or dashboard section in a web app
- Letting users download a chart as an SVG file from a page
- Exporting a pricing table or invoice section as a JPG while hiding buttons with an exclude selector
- Creating a fixed 1200 by 630 image of a component for a social preview
Frequently asked questions
How do I install the snapdom skill?
Download the snapdom ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps you can instead upload it under Settings, then Capabilities, then Skills.
Is the snapdom skill free?
The skill is released under the MIT licence, as shown on this page. The page does not list any price, so check the repository for the full licence text before you use it commercially.
What do I need to use snapdom?
You need a web browser environment with JavaScript, and either npm or yarn or a CDN link to install the @zumer/snapdom package. The skill only works inside a web page's JavaScript, so it cannot capture your whole screen.
Does snapdom work with html2canvas alternatives?
The skill describes snapdom as a dependency-free alternative to html2canvas. The skill's performance claims come from the project itself and were not independently verified here, so test on your own pages. The project also lists html2canvas as an alternative that is slower but more compatible.
Why are my images or fonts missing from the capture?
For missing fonts, set embedFonts to true and make sure fonts have loaded before you call snapdom. For blocked images, set useProxy to true or supply a custom proxy URL, then check the browser console for errors.
Can the agent take a screenshot of my desktop?
No. The skill covers capturing HTML elements inside a web page with JavaScript, and it does not run scripts itself. For screen capture, use a tool built for that purpose.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use the snapdom skill if you are a front-end developer or a web app team that needs image or SVG exports of rendered page sections, and you are comfortable reviewing the code an agent writes. Pick another option if you need a plain screenshot of your screen, if your project cannot load third-party scripts from npm or a CDN, or if you need pixel-perfect output on complex pages without testing it first.
Download the skill