Skip to main content

QR Code


The "QR Code" widget generates QR codes from the text that you provide, such as a word (sentence), URL, phone number, email address, etc., which can then be displayed on the widget. It is used for sharing the encoded version of your data with the users. The code can be scanned by the users to display your encoded data.

PropertyDescription
QR InputWill generate the QR based on the input - (what you type here is what is reflected when the QR code is scanned). So, you can even have an URL to direct the users to a particular page.
Note: You can also access a "bind" from here. An empty QR icon is displayed when the bind has no value. example: ${name}, which is the bind name of a "Text Input" field.
QR
Dimensions
(Range: 1 to 100)
Sets the width and height of the QR code.
MarginSets the border thickness of the QR code.
Dark ColorThe QR code color (generally highlighted by a darker color).
Light ColorBackground color of the QR.
Alignment (Left/Center/Right)Sets the alignment of the QR section within the widget.

By using the following function on the onClick of a "Button", you can customize the QR actions in similar ways:

QR

onClick
a8forms.QRCode("").setQRInput("")

API methods for QR CodeDescription
setAlignmentFor setting the alignment of the QR Code
serPropertiesFor setting the different properties of the QR Code
setQRInputFor setting the value of the (QR Code) input field
setVisibilityFor setting the visibility status of the widget
setVisibilityConditionFor setting the condition to change the visibility status of the widget

01 - QR rendering on button click
QR

onClick
setBindParams("qrcode", "autonom8");

02 - QR style change on button click
QR

onClick
a8forms.QRCode("qrCodeId").setProperties({
// Where "qrCodeId" is the ID of the QR code component.
"backgroundColor": "#E0D993",
"border": "1",
"borderColor": "",
"borderRadius": 3,
"color": "#119c80",
"fontSize": 12,
"fontWeight": 600,
"darkColor": "#7D1892", "lightColor": "#DDCCEA",
"dimension": "40"
})
a8forms.QRCode("qrCodeId").setAlignment("center");

Different styles of QR Codes:01020304
Empty QR:

QR
QRQRQRQR