QR Code Download
A download menu that exports a QR code as PNG, SVG, JPG or PDF at the size you pick, or copies it as an image.
Installation
pnpm dlx shadcn@latest add https://qrdx.dev/r/qr-code-download.jsonUsage
import { QrCodeDownload } from "@/components/qr-code-download";<QrCodeDownload value="https://qrdx.dev" />The menu lists each format with a short hint, a size picker, and "Copy image", which puts a PNG on the clipboard. Files are rendered in the browser; nothing is uploaded.
Examples
Styled export
Give qr the same style object you render on screen, so every exported file matches the preview. formats, sizes, label and variant shape the menu and its button.
Formats
| Format | Output |
|---|---|
png | Image with the code's background |
jpg | Image with a solid background |
svg | Vector that scales to any size |
pdf | Single-page document. Needs the optional jspdf package (npm install jspdf) |
Raster sizes go from 50 to 5000 pixels. Pass a single entry in sizes to hide the size picker.
API Reference
Prop
Type
Any other prop, such as className, is passed to the wrapping <div>.
Last updated on