QrCode

Encodes a URL or short text into a scannable SVG QR code

Category: display · WCAG 2.2-AA · qr, qr-code, barcode, encode, display

States

Props

PropTypeDefaultDescription
valuestringText or URL to encode
sizenumber128Visual size of the component (e.g. 'sm', 'md', 'lg').
errorCorrection'L' | 'M' | 'Q' | 'H'MHigher levels tolerate more damage but hold less data
radiusstringCSS length rounding the corners
fillstringcurrentColorForeground color of the QR modules.
backgroundstringtransparentBackground color behind the QR code.
labelstringText label for the control.

Design tokens

When to use

When not to use

How to build an accessible QrCode in React →

Examples

URL

<QrCode value="https://cascivo.dev" />

High error correction

<QrCode value="https://cascivo.dev" errorCorrection="H" size={200} />

Custom colors

<QrCode value="cascivo" fill="var(--cascivo-color-accent)" background="var(--cascivo-color-surface)" />

Related components

← Back to docs