Skip to content
Agents tracked: 440 Downloads (7d): 202M down 19.5% GitHub stars: 10.4M Releases (7d): 607 Agent status: 1 with issuesSince last limit reset: Claude 28d · Codex 0d Updated Oct 21, 2026

qrcode (JavaScript) Examples You Can Edit and Run

5 small qrcode (JavaScript) examples written by AgentGid from the official docs, one feature each. Every one runs in your browser: change the code and see the result at once, or describe a change and let AI rewrite it. The screenshots are taken from the same code by our server, which also checks that each example starts without errors.

qrcode (JavaScript): usage and stats 115 AI-built projects use it

Try them all in one place

import QRCode from 'qrcode'

const root = document.getElementById('root')
root.style.cssText = 'display:flex;align-items:center;justify-content:center;gap:24px;height:100%;font:14px system-ui,sans-serif;color:#e5e7eb'
// Small helper to create an element with inline styles and text
const el = (tag, css, text) => Object.assign(document.createElement(tag), { style: css || '', textContent: text || '' })

// The QR code is drawn at its natural size, then scaled up crisply with CSS
const canvas = el('canvas', 'width:200px;height:200px;image-rendering:pixelated;border-radius:8px')
const side = el('div', 'display:grid;gap:10px;width:240px')
const input = el('input', 'padding:8px;border-radius:6px;border:1px solid #444;background:#1f1f1f;color:#fff')
input.value = 'sample text'
const status = el('div', 'color:#86efac')
side.append(el('b', '', 'Text to encode'), input, status)
root.append(canvas, side)

function draw () {
  QRCode.toCanvas(canvas, input.value || ' ', function (error) {
    if (error) console.error(error)
    status.textContent = error ? 'error: ' + error.message : 'success! drawn on the canvas'
    canvas.style.width = canvas.style.height = '200px'
  })
}
input.addEventListener('input', draw)
draw()
Ctrl/⌘ + Enter runs

Free for signed-in members, with a daily limit. Describe the change in plain words; the new code runs only in your browser.

Type in the box on the right: the QR code is redrawn on every keystroke. Code written by AgentGid [1]. How it works, with a screenshot →

Checked Oct 12, 2026: each example starts without errors in Chromium with qrcode 1.5.4. Needs WebGL.

Sources

  1. qrcode (JavaScript) README (GitHub)

Explanations written by AgentGid from the official docs; the numbers in brackets point here. The code marked "written by AgentGid" is ours and free to copy.

Building something with qrcode (JavaScript)? Ask AgentGid →