Client component

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
valuestringNoneThe text or URL to encode. Required.
size"sm" | "md" | "lg" | "xl""md"Preset sizes from 96 to 280px.
pixelSizenumberNoneExplicit size in pixels, overriding the preset.
errorLevel"L" | "M" | "Q" | "H""M"Error correction, from 7% to 30% recoverable. Go higher when an overlay covers modules.
color / bgColorstring"#000000" / "transparent"CSS colors of the modules and the background.
overlay / overlaySizeReactNode / numberNone / 20A centered logo, sized as a percentage of the code.
status"active" | "loading" | "expired" | "scanned""active"Lifecycle overlay.
onRefresh() => voidNoneShows a Refresh button on the expired overlay.
downloadablebooleanfalseAdds a button that downloads the code as an SVG.
downloadFileNamestring"qrcode"File name for the download, without the extension.