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#
| Prop | Type | Default |
|---|---|---|
value | string | "https://ui.minidev.pro" |
size | number | 200 |
level | QrLevel | "M" |
fg | string | "currentColor" |
bg | string | "transparent" |
margin | number | 2 |
logoScale | number | 0.24 |
mask | number | - |
caption | string | - |
download | boolean | true |
fileName | string | "qr-code.svg" |
bare | boolean | false |
title | string | - |
children | React.ReactNode | - |
className | string | - |
Dependencies#
npm
lucide-react
Built from
Related media components#
Audio PlayerMinimal React audio player row with a play and pause toggle, title, subtitle and an accessible progress bar. Controlled, so it works with any audio source.AvatarShadcn compatible avatar on Base UI with image and initials fallback, three sizes, a status badge and an overlapping avatar group with a plus count.CarouselScroll snap React carousel with previous and next buttons, arrow key support and a labelled region. Shows one, two or three slides by breakpoint, no library.File ListA stacked list of file rows showing each name and metadata such as size or date, with an optional download button per item. Good for React attachment lists.File RowA single file row with an icon, a truncated name, an optional meta line and a ghost download button with an accessible label. Styled with Tailwind.Image GalleryA responsive photo grid of square tiles, two columns on mobile and three on larger screens, each image cropped to fill. Built with React and Tailwind.
All media and upload components