QRCode

QR code generator with rounded finder patterns and dot-style data modules.

qrcode

Installation

pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/s/qrcode.json

Usage

<script lang="ts">	import { QRCode } from "#lib/components/spell/qrcode/index.js";</script>
<QRCode value="https://sv-animations.vercel.app" />

Examples

Custom Colors

Override the foreground, background, size, and error-correction level to fit branded tickets, packaging, or event cards.

Props

NameTypeDefaultDescription
valuestringrequiredThe encoded text or URL used to generate the QR code.
sizenumber268Controls the rendered width and height of the SVG in pixels.
fgColorstring"var(--foreground)"Sets the foreground color used for the modules and finder patterns.
bgColorstring"var(--background)"Sets the background color of the QR surface.
errorCorrectionLevel"L" | "M" | "Q" | "H""M"Controls the QR error correction level passed to the generator.
classClassValue''Custom classes merged onto the root SVG element.