The BarcodeScannerDialog component provides barcode scanning functionality for all devices that support the MediaDevices.getUserMedia() native API.
Opening the dialog launches the device camera and scans for known barcode formats.
A scanSuccess event fires whenever a barcode is identified
and a scanError event fires when the scan failed (for example, due to missing permisions).
Internally, the component uses the zxing-js/library third party OSS.
For a list of supported barcode formats, see the zxing-js/library documentation.
Defines the header HTML Element. Note: If header slot is provided, the labelling of the dialog is a responsibility of the application developer. accessibleName should be used.
Defines the footer HTML Element. Note: When you provide custom content for the footer slot, the default close button is not rendered. This means you need to include your own mechanism within the custom footer to close the dialog, such as a button with an event listener that closes the dialog. Note: If the footer slot is not provided, a default footer with a close button is rendered automatically, allowing users to close the dialog without any additional implementation.