Interface OverlayConfiguration

Overlay configuration

interface OverlayConfiguration {
    cornerRadius?: number;
    customLogoSrc?: string;
    detectionBorderColor?: string;
    detectionBorderWidth?: number;
    detectionFillColor?: string;
    filterCameras?: boolean;
    focusOnTap?: boolean;
    primaryColor?: string;
    showCameraSelector?: boolean;
    showDetections?: boolean;
    showFlashlight?: boolean;
    showTargetingLine?: boolean;
    targetingLineActiveColor?: string;
}

Properties

cornerRadius?: number

Corner radius in pixels for rectangular elements such as view finder and camera selector.

The allowed range of the corner radius is 0 to 8 pixels.

Default Value

0
customLogoSrc?: string

Override the STRICH logo displayed in the bottom-right corner with a custom image.

The image is supplied as a URL (e.g. https://example.com/assets/overlay.png) or inline as a data URL. The image should have a transparent background (WebP or PNG format). The recommended size is 140x30 pixels.

Remarks

This is an enterprise-only capability.

detectionBorderColor?: string

Color to use for drawing a border around the area of detected barcodes. Must be specified in rgb() format, with the color components given as integers with no separating whitespace. The border will become transparent when the detection becomes stale.

Remarks

Only has an effect if OverlayConfiguration.showDetections is true.

Default Value

undefined
detectionBorderWidth?: number

The border width in pixels to use for drawing a border around the area of detected barcodes.

Remarks

The allowed range is 0 to 4 pixels. Values outside the range are clamped.

Default Value

0
detectionFillColor?: string

Color to use for filling area of detected barcodes. Must be specified in rgb() format, with the color components given as integers with no separating whitespace. The fill will become transparent when the detection becomes stale.

Remarks

Only has an effect if OverlayConfiguration.showDetections is true.

Default Value

rgb(0,0,255)
filterCameras?: boolean

Filter cameras returned by the browser.

If set to true, only cameras that are deemed appropriate for barcode scanning will be offered in the camera selector.

Default Value

true
focusOnTap?: boolean

Indicate if single-tapping the overlay should attempt to trigger autofocus.

Remarks

Triggering autofocus is currently only available on Android devices.

Default Value

true
primaryColor?: string

Color to use for drawing UI elements such as the view finder and camera selector. Must be specified in rgb() format, with the color components given as integers with no separating whitespace.

Default Value

rgb(255,255,255)
showCameraSelector?: boolean

Indicate if the camera selector should be shown in the overlay.

Default Value

true
showDetections?: boolean

Indicate if the overlay should draw the bounding boxes of detected barcodes on top of the camera preview.

Default Value

true
showFlashlight?: boolean

Indicate if the flashlight toggle should be shown in the overlay.

Remarks

Flashlight functionality is not supported in some browsers.

Default Value

true
showTargetingLine?: boolean

Indicate if a horizontal line should be drawn to aid in positioning 1D barcodes.

Default Value

true
targetingLineActiveColor?: string

Color to use for drawing the horizontal targeting line when a barcode was detected. Must be specified in rgb() format, with the color components given as integers with no separating whitespace.

Defaultvalue

rgb(255,0,0)

Generated using TypeDoc