Componentticket-stub2.51 KB gzipZero dependencies
QR Code
Generates QR codes with Reed-Solomon error correction, mask evaluation, and finder patterns. Includes encodeQrMatrix helper.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add qr-codeOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { QrCode, encodeQrMatrix } from "@/components/ui/qr-code"; <QrCode value="hello" />Source code
qr-code.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxqr-code.tsx357 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; /** * GF(256) exp/log lookup tables for QR Reed-Solomon error correction (poly 0x11d, alpha = 2). */const { GF_EXP, GF_LOG } = (() => { const exp = new Uint8Array(512); const log = new Uint8Array(256); let x = 1; for (let i = 0; i < 255; i++) { exp[i] = x; exp[i + 255] = x; log[x] = i; x <<= 1; if (x & 0x100) x ^= 0x11d;Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { encodeQrMatrix } from "@/components/ui/qr-code"; <encodeQrMatrix />| Prop | Type | Description |
|---|---|---|
| value | string | The data to encode in the QR code. |
| size | number | Pixel size of the QR code (default: 200). |
| level | QrLevel | Error correction level (default: M). |
| scan | boolean | Show scanning laser line effect. |