View as Markdown

API reference: @salmonui/charts/barcode

QRCodePropsinterface

import type { QRCodeProps } from '@salmonui/charts/barcode';
interface QRCodeProps extends SvgPassthrough {
    readonly value: string;
    readonly errorCorrection?: QRErrorCorrection | undefined;
    readonly version?: 'auto' | number | undefined;
    readonly mode?: QRMode | undefined;
    readonly gs1?: boolean | undefined;
    readonly mask?: number | undefined;
    readonly logo?: ReactNode;
    readonly moduleSize?: number | undefined;
    readonly width?: number | undefined;
    readonly quietZone?: boolean | undefined;
    readonly text?: boolean | string | undefined;
    readonly color?: string | undefined;
    readonly background?: string | undefined;
    readonly label?: string | undefined;
    readonly invalidLabel?: string | undefined;
    readonly onInvalid?: ((event: BarcodeInvalidEvent) => void) | undefined;
    readonly ref?: Ref<QRCodeApi> | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
}
QRCodeProps members (19)
NameSignatureDescription
valuereadonly value: string;
errorCorrectionoptionalreadonly errorCorrection?: QRErrorCorrection | undefined;

Default 'm', or 'h' with a logo.

versionoptionalreadonly version?: 'auto' | number | undefined;

'auto' (default): the smallest version 1..40 that fits.

modeoptionalreadonly mode?: QRMode | undefined;

Default 'auto': numeric, alphanumeric or byte (UTF-8), whichever encodes the whole value.

gs1optionalreadonly gs1?: boolean | undefined;

GS1 QR Code: value is an element string (01)…(10)….

maskoptionalreadonly mask?: number | undefined;

Mask 0..7 (default: the lowest ISO penalty).

logooptionalreadonly logo?: ReactNode;

Centered over a cleared area (about 22 % of the symbol width); raises the default error correction to 'h'.

moduleSizeoptionalreadonly moduleSize?: number | undefined;

Module size in px (default 4).

widthoptionalreadonly width?: number | undefined;

Total width (and height) in px; overrides moduleSize.

quietZoneoptionalreadonly quietZone?: boolean | undefined;
textoptionalreadonly text?: boolean | string | undefined;

Optional caption under the symbol: true shows the value.

coloroptionalreadonly color?: string | undefined;

Module color: a data color, default #000000.

backgroundoptionalreadonly background?: string | undefined;
labeloptionalreadonly label?: string | undefined;

Accessible name; default the encoded value.

invalidLabeloptionalreadonly invalidLabel?: string | undefined;
onInvalidoptionalreadonly onInvalid?: ((event: BarcodeInvalidEvent) => void) | undefined;
refoptionalreadonly ref?: Ref<QRCodeApi> | undefined;
classNameoptionalreadonly className?: string | undefined;
styleoptionalreadonly style?: CSSProperties | undefined;