arya-blue
luna-amber
luna-blue
luna-green
luna-pink
nova-dark
nova-light
saga-blue
vela-blue
CodeScanner

ZXing for JS

Multi-format 1D/2D barcode image scanner based on ZXing for JS. Allows you to scan bar and QR codes using a client side video input device.

Important: parts of the JavaScript of this component require https! If this component is not working for you in this showcase on the primefaces.org server, try running it on localhost.

Components and more
Use Cases
Documentation pe:codeScanner
Attributes (move mouse over the names to see data types)
Name Description
autoStartWhether to start scanning automatically.Default is true.
bindingAn EL expression referring to a server side UIComponent instance in a backing bean.Default is generated.
deviceIdCamera device ID to use when multiple cameras are available.
forSearch expression for the input component to write the scanned value to.
heightHeight of the video element in pixels.
idUnique identifier of the component in a namingContainer.Default is generated.
onerrorClient-side callback when scanning fails.
onsuccessClient-side callback when a code is successfully scanned.
renderedBoolean value to specify the rendering of the component, when set to false component will not be rendered.Default is true.
styleInline style of the component.
styleClassStyle class of the component.
typeReader type: 'multi', 'bar', or 'qr'.Default is multi.
videoWhether to show the video stream.Default is true.
widgetVarName of the client side widget.
widthWidth of the video element in pixels.
PrimeFaces Extensions Showcase - © 2011-2025,PrimeFaces: 16.0.0-SNAPSHOT,PrimeFaces Extensions: 16.0.0-SNAPSHOT,JSF: Apache MyFaces Core 4.0 - Impl 4.0.3,Server: Apache Tomcat (TomEE)/10.1.52 (10.1.4),Build time: 2026-03-07 01:34