Display
QrCode <pm-qr-code>
QR code for a link or short text, drawn as SVG without any dependency.
Overview
It is always dark on light with a quiet zone, whatever the theme, because scanners need that contrast. Holds up to 213 bytes at the default error-correction level; show the same link as text nearby for people who cannot scan.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
value | string | — | The link or text to encode. |
label | string | — | Accessible name: say where the code leads ("Open the booking page"). |
size | number | 160 | Width and height in pixels (default 160). |
error-correctionprop: errorCorrection | 'L' | 'M' | 'Q' | 'H' | M | How much damage the code survives: L (7%), M (15%, default), Q (25%) or H (30%). Higher levels hold less text. |
margin | number | 4 | Quiet zone around the code, in modules (default 4, the standard's minimum). |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Slots
| Slot | Description |
|---|---|
(default) | Caption under the code. |
Methods
toSvg()