Renderer outputs
Every renderer turns the same QRCodeMatrix into a different output. Pick the output your
application needs, then install its package.
@qrcodesdk/core runs in any Core-compatible runtime. The text renderer needs a UTF-8 text
environment.
| Output | Renderer | Returns | Best for |
|---|---|---|---|
| SVG string | QRCodeSVGRenderer |
string |
Scalable web, print, and server output |
| Terminal text | QRCodeTextRenderer |
string |
Terminals, logs, CLIs, and snapshots |
Browser
Section titled “Browser”@qrcodesdk/browser needs the browser DOM.
| Output | Renderer | Returns | Best for |
|---|---|---|---|
| Canvas element | QRCodeCanvasRenderer |
HTMLCanvasElement |
Drawing, compositing, and manual raster export |
| PNG Image element | QRCodePNGImageRenderer |
HTMLImageElement |
Accessible DOM images and CSS workflows |
| WebP Image element | QRCodeWebPImageRenderer |
HTMLImageElement |
The smallest lossless DOM image |
| GIF Image element | QRCodeGIFImageRenderer |
HTMLImageElement |
Destinations that require GIF |
| JPEG Image element | QRCodeJPEGImageRenderer |
HTMLImageElement |
Destinations that require JPEG |
| SVG browser download | QRCodeDownloadSVGRenderer |
void |
User-triggered SVG downloads |
| Image browser download | QRCodeDownloadImageRenderer |
void |
User-triggered PNG, WebP, GIF, or JPEG downloads |
Node.js
Section titled “Node.js”@qrcodesdk/node runs in Node.js-compatible runtimes.
| Output | Renderer | Returns | Best for |
|---|---|---|---|
| PNG Buffer | QRCodePNGRenderer |
Buffer |
Files, HTTP responses, email, and attachments |
| WebP Buffer | QRCodeWebPRenderer |
Buffer |
The smallest lossless files and responses |
| GIF Buffer | QRCodeGIFRenderer |
Buffer |
Destinations that require GIF |
| JPEG Buffer | QRCodeJPEGRenderer |
Buffer |
Destinations that require JPEG, photo center images |
Frameworks and custom output
Section titled “Frameworks and custom output”- Framework packages wrap the same outputs in components: React and Next.js, React Native, Vue, Svelte, and Angular.
- For another return type, write a custom renderer.
Related pages
Section titled “Related pages”Support QRCodeSDK
If you find QRCodeSDK useful, please consider sponsoring the project!