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,281stars
ISC

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
68/100Good
Development Activity64
Maintenance52
Community56
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
86/100Excellent
Architecture82
Code Quality85
Innovation88
Learning Curve90

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 26 apps in this directory

TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

32,102

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
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript95%
Updated today
JavaScript
95%
MIT

AnythingLLM

Developer Tools · Automation · AI Assistants

64,914

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

View details
91
Repo Health
78
Technical
68
Dependency
Built with
JavaScript95%
Updated today
TypeScript
89%
Other

anytype-ts

Knowledge Management · Note Taking · Collaboration

8,665

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
TypeScript89%
Updated yesterday
Go
86%
Apache 2.0

Authelia

Security · Authentication

28,626

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

View details
91
Repo Health
81
Technical
77
Dependency
Built with
Go86%
TypeScript12%
Updated today
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

10,880

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
83
Repo Health
69
Technical
65
Dependency
Built with
TypeScript92%
Updated 2 weeks ago
TypeScript
75%
GPL 3.0

Bramble

Password Manager · Security · Authentication

315

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
73
Repo Health
84
Technical
72
Dependency
Built with
TypeScript75%
Updated today
Go
52%
MIT

Bytebase

Devops

14,396

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
69
Dependency
Built with
Go52%
TypeScript39%
Updated today
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

50,753

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

View details
88
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,633

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
65
Repo Health
76
Technical
63
Dependency
Built with
JavaScript90%
Updated 1 months 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

Search