CodeScanner

CodeScanner is used to control the low-level full-screen scanner.

Basic Usage

import { CodeScanner } from '@nocobase/client-v2';

<CodeScanner
  visible={visible}
  onClose={() => setVisible(false)}
  onScanSuccess={(text) => setValue(text)}
/>;

API

PropTypeDescription
visiblebooleanWhether the scanner is visible
formatsToSupportHtml5QrcodeSupportedFormats[]Supported QR code or barcode formats
onClose() => voidCalled when the scanner closes
onScanSuccess(result: string) => voidCalled after a successful scan