Components/Barcode Input
Barcode Input
Input optimized for hardware scanners (USB/Bluetooth keyboard-emulating) with an active-scan indicator, success/error flash, and recent-codes history.
Recentes
789490001151778960123456787897123456789
Installation
npx @ajax-ui/cli add barcode-inputProps
onScan(code)- fires on Enter when the typed value passesminLength(default 4).recentScans- array of strings to render as history chips below the input.status"idle" | "scanning" | "success" | "error" - overrides the auto-managed flash.inlineHistory(defaulttrue) - chips wrap horizontally; setfalsefor stacked.
Hardware integration
USB/Bluetooth scanners emulate keyboard input ending in Enter - the component handles that natively. For camera-based scanning, wrap an external lib (e.g. @zxing/browser) and forward its decoded value to onScan.