Custom component example

One of the best ways to understand how to create a component is to see an example of one and how it's put together.

Here we've created a simple QR code generator that contains a JSON manifest file and two JavaScript files (one for the custom element, and one to generate the code). The entire QR code example component can be downloaded directly. It is a zip file that contains a directory of four files:

myqrcode.js - The custom element for the QR code generator

manifest.json - The JSON manifest for the component

demo.html - An HTML file that demonstrates the component

qr.js - The JavaScript that generates the QR code

You can also examine the custom element, the manifest file, and the QR code generator below.