← All Components
<mth-qr-code>
Zero-dependency deterministic SVG QR Code generator (ISO/IEC 18004 Byte mode with Reed-Solomon ECC) and accessible label.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-qr-code>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/qr-code"></script>
<mth-qr-code size="160" error-correction="L"></mth-qr-code>import '@methane-ui/ui/qr-code';
import '@methane-ui/react';
export function Example() {
return <mth-qr-code size="160" error-correction="L"></mth-qr-code>;
}<script setup lang="ts">
import '@methane-ui/ui/qr-code';
</script>
<template>
<mth-qr-code size="160" error-correction="L"></mth-qr-code>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/qr-code';
import { MthQrCodeDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthQrCodeDirective],
template: `<mth-qr-code size="160" error-correction="L"></mth-qr-code>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/qr-code';
import MthQrCode from '@methane-ui/svelte/MthQrCode.svelte';
</script>
<MthQrCode size="160" error-correction="L"></MthQrCode>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Payload string encoded into the QR code. |
label | label | string | "" | Accessible alternative text describing what the QR code links to or encodes. |
size | size | number | 160 | Rendered square inline/block dimension in CSS pixels. |
errorCorrection | error-correction | 'L' | 'M' | 'Q' | 'H' | "M" | QR Reed-Solomon error correction level (L, M, Q, or H). |
quietZone | quiet-zone | number | 2 | Quiet-zone border width in QR modules. |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| i18n | Routes 2 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |