Recommended Free Tools
For a Nuxt component that a visitor wants to download, render it in the browser with html2canvas after it exists in the DOM, then export the resulting canvas as a PNG. If you need a server- or CI-generated image that reflects real browser layout, use a Chromium-backed screenshot path instead. For a fixed Open Graph card, Satori can be a better fit when its supported layout and CSS are sufficient.
Choose the right way to make the image
“Convert HTML to an image” can mean capturing one component after Nuxt renders it, generating images on a server, or producing a designed social card from data. Those are different jobs. Choose based on where the conversion runs and how faithfully it must reproduce browser layout:
| Need | Approach | What to account for |
|---|---|---|
| A visitor clicks Download for a component already on a Nuxt page | html2canvas in the browser |
It reconstructs an image from DOM and CSS rather than taking a browser screenshot. CSS support and cross-origin assets can affect the result. |
| A server or CI job needs an image of a rendered page | A real browser screenshot, such as the Nuxt OG Image browser provider | Provision Chromium; the Nuxt OG Image guide notes that you may need npx playwright install. |
| A controlled Open Graph or social card from a template | Satori | It renders a supported JSX/HTML/CSS subset to SVG; it is not a full browser layout engine. |
| Optimize image assets already used in a Nuxt page | Nuxt Image / NuxtImg |
This optimizes image URLs and responsive output; it does not rasterize arbitrary HTML. |
Nuxt’s nuxt generate creates HTML files for static hosting, not image files. Static generation alone therefore does not perform HTML-to-image conversion.
Convert a Nuxt component to a PNG with html2canvas
Install the package in your Nuxt project, then call it from a client-side event such as a button click. The example captures a Vue component through a template ref and downloads the result as card.png.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
npm install @html2canvas/html2canvas
<script setup lang="ts">
import html2canvas from '@html2canvas/html2canvas'
import { ref, onMounted } from 'vue'
const card = ref<HTMLElement | null>(null)
const ready = ref(false)
onMounted(() => {
ready.value = true
})
async function downloadPng() {
if (!card.value) return
const canvas = await html2canvas(card.value, {
scale: window.devicePixelRatio,
useCORS: true,
})
const link = document.createElement('a')
link.download = 'card.png'
link.href = canvas.toDataURL('image/png')
link.click()
}
</script>
<template>
<section ref="card" class="card">
<h1>Shareable card</h1>
<p>Rendered by Nuxt in the browser.</p>
</section>
<button :disabled="!ready" @click="downloadPng">Download PNG</button>
</template>
The readiness flag prevents a click before the component has mounted. If your card depends on asynchronous data, wait until that data has arrived and the component has updated before enabling the download. Likewise, make sure its fonts and images have settled; otherwise the captured state can differ from what the visitor sees after loading completes.
What the options do
scale: window.devicePixelRatiorequests a higher-density canvas on displays with a higher device pixel ratio. Check the output at the dimensions you need; increasing scale also increases the number of pixels in the image.useCORS: truehelps with remote images only when their server permits cross-origin access. It does not bypass browser security rules.canvas.toDataURL('image/png')creates a PNG data URL, which the example assigns to a temporary download link. For workflows that need a Blob rather than a data URL, the canvas can be converted to a Blob instead.- Add
data-html2canvas-ignoreto an element that should not appear in the capture, such as a download control or an editing affordance.
The package rebuilds the image from information available in the DOM and CSS. It is not a pixel-perfect screenshot of the browser’s rendered surface, so test the specific component styles and content you intend to export.
Keep browser-only code out of Nuxt server rendering
Nuxt uses universal rendering: Vue code can run on the server to produce HTML and then hydrate in the browser. The server does not provide browser globals such as window or document, and html2canvas runs in the browser. Keep calls that use those APIs inside client execution, for example in onMounted or a user-triggered handler after mounting. Do not run a capture at the top level of a component setup function where it could execute during server rendering.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
If you need a component that only exists on the client, use Nuxt’s client-only rendering boundary for that component; still trigger the capture only once its target element is present. This avoids server-side access to browser APIs, but it does not solve image loading, CORS, or CSS fidelity issues.
Or skip the browser setup
If the Nuxt page is publicly reachable and you want an image of the rendered page rather than just a locally mounted component, ScreenshotNeo provides a screenshot API. It cannot capture an unserved component from your local browser state; deploy or expose the page at a URL first. One GET request returns an image or PDF, and the API supports PNG, JPEG, or WebP output.
For example, replace the target with the public URL of your Nuxt page and save the response as WebP:
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://your-site.example/share/card -o shot.webp
See the ScreenshotNeo API documentation for authentication and request options. Cookie and consent banners are accepted and removed before capture, along with 60+ known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, with the response identifying the page verdict and billing status in headers. AI agents can use its MCP server tools, including take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000. Learn about ScreenshotNeo, then sign up for 1,000 free screenshots a month with no card.
Generate browser-faithful images on a server or in CI
For server-side generation, use a real browser screenshot path rather than trying to run html2canvas without a browser. The Nuxt OG Image module documents OgImageScreenshot, defineOgImageScreenshot, and a provider: 'browser' option. Its guide says Chromium may need to be installed with npx playwright install. This approach is appropriate when the output must reflect browser layout, web fonts, and normal CSS behavior.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minutePlan for the browser runtime as part of deployment: the environment that runs the capture needs Chromium available, and CI or serverless environments may require explicit browser installation and packaging. This has more runtime and provisioning overhead than a client-side download, but it uses a real browser’s rendering path rather than html2canvas’s DOM reconstruction. Use the module’s documentation for its exact configuration and API rather than assuming the client-side example above applies on the server.
Use Satori for a constrained social-card template
Satori converts a supported JSX/HTML/CSS subset to SVG. It is useful when a card has a controlled design and should be generated deterministically from values such as a title, author, or category. It is not a substitute for rendering an arbitrary Nuxt page: layouts may need to be adapted to the supported subset, and its output is not guaranteed to match a full browser. Follow its expectations for fonts and images, and choose it when template control matters more than broad browser CSS coverage.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Handle common capture problems
The capture fails during server rendering
Cause: code accessed window, document, or html2canvas before client mount. Fix: move the import or capture into client-only execution and invoke it after the template ref has a value, such as from the mounted lifecycle or a click handler.
Remote images are missing
Cause: the remote image server does not permit cross-origin loading, or the image has not finished loading when capture begins. Fix: use same-origin assets where practical, configure permissive CORS headers on the asset server, or use a controlled proxy. useCORS can help when headers allow it, but cannot override browser policy.
The output does not match the visible component
Cause: html2canvas reconstructs the image from DOM and CSS, and some styles or plugin content may be unsupported or represented differently. Fix: test the exact styles in the capture target, simplify unsupported effects where possible, or switch to a browser screenshot for fidelity to browser rendering.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Text, fonts, or images appear in an earlier state
Cause: capture began before reactive data, web fonts, or image assets settled. Fix: disable the download action until the data and component are ready, and wait for required assets before calling html2canvas.
The downloaded image has unwanted controls
Cause: the control is inside the captured element. Fix: mark it with data-html2canvas-ignore or move it outside the element referenced by card.
A server capture cannot find Chromium
Cause: the runtime or CI image lacks the browser binary. Fix: provision Chromium as part of the build or runtime; the Nuxt OG Image guide points to npx playwright install when installation is needed.
Quick Recap
Practical performance, reliability, and output notes
- Capture only the element the user needs rather than an unnecessarily large page. Larger captures and higher scale create more pixels to render and encode.
- Use a browser download when the output should reflect the current visitor’s rendered component or local state. Use a server browser when a repeatable capture of a reachable page is the requirement.
- Test with the actual remote assets and CSS used in production; a locally correct capture does not establish that cross-origin production images will be available.
- Do not treat a static HTML build as an image generator. It creates HTML for hosting, so pair it with a separate browser or template renderer if image files are required.
- For Satori, keep layouts within its supported subset; for broad browser CSS behavior, choose a real browser rather than assuming a template renderer will match.
Implementation checklist
- Decide whether the image is created from a visitor’s mounted component, a server/CI page, or a controlled social-card template.
- For a visitor download, install html2canvas and call it only after the target ref exists in the browser.
- Wait for the required data, fonts, and images; configure same-origin or CORS-permitted image access.
- Choose an output scale and test the exact styles and assets used by the component.
- For server screenshots, configure the Nuxt OG Image browser provider and ensure Chromium is provisioned where the capture runs.
- For Satori, adapt the design to its supported JSX/CSS subset and its font and image requirements.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

