@gfazioli/mantine-qr-code
A highly customizable QR Code component for React applications built with Mantine.
Installation
After installation import package styles at the root of your application:
You can import styles within a layer @layer mantine-qr-code by importing @gfazioli/mantine-qr-code/styles.layer.css file.
Usage
Configurator
Explore all available props and see the component in action:
Colors
The QRCode component supports all Mantine theme colors. Use the color and background props to customize:
red
blue
violet
teal
orange
cyan
Dot styles
Control the appearance of data modules with the dotStyle prop:
Square
Rounded
Dots
Corner styles
Customize the three finder patterns (corners) with the cornerStyle prop:
Square
Rounded
Dots
Error correction
QR codes support four error correction levels. Higher levels allow more damage tolerance but produce denser codes:
L (7%)
M (15%)
Q (25%)
H (30%)
Image overlay
Add a logo or image at the center of the QR code. Use errorCorrectionLevel="H" for best results when overlaying images:
Download
Use the useQRCodeDownload hook to download the QR code as SVG or PNG:
Styles API
QRCode supports Styles API, you can add styles to any inner element of the component with classNames prop. Follow Styles API documentation to learn more.
Component Styles API
Hover over selectors to highlight corresponding elements
Use cases
QR codes can encode various data types including URLs, WiFi credentials, and contact information:
URL
WiFi
vCard