react-native-camera-kit - v16.1.2
    Preparing search index...

    Interface CameraPropsNo Inherit Doc

    Props for the Camera component.

    • Optional numeric props are normalized to -1 internally to represent “unset” (RN Codegen limitation for view props).
    • Color props accept numbers or strings; on Android strings are converted via processColor.
    • Platform‑specific behavior is noted per prop.
    • Controlled vs uncontrolled zoom: When zoom is provided (controlled), pinch does not change the native zoom; when zoom is undefined and zoomMode='on' (uncontrolled), pinch adjusts zoom and emits CameraProps.onZoom.

    Note: The component accepts all React Native ViewProps at runtime, but for readability in the generated docs we hide inherited members.

    interface CameraProps {
        barcodeFrameSize?: { height: number; width: number };
        cameraType?: CameraType;
        flashMode?: FlashMode;
        focusMode?: FocusMode;
        frameColor?: string | number;
        laserColor?: string | number;
        maxPhotoQualityPrioritization?: "balanced" | "quality" | "speed";
        maxZoom?: number;
        onCaptureButtonPressIn?: (__namedParameters: { nativeEvent: {} }) => void;
        onCaptureButtonPressOut?: (__namedParameters: { nativeEvent: {} }) => void;
        onError?: (event: { nativeEvent: { errorMessage: string } }) => void;
        onOrientationChange?: (event: OnOrientationChangeData) => void;
        onReadCode?: (event: OnReadCodeData) => void;
        onZoom?: (event: OnZoom) => void;
        ratioOverlay?: string;
        ratioOverlayColor?: string | number;
        resetFocusTimeout?: number;
        resetFocusWhenMotionDetected?: boolean;
        resizeMode?: ResizeMode;
        scanBarcode?: boolean;
        scanThrottleDelay?: number;
        showFrame?: boolean;
        shutterPhotoSound?: boolean;
        torchMode?: TorchMode;
        zoom?: number;
        zoomMode?: ZoomMode;
    }

    Hierarchy

    • ViewProps
      • CameraProps
    Index

    Properties

    barcodeFrameSize?: { height: number; width: number }

    Size of the scanning frame.

    Type Declaration

    • height: number

      Frame height in pixels.

    • width: number

      Frame width in pixels.

    { width: 300, height: 150 }

    cameraType?: CameraType

    Lens facing direction (front or back).

    back

    flashMode?: FlashMode

    Photo capture flash mode. Maps to the platform capture pipeline (not the continuous torch).

    auto

    focusMode?: FocusMode

    Autofocus mode.

    on

    frameColor?: string | number

    Color of the scanning frame (when showFrame is true).

    laserColor?: string | number

    Color of the animated scanning laser (when showFrame is true).

    maxPhotoQualityPrioritization?: "balanced" | "quality" | "speed"

    iOS capture pipeline quality prioritization.

    balanced

    maxZoom?: number

    Limits the maximum zoom factor to something smaller than the camera's maximum. You cannot go beyond the camera's maximum, only below. The purpose of limiting zoom is because some modern iPhones report max zoom of 150+ which is probably beyond what you want. See documentation for the zoom prop for more info. Example:

    <Camera
    maxZoom={15.0}
    />
    onCaptureButtonPressIn?: (__namedParameters: { nativeEvent: {} }) => void

    Press‑in event from physical capture buttons (iOS 17.2+).

    onCaptureButtonPressOut?: (__namedParameters: { nativeEvent: {} }) => void

    Press‑out event from physical capture buttons (iOS 17.2+).

    onError?: (event: { nativeEvent: { errorMessage: string } }) => void

    Android only. Triggered when camera fails to initialize or bind use cases.

    onOrientationChange?: (event: OnOrientationChangeData) => void

    Called when device orientation changes; see Orientation.

    onReadCode?: (event: OnReadCodeData) => void

    Called when a barcode/QR is decoded.

    <Camera
    scanBarcode
    onReadCode={(e) => console.log(e.nativeEvent.codeStringValue)}
    />
    onZoom?: (event: OnZoom) => void

    Callback triggered when user pinches to zoom and on startup. Example:

    <Camera
    onZoom={(e) => {
    console.log('zoom', e.nativeEvent.zoom);
    }}
    />
    ratioOverlay?: string

    Show a translucent aspect‑ratio guide over the preview. Example: '1:1', '4:3', '16:9'.

    ratioOverlayColor?: string | number

    Overlay color used with CameraProps.ratioOverlay.

    Default is semi‑transparent black if unset.

    #0000004D

    resetFocusTimeout?: number

    Time in ms after which the focus rectangle resets; 0 disables auto‑reset.

    0

    resetFocusWhenMotionDetected?: boolean

    Automatically reset focus when motion is detected.

    JS default is true; native default is false unless set by JS.

    true

    resizeMode?: ResizeMode

    How the preview fits its bounds.

    iOS only; Android preview is managed by CameraX.

    contain

    scanBarcode?: boolean

    Enable barcode/QR analysis. Emits CameraProps.onReadCode.

    false

    scanThrottleDelay?: number

    Throttle (ms) to limit how often barcode scans can fire.

    iOS: negative values effectively disable throttling. Android: negative values are coerced to 2000; use 0 to disable.

    2000

    showFrame?: boolean

    Show a visual scanning frame overlay.

    false

    shutterPhotoSound?: boolean

    Android only*. Play a shutter capture sound when capturing a photo.

    true

    torchMode?: TorchMode

    Torch/flashlight state (continuous light while previewing). Independent from CameraProps.flashMode.

    off

    zoom?: number

    Controls zoom. Higher values zoom in. Default zoom is 1.0, relative to the wide‑angle lens on multi‑camera devices. Examples of minimum/widest zoom:

    • iPhone 6S Plus minimum is 1.0
    • iPhone 14 Pro Max minimum 0.5
    • Google Pixel 7 minimum is 0.7
    const [zoom, setZoom] = useState(1.0);
    <Button onPress={() => setZoom(1.0)} title="Reset" />
    <Camera
    zoom={zoom}
    onZoom={(e) => {
    setZoom(e.nativeEvent.zoom);
    console.log('zoom', e.nativeEvent.zoom);
    }}
    />
    1.0
    
    zoomMode?: ZoomMode

    Enable or disable the pinch gesture handler. If zoomMode is on, you must pass zoom as undefined, or avoid setting zoom it to allow pinch to zoom.

    on Examples:

    <Camera zoomMode="on" />
    <Camera zoomMode="on" zoom={undefined} />
    <Camera zoomMode="off" zoom={1.0} />