CodeScannerOptions

interface CodeScannerOptions extends BarcodeScannerOutputOptions

Properties

barcodeFormats

barcodeFormats: TargetBarcodeFormat[]

Specifies the formats to be used for Barcode scanning.

If you want to detect all kinds of barcodes, use ['all']

Inherited from

BarcodeScannerOutputOptions.barcodeFormats


isActive

isActive: boolean

Whether the CodeScanner is active, or not.

You can toggle isActive to pause/resume the Camera if the app becomes inactive, or the user to a different screen.


onBarcodeScanned()

onBarcodeScanned: (barcodes: Barcode[]) => void

Called whenever barcodes have been detected.

Inherited from

BarcodeScannerOutputOptions.onBarcodeScanned


onError()

onError: (error: Error) => void

Called when there was an error detecting barcodes.

Inherited from

BarcodeScannerOutputOptions.onError


outputResolution?

optional outputResolution: BarcodeScannerOutputResolution

Controls which camera buffer resolution should be used.

  • 'preview': Prefer preview-sized buffers for lower latency.
  • 'full': Prefer full/highest available buffers for better detail.

Default

'preview'

Inherited from

BarcodeScannerOutputOptions.outputResolution


style

style: StyleProp<ViewStyle>

Sets the style for this view. Most commonly, you would use { flex: 1 }.