--- ## QRCode Renders any text or URL as a scannable QR code — SVG output, no runtime dependency. The encoder (`encodeQr`, exported alongside) is a from- scratch ISO/IEC 18004 implementation covering numeric / alphanumeric / byte modes, all 40 versions, the four error-correction levels, and automatic mask selection; every generated matrix is verified to round-trip through a real decoder. This completes the auth package's zero-dependency 2FA story: pass an `otpauth://` URI here instead of wiring an external QR library into `TwoFactorManager`'s `qr` snippet. **Import:** `import { QRCode } from '@urbicon-ui/blocks';` ### Examples ```svelte ``` ```svelte ``` ### Api | Prop | Type | Required | Default | Description | | --- | --- | :---: | --- | --- | | value | `string` | yes | | The data to encode — text, a URL, an `otpauth://` URI, etc. | | ...QRCodeVariants | `VariantProps` | no | | Styling variants from QRCodeVariants | | aria-label | `string` | no | | Accessible name announced for the code. Defaults to a localized "QR code". Avoid echoing sensitive payloads (e.g. a 2FA secret) into this label. | | background | `string` | no | 'transparent' | Background fill — any CSS colour. | | class | `string` | no | | Extra classes merged onto the root wrapper. | | errorCorrection | `'L' | 'M' | 'Q' | 'H'` | no | 'M' | Error-correction level: higher levels survive more damage/occlusion at the cost of a denser (larger) code. L≈7%, M≈15%, Q≈25%, H≈30%. | | foreground | `string` | no | 'currentColor' | Colour of the dark modules — any CSS colour. Defaults to `currentColor` so the code inherits the surrounding text colour. For guaranteed scannability keep a high-contrast dark-on-light pairing (see `frame="card"`). | | id | `string` | no | | Id property for the QRCode component | | maxVersion | `number` | no | | Upper bound on the QR version (1–40); encoding throws if the data does not fit. | | minVersion | `number` | no | | Lower bound on the QR version (1–40) to force a minimum size. | | onError | `(error: Error) => void` | no | | Called when the data cannot be encoded (e.g. too long for `maxVersion`). | | preset | `string` | no | | Apply a named preset registered via ``. | | quietZone | `number` | no | 4 | Width of the mandatory light border, in modules. The spec requires ≥4. | | size | `number` | no | 160 | Rendered edge length in pixels (the code is square). | | slotClasses | `Partial>` | no | | Per-slot class overrides merged with tv() styles. Slots: root (what `class` also targets) | svg | fallback. | | unstyled | `boolean` | no | | Remove all default tv() classes — only user-provided classes apply. | Inherited from: - QRCodeVariants (external) ### Types ```ts type SlotNames = keyof ReturnType & string ``` ```ts type VariantProps = Omit< Exclude[0], undefined>, 'class' > ```