Skip to content

QR Codes

The QR plugin generates QR codes from text, URLs, or structured data.

Powered by qrcode

This plugin passes your options directly to the qrcode library—no FloImg abstraction layer. See the qrcode docs for all available options.

Terminal window
pnpm add @teamflojo/floimg-qr
import createClient from '@teamflojo/floimg';
import qr from '@teamflojo/floimg-qr';
const floimg = createClient();
floimg.registerGenerator(qr());
const code = await floimg.generate({
generator: 'qr',
params: {
data: 'https://floimg.com'
}
});
Basic QR code encoding a URL
Generated QR code
ParameterTypeRequiredDescription
datastringYesContent to encode
sizenumberNoSize in pixels (default: 200)
errorCorrectionstringNoError correction level: ‘L’, ‘M’, ‘Q’, ‘H’
marginnumberNoQuiet zone margin (default: 4)
colorstringNoForeground color (default: black)
backgroundColorstringNoBackground color (default: white)
const qrCode = await floimg.generate({
generator: 'qr',
params: {
data: 'https://example.com/product/123'
}
});
const qrCode = await floimg.generate({
generator: 'qr',
params: {
data: 'https://floimg.com',
size: 400,
color: '#7c3aed',
backgroundColor: '#f5f3ff',
margin: 2
}
});
Branded QR code with custom purple color and light background
Styled QR code with brand colors

For QR codes that may be partially obscured (e.g., with a logo overlay):

const qrCode = await floimg.generate({
generator: 'qr',
params: {
data: 'https://floimg.com',
errorCorrection: 'H', // Highest error correction
size: 400
}
});
const vcard = `BEGIN:VCARD
VERSION:3.0
N:Doe;John
FN:John Doe
ORG:Example Corp
TEL:+1-555-123-4567
EMAIL:john@example.com
END:VCARD`;
const contactQR = await floimg.generate({
generator: 'qr',
params: {
data: vcard,
size: 300
}
});
const wifi = 'WIFI:T:WPA;S:MyNetwork;P:MyPassword;;';
const wifiQR = await floimg.generate({
generator: 'qr',
params: {
data: wifi,
size: 250
}
});
LevelRecoveryUse Case
L~7%Clean environments, maximum data
M~15%Default, general purpose
Q~25%Moderate damage expected
H~30%Logo overlays, harsh conditions

Want to experiment visually? Try QR Code in floimg-studio →