Advanced Configurations
Customize the Overlay Appearance
To customize the appearance of the overlay, you can implement a LabelCaptureBasicOverlayListener.
The method brushForLabel() is called every time a label captured and brushForFieldOfLabel() is called for each of its fields to determine the brush for the label or field.
// Create the overlay for the label capture mode.
const overlay = new LabelCaptureBasicOverlay(labelCapture);
// Set the listener to customize the appearance of captured labels and fields.
overlay.listener = {
/**
* Called for each field of a captured label to determine its brush.
* Return a Brush to customize the field's appearance, or null to use the default.
*/
brushForFieldOfLabel: (overlay, field, label) => {
// Create colors with transparency (alpha 0.5 = 50% opacity).
const cyanColor = Color.fromRGBA(0, 255, 255, 0.5);
const orangeColor = Color.fromRGBA(255, 165, 0, 0.5);
switch (field.name) {
case "<your-barcode-field-name>":
// Highlight barcode fields with a cyan color.
return new Brush(cyanColor, cyanColor, 0);
case "<your-expiry-date-field-name>":
// Highlight expiry date fields with an orange color.
return new Brush(orangeColor, orangeColor, 0);
default:
// Use a transparent brush for other fields.
return Brush.transparent;
}
},
/**
* Called for each captured label to determine its brush.
* Return a Brush to customize the label's appearance, or null to use the default.
*/
brushForLabel: (overlay, label) => {
// Use a transparent brush for the label itself.
return Brush.transparent;
},
/**
* Called when the user taps on a label.
*/
didTapLabel: (overlay, label) => {
// Handle user tap gestures on the label.
}
};
// Add the overlay to the data capture view.
dataCaptureView.addOverlay(overlay);
Use brush colors with transparency (alpha < 100%) to not occlude the captured barcodes or texts.
Validation Flow
How It Works
The Validation Flow provides a guided label scanning experience. An always-present checklist shows users exactly which fields have been captured and which are still missing, making the scanning process transparent and efficient. Scanning is the fastest way to capture all label content — whether all fields are visible at once or spread across different sides of a package.
The fields shown in the checklist are driven by your Label Definition — the configuration that tells Label Capture which fields to recognize and extract. See the Label Definitions guide for details on how to set them up.
The Validation Flow overlay is a UI component built on top of Label Capture. To use it, create a LabelCaptureValidationFlowOverlay and add it to your data capture view.
| Single-Step Scan | Multi-Step Scan |
|---|---|
| All fields are visible together | Fields on different sides of the package |
![]() | ![]() |
// Create the overlay
const validationFlowOverlay = new LabelCaptureValidationFlowOverlay(labelCapture);
dataCaptureView.addOverlay(validationFlowOverlay);
// Set the listener to receive validation events
validationFlowOverlay.listener = validationFlowListener;
Define a Listener
When the user has verified that all fields are correctly captured and presses the finish button, the Validation Flow triggers a callback with the final results. To receive these results, implement the LabelCaptureValidationFlowListener interface:
const validationFlowListener = {
// This is called by the validation flow overlay when a label has been fully captured and validated
didCaptureLabelWithFields: (fields) => {
const barcodeData = fields.find(f => f.name === "<your-barcode-field-name>")?.barcode?.data;
const expiryDate = fields.find(f => f.name === "<your-expiry-date-field-name>")?.text;
// Handle the captured values
}
};
Required and Optional Fields
The Validation Flow clearly indicates which fields must be captured and which are optional. Required fields are visually highlighted and the flow can only be completed once all of them have been successfully scanned or manually entered. Optional fields are shown but do not block the user from finishing.
| Required Field | Optional Field |
|---|---|
| Must be captured to finish the flow | Does not block finishing |
![]() | ![]() |
Typing Hints
If neither on-device nor cloud-based scanning can capture a field, the user can always manually enter the value. To make manual input easier and reduce errors, you can configure placeholder text (typing hints) that show the expected format directly in the input field.
| Typing Hints |
|---|
![]() |
The field name in the label definition is used as the reference for setting placeholder text:
const validationFlowOverlaySettings = LabelCaptureValidationFlowSettings.create();
validationFlowOverlaySettings.setPlaceholderTextForLabelDefinition("Expiry Date", "MM/DD/YYYY");
validationFlowOverlay.applySettings(validationFlowOverlaySettings);




