Try out the library in your browser:
- CodeSandbox - Full interactive playground
- StackBlitz - Instant online IDE
The /examples directory contains comprehensive demonstrations of all features:
# Clone and install
git clone https://github.com/devmehq/react-qr-code.git
cd react-qr-code
yarn install
yarn build
# Serve examples (choose one)
npx http-server examples -o # Using http-server
python3 -m http.server 8080 -d examples # Using Python
php -S localhost:8080 -t examples # Using PHP- Live customization controls
- Real-time preview
- Export functionality
- All basic options
- 100+ QR code variations
- All shape combinations
- Gradient examples
- Pattern backgrounds
- Theme presets
- Logo integration
- Basic implementation
- Common use cases
- Template examples (WiFi, vCard, etc.)
- Copy & paste code snippets
- Complete props reference
- Method documentation
- TypeScript interfaces
- Hook examples
- Test QR code scanning
- Contrast validation
- Real-time detectability feedback
- Camera scanning test
import { ReactQrCode } from '@devmehq/react-qr-code'
;<ReactQrCode value="https://example.com" size={256} />import { AdvancedQRCode } from '@devmehq/react-qr-code'
;<AdvancedQRCode
value="https://example.com"
size={300}
eyeShape="rounded"
bodyShape="circle"
theme="ocean"
/><AdvancedQRCode
value="https://example.com"
bodyGradient={{
type: 'linear',
colors: ['#667EEA', '#764BA2'],
angle: 45,
}}
/><AdvancedQRCode
value="https://example.com"
logo="/path/to/logo.png"
logoSize={60}
logoExcavate={true}
/>import { AdvancedQRCode, QRHelpers } from '@devmehq/react-qr-code'
;<AdvancedQRCode
value={QRHelpers.wifi('NetworkName', 'password123', 'WPA2')}
theme="professional"
/><AdvancedQRCode
value={QRHelpers.vcard({
firstName: 'John',
lastName: 'Doe',
phone: '+1234567890',
email: 'john@example.com',
organization: 'ACME Corp',
})}
theme="elegant"
/>The library includes 25+ professionally designed themes:
minimal- Clean black and whitemonochrome- Grayscale eleganceelegant- Sophisticated styleprofessional- Business ready
ocean- Deep blue wavessunset- Warm orange/pinkforest- Natural greensrainbow- Full spectrumaurora- Northern lights
neon- Bright cyber greencyberpunk- Tech noirretrowave- 80s aestheticgradient- Modern gradients
earth- Natural brownsnature- Green harmonyice- Cool bluesfire- Hot reds
gold- Luxurious goldsilver- Sleek silverbronze- Warm bronze
cosmic- Space themepastel- Soft colorsdark- Dark modecolorful- Vibrant mixplayful- Fun and bright
square- Classic squarecircle- Smooth circlesrounded- Rounded cornersleaf- Organic leafstar- Star shapediamond- Diamond cuthexagon- Six-sidedoctagon- Eight-sidedflower- Floral designcat- Cat eyes
square- Traditional pixelscircle- Circular dotsrounded- Soft cornersdiamond- Diamond shapesstar- Star moduleshexagon- Hexagonaloctagon- Octagonaltriangle- Triangularcross- Cross patternplus- Plus signsdots- Dotted stylelines- Linear patternzigzag- Zigzag patternwaves- Wave patternnoise- Noise texturecircuit- Circuit boardorganic- Organic shapesfluid- Fluid design
none- Solid colordots- Dot patternlines- Line patterngrid- Grid overlaymesh- Mesh texturecircuit- Circuit designwaves- Wave patternnoise- Noise texturegradient- Gradient fillradial- Radial patternhexagon- Hex patterntriangle- Triangle pattern
-
Use Canvas for Large QR Codes
<ReactQrCode renderAs="canvas" size={512} />
-
Enable Lazy Loading
<AdvancedQRCode lazy={true} />
-
Optimize Logo Images
- Use WebP or optimized PNG
- Keep logos under 100KB
- Use appropriate dimensions
-
Batch Rendering
// Render multiple QR codes efficiently const codes = data.map((item) => ( <AdvancedQRCode key={item.id} value={item.value} lazy={true} /> ))
Use the qr-test.html page to:
- Test QR code scanning with real devices
- Validate contrast ratios
- Check error correction levels
- Verify logo doesn't interfere
- Minimum: 3:1
- Recommended: 7:1
- Best: 10:1+
// Responsive QR codes
<AdvancedQRCode
value="https://example.com"
size={window.innerWidth < 768 ? 200 : 300}
/><AdvancedQRCode
value={`TICKET:${eventId}:${userId}`}
theme="elegant"
enableDownload={true}
/><AdvancedQRCode value={`PRODUCT:${sku}:${batch}`} theme="minimal" size={150} /><AdvancedQRCode
value="https://restaurant.com/menu"
theme="professional"
logo="/restaurant-logo.png"
/><AdvancedQRCode
value={`instagram://user?username=${username}`}
theme="gradient"
/>