Skip to content

QrCode ​

QR code SVG from a module matrix (uqr)

A scannable code for moving something from a screen or print to a phone — a ticket, a link, Wi-Fi details. Always show what it encodes as text or a link too: it can't be scanned by the phone it's on, or by a screen reader.

Basic
27×27 modules, ECC M

Install ​

No encoder is bundled. uqr (~10 KB, ESM, zero deps) gives the module matrix:

sh
pnpm add uqr
ts
import { encode } from "uqr";
const matrix = encode("https://…", { ecc: "M" }).data; // boolean[][]

Pass the module grid as matrix; any encoder works. Modules stay square and dark-on-white whatever the theme, since inverted or low-contrast codes scan badly — keep the default colours and border. The optional frame sets the tile on a plate.

  • It is an image named "QR code: …" from value (or label).

Usage ​

ts
import { BlessQrCode } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
matrix*boolean[][]—boolean module grid, e.g. `encode(text).data` from uqr
valuestring—what the code encodes — used for the accessible label
sizenumber160
bordernumber2quiet zone in modules
colorstring"#1a1b1d"module colour — dark on light scans best, so this ignores the theme by default
backgroundstring"#fff"
framebooleanfalseskewed ink plate behind the tile
labelstring—

Released under the MIT License. Character names and artwork belong to their owners.