QR Code

Client-side SVG QR codes with logo overlays, lifecycle states and download.

Import#

import { QrCode } from "astralis-ui";

Overlays and states#

overlay centers a logo on the code (raise errorLevel to "H" so the covered modules stay scannable). The status prop covers the login-QR lifecycle: loading, expired (with a refresh action), and scanned.

overlay + download
A
expired → refresh
Expired
scanned
Scanned!

Props#

PropTypeDefaultDescription
valuestringrequiredThe text or URL to encode.
size"sm" | "md" | "lg" | "xl""md"Preset pixel sizes (96–280px).
pixelSizenumberExplicit size, overriding the preset.
errorLevel"L" | "M" | "Q" | "H""M"Error correction (7–30%); go high with overlays.
color / bgColorCSS colors"#000" / transparentModule and background colors.
overlay / overlaySizeReactNode / number— / 20Centered logo, sized as % of the code.
status"active" | "loading" | "expired" | "scanned""active"Lifecycle overlay.
onRefresh() => voidShows a Refresh button on the expired overlay.
downloadable / downloadFileNameboolean / stringfalse / "qrcode"SVG download button.