Type Alias: QrCodeSvgProps
type QrCodeSvgProps = object;
Defined in: QrCodeSvg.tsx:65
Properties for configuring the SVG QR code generation component.
Properties
backgroundColor?
backgroundColor?: string;
Defined in: QrCodeSvg.tsx:82
The background color of the QR code.
color?
color?: string;
Defined in: QrCodeSvg.tsx:84
The color of the QR code's modules.
errorCorrectionLevel?
errorCorrectionLevel?: ErrorCorrectionLevel;
Defined in: QrCodeSvg.tsx:80
The error correction level for the QR code. Defaults to 'H' with a
logo (the logo hides part of the code) and 'M' otherwise. The level
is raised automatically when that fits into the same size.
fill?
fill?: ColorValue | GradientFill;
Defined in: QrCodeSvg.tsx:86
Solid color or gradient fill for the QR code's modules. Overrides color.
finderPattern?
finderPattern?: FinderPatternStyle | false;
Defined in: QrCodeSvg.tsx:106
Draw the three finder patterns ("eyes") and the smaller alignment
patterns as solid shapes, optionally in their own colors. false draws
them with the module shape. By default dots, triangle and
separated get solid patterns (scanners need them to find the code);
the other shapes draw them as modules.
gap?
gap?: number;
Defined in: QrCodeSvg.tsx:96
Gap between a module and its unconnected neighbors, as a fraction of
one module (e.g. 0.05 = 5% of a module). Overrides the shape's own
default.
logo?
logo?: LogoConfig;
Defined in: QrCodeSvg.tsx:120
Logo/content rendered in the middle of the QR code.
moduleProps?
moduleProps?: PathProps;
Defined in: QrCodeSvg.tsx:118
Props applied to the SVG paths that draw the modules.
Note the paths live in the same matrix-unit coordinate space as the
viewBox (one module = 1 unit), so e.g. strokeWidth scales with the
rendered size rather than being a fixed pixel value.
onError?
onError?: (error) => void;
Defined in: QrCodeSvg.tsx:129
Called instead of throwing when the QR code can't be generated, e.g.
value is too long for errorCorrectionLevel. When provided, the
component never throws for these cases and renders nothing. When
omitted, the error is thrown during render.
Parameters
| Parameter | Type |
|---|---|
error | Error |
Returns
void
quietZone?
quietZone?: number;
Defined in: QrCodeSvg.tsx:111
Light margin around the code, in modules. Scanners expect 4; leave it at 0 when the surroundings are already light and empty enough.
separated?
separated?: boolean;
Defined in: QrCodeSvg.tsx:98
Apply gap between every module, including connected ones, instead of only unconnected ones.
shape?
shape?: QrShapeName | CustomRenderer;
Defined in: QrCodeSvg.tsx:90
Built-in shape preset, or a fully custom renderer.
size?
size?: number;
Defined in: QrCodeSvg.tsx:74
Explicit pixel size for the QR code. When omitted, the QR code fills
its container's width and derives its height to stay square (via
aspectRatio: 1) - give the container (or style) a width for this
to have something to fill.
style?
style?: StyleProp<ViewStyle>;
Defined in: QrCodeSvg.tsx:88
Style for the container of the QR code.
testID?
testID?: string;
Defined in: QrCodeSvg.tsx:122
Base testID; sub-elements are suffixed (-svg, -module, -finder, -content).
value
value: string;
Defined in: QrCodeSvg.tsx:67
The string to be converted into a QR code.