The QRCodeProps interface defines the customization options for the QRCode component. All props except value are optional.
| Prop | Type | Default | Description |
|---|
value | string | Required | The data to encode in the QR code. |
size | number | 128 | The width and height of the QR code in pixels. |
bgColor | React.CSSProperties["backgroundColor"] | #FFFFFF | The background color of the QR code. |
fgColor | React.CSSProperties["color"] | #000000 | The foreground (dots) color of the QR code. |
level | "L" | "M" | "H" | "Q" | "L" | The error correction level. |
title | string | None | An optional title for the SVG element. |
Note: Since QRCodeProps extends React.SVGProps<SVGSVGElement>, you can also pass any standard SVG attributes (like className, style, etc.) to the component.
export interface QRCodeProps extends React.SVGProps<SVGSVGElement> {
value: string;
size?: number; // defaults to 128
bgColor?: React.CSSProperties["backgroundColor"]; // defaults to "#FFFFFF"
fgColor?: React.CSSProperties["color"]; // defaults to "#000000"
level?: "L" | "M" | "H" | "Q"; // defaults to "L"
title?: string;
}