Example Description
In this example, we generate a QR code from input text using a npm package and display the QR code in a vector image element.
How We Built It
Page Elements
On the HOME page, we added the following page elements:
TextInput: To enter the text to turn into a QR code.
Button: To start the QR code generation process.
VectorImage: To display the QR code that is generated.
Code
On the HOME page, we used code to handle button clicks by reading the input text, calling a backend function to turn the text into a QR code SVG XML, and display the QR code image.
We imported the qrcode npm package and use it in the backend.
In the backend qrCode.jsw file, we used code to import an npm package and create a function that takes in a text string and returns a QR code SVG XML string.
Related Examples
Did this help?
|
Thanks for your feedback!
Add to Cart Gallery
Let customers to add products to their cart
INTERMEDIATE
Hide and Show Elements
Hide and show elements in response to user interactions
BEGGINER
Hide and Show Elements
Hide and show elements in response to user interactions
BEGGINER