QRScanner
Live camera view that detects QR codes and reports each scan through a strongly typed callback, built on expo-camera with a missing-peer fallback.
QRScanner opens a live camera preview tuned to detect QR codes. It is a gated optional peer built on expo-camera's CameraView, routing the native barcode event into a typed onScanned callback. When expo-camera is not installed it renders a labelled MissingPeer notice. It defaults the symbologies to ['qr'].
Required peer: expo-camera. Install with pnpm add expo-camera.
Import
import { QRScanner } from '@mindees/ui';
Usage
<QRScanner onScanned={(result) => console.log(result.type, result.data)} style={{ flex: 1 }} />
Props
| Prop | Type | Default | Description |
|---|---|---|---|
onScanned | (result: ScanResult) => void | — | Called once per detected code with { type, data }. |
barcodeTypes is fixed to ['qr'] for this variant. Any additional props are forwarded to the underlying CameraView.
Accessibility
The camera surface and its controls come from expo-camera. When the peer is missing, the rendered MissingPeer fallback uses accessibilityRole="alert" and names the required package and install command. Pair the scanner with on-screen instructions so non-visual users know how to aim the camera.
PDFViewer
Renders a PDF document from a remote or local URI by delegating to react-native-pdf, with a missing-peer notice shown when that peer is absent.
BarcodeScanner
Live camera scanner for common 1D and 2D symbologies, sharing the gated expo-camera implementation with QRScanner and reporting typed scan results.