Skip to content
Alea0.1

Data display

QRCode

A QR code drawn as SVG, with an optional logo.

Ant Design: QRCode

import { QRCode } from '@alea/ui';

Examples

QRCode

Crisp at any size; show the link as text too.

Scan to open

fun.alevasquez.dev

Props

QRCode props

A QR code drawn as SVG, crisp at any size (Ant's QRCode).

PropTypeDefaultDescription
valuerequiredstring-What the code holds: a URL, text, a Wi-Fi string.
backgroundstring'#ffffff'Background color. Default white.
colorstring'#111011'Colors; dark on light reads best.
labelstring-Describe what it opens, for screen readers. Default "QR code: " + value.
level"L" | "M" | "Q" | "H"'M'Error correction: L, M (default), Q, H. Use H when you put a logo in the middle.
logoReactNode-A logo or icon in the middle (use level H).
sizenumber160Size in px. Default 160.

Accessibility

  • An image named after what it opens; show the link as text too.

Do and don't

Do

  • Show the link as text next to the code too.
  • Keep enough quiet space around it.

Don't

  • Don't put it on a busy background.
  • Don't make it smaller than 128 px for print.
Tested with axe, keyboard and screen reader roles