CameraScanButton
CameraScanButton is the icon button that opens and closes the camera barcode scanner panel.
Import
import { CameraScanButton } from '@tallyui/components';Usage
<CameraScanButton open={scannerOpen} onPress={() => setScannerOpen((open) => !open)} />A scan icon button with a tooltip, ported from WCPOS v2. It does not open anything itself: the app keeps the open state and shows CameraScannerPanel when it is true. While open is true the button is drawn in the secondary style, its label and tooltip read "Close barcode scanner" (otherwise "Scan barcode with camera"), and it reports itself as expanded to assistive technology.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | required | The scanner is showing, so the button closes it |
onPress | () => void | required | Called on press; the app toggles the scanner |
testID | string | 'camera-scan-button' | Test id of the button |
VariationPicker
VariationPicker lets the cashier pick one value per option group, shows the matched variant's stock and price, and adds it with an Add to Cart button.
CameraScannerPanel
CameraScannerPanel is the inline, resizable camera barcode scanner, with a close button, status text and a flash on each accepted scan.