qrcode.react

A React component for generating QR codes as SVG or Canvas, with logo embedding and full styling control.

Library
npm
v4.2.0
4,286 stars
ISC

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
67 /100 Good
Development Activity 68
Maintenance 44
Community 56
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
86 /100 Excellent
Architecture 82
Code Quality 85
Innovation 88
Learning Curve 90

qrcode.react is a small, dependency-light React component library for rendering QR codes directly to the DOM. It ships two components, QRCodeSVG and QRCodeCanvas, so you can pick the output format that best fits your use case, and exposes props for size, error-correction level, colors, margins, and embedded logo images.

Built in TypeScript and bundling the well-known nayuki QR Code Generator, it encodes text and multi-segment values efficiently while staying tiny and tree-shakeable. It supports React 16.8 through 19, making it a stable choice for adding scannable codes to web apps.

What You Get

  • Two ready-to-use components, QRCodeSVG and QRCodeCanvas, for SVG or Canvas rendering
  • Full TypeScript typings for every prop, including the embedded image settings object
  • Configurable error-correction levels (L, M, Q, H) with optional automatic level boosting
  • Support for embedding a centered logo image with optional excavation of overlapping modules
  • Custom foreground/background colors, sizes, margins, and pass-through of arbitrary DOM props

Common Use Cases

  • Rendering QR codes that link to a website, app store listing, or landing page
  • Generating codes for two-factor authentication (otpauth) setup screens
  • Displaying scannable payment, ticket, or contact (vCard) codes in a dashboard
  • Adding branded QR codes with an embedded company logo to marketing pages

Under The Hood

Architecture The library is a single ~590-line module (src/index.tsx) that wraps the bundled nayuki QR Code Generator (src/third-party/qrcodegen/index.ts, ~980 lines). A shared useQRCode hook memoizes the encoded module matrix from the value, level, minVersion, and boostLevel props, mapping the string error-correction level through an ERROR_LEVEL_MAP into the generator’s Ecc enum. Two forwardRef components consume that matrix: QRCodeSVG builds an SVG <path> string (via generatePath) plus an optional <image> node, while QRCodeCanvas imperatively paints the matrix with useEffect onto a device-pixel-scaled <canvas>, loading any embedded image through an internal <img> ref. Shared helpers like excavateModules and getImageSettings compute the logo cut-out geometry for both paths.

Tech Stack Written in TypeScript targeting ES2017 for the browser platform. The only runtime dependency is the vendored nayuki qrcodegen; React (16.8–19) is a peer dependency. It is bundled with tsup into dual CommonJS and ESM outputs with generated .d.ts type declarations, is marked sideEffects: false for tree-shaking, and ships only the lib directory. Tooling includes ESLint, Prettier, and a Makefile-driven build.

Code Quality The code is cleanly typed with explicit prop types and JSDoc on every field. Tests live in src/__test__/index.test.tsx using Jest, jsdom, and Testing Library, including snapshot coverage of rendered output. Naming is descriptive (SUPPORTS_PATH2D, excavateModules, getImageSettings) and rendering concerns are separated between the SVG and Canvas components while sharing encoding logic, keeping the module coherent despite its size.

API Design The public surface is intentionally minimal: two named exports whose props are a superset of the underlying DOM element’s attributes, so className, style, and other attributes pass straight through. Sensible defaults (size 128, level L, standard colors) mean <QRCodeSVG value="..." /> works with a single prop, while the nested imageSettings object cleanly scopes the more advanced logo-embedding options. The README documents every prop with type and default in table form.

Used by 27 apps in this directory

Go
59%
Apache 2.0

agent-orchestrator

AI Agents · AI Code Assistants · Developer Tools

12,440

A local desktop workspace that gives every coding task its own agent, Git branch, and worktree, then tracks tasks, pull requests, CI, and reviews for 27 coding agents on one live Kanban board.

View details
86
Repo Health
83
Technical
68
Dependency
Built with
Go 59%
TypeScript 38%
Updated 1 weeks ago
TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

33,179

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 95%
Updated 1 months ago
JavaScript
95%
MIT

AnythingLLM

AI Assistants · Automation · Developer Tools

66,533

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
90
Repo Health
78
Technical
64
Dependency
Built with
JavaScript 95%
Updated 1 weeks ago
TypeScript
89%
Other

anytype-ts

Collaboration · Knowledge Management · Note Taking

8,861

A local-first, end-to-end encrypted knowledge OS that lets you build notes, tasks, wikis, and entire apps — with your data stored offline and synced peer-to-peer.

View details
88
Repo Health
78
Technical
67
Dependency
Built with
TypeScript 89%
Updated 2 weeks ago
Go
83%
Apache 2.0

Authelia

Authentication · Security

29,110

OpenID Certified SSO and MFA portal for securing self-hosted web applications behind reverse proxies.

View details
91
Repo Health
81
Technical
75
Dependency
Built with
Go 83%
TypeScript 15%
Updated 1 weeks ago
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

11,049

A self-hosted, AI-powered card note-taking tool that lets you capture fleeting thoughts instantly and retrieve them with natural language search.

View details
75
Repo Health
69
Technical
63
Dependency
Built with
TypeScript 92%
Updated 1 months ago
TypeScript
80%
GPL 3.0

Bramble

Authentication · Password Manager · Security

399

Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.

View details
75
Repo Health
84
Technical
68
Dependency
Built with
TypeScript 80%
Updated 1 weeks ago
Go
49%
MIT

Bytebase

Devops

14,512

An open-source database CI/CD and DevSecOps platform — schema migration review, GitOps-driven changes, data masking, and access control across MySQL, PostgreSQL, Oracle, Snowflake, MongoDB, and more.

View details
92
Repo Health
73
Technical
68
Dependency
Built with
Go 49%
TypeScript 42%
Updated 1 weeks ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

52,202

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
89
Repo Health
84
Technical
70
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers