A QR code drawn as inline SVG for any value: one white plate and one path of black modules, rendered synchronously so it works in server components and prints crisply at any size.
Examples of v0.1.1 are shown as code; only the latest version runs live. Open the live examples →
A code at the default size. It is black on white in every theme so it always scans.
Basic Qr Code
1const VALUE = "https://the-behive.com/q/K7M2QX9P";23const LABEL = "the-behive.com/q/K7M2QX9P";45const BasicQrCode = () => <QrCode value={VALUE} label={LABEL} />;67render(<BasicQrCode />);
The smallest size, 6rem (1 in), for tight spots. Below this the code is raised to 6rem.
Small Qr Code
1const VALUE = "https://the-behive.com/q/K7M2QX9P";23const LABEL = "the-behive.com/q/K7M2QX9P";45const SmallQrCode = () => (6 <QrCode value={VALUE} label={LABEL} size={6} />7);89render(<SmallQrCode />);
Higher error correction survives scuffs and stickers, at the cost of a denser code.
High Error Correction Qr Code
1const VALUE = "https://the-behive.com/q/K7M2QX9P";23const LABEL = "the-behive.com/q/K7M2QX9P";45const HighErrorCorrectionQrCode = () => (6 <QrCode value={VALUE} label={LABEL} size={15} errorCorrection="H" />7);89render(<HighErrorCorrectionQrCode />);
An empty value cannot be encoded, so a dashed box of the same size stands in and keeps its label.
Invalid Qr Code
1const InvalidQrCode = () => <QrCode value="" label="Code unavailable" />;23render(<InvalidQrCode />);