Qr Code

A React QR code component with its own encoder: byte mode, versions 1 to 40, four error correction levels, crisp SVG in currentColor, a logo well and an SVG download button.

src/registry/ui/qr-code.tsx/r/qr-code.json

Installation#

bash
npx shadcn@latest add @minidev/qr-code

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/qr-code.json

Usage#

tsx
import { QrCode } from "@/components/ui/qr-code"

export function Example() {
  return <QrCode />
}

API reference#

QrCode props
PropTypeDefault
valuestring"https://ui.minidev.pro"
sizenumber200
levelQrLevel"M"
fgstring"currentColor"
bgstring"transparent"
marginnumber2
logoScalenumber0.24
masknumber-
captionstring-
downloadbooleantrue
fileNamestring"qr-code.svg"
barebooleanfalse
titlestring-
childrenReact.ReactNode-
classNamestring-

Dependencies#

npm

lucide-react

Built from

All media and upload components

Learn more