Join our Discord community
Visualization

QR Code

QR code generator component for React and Next.js applications. Built with TypeScript support, Tailwind CSS styling, and shadcn/ui design featuring SVG rendering, custom colors, and server component support.

Powered by

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/qr-code.json
npx shadcn@latest add https://www.shadcn.io/registry/qr-code.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/qr-code.json
bunx shadcn@latest add https://www.shadcn.io/registry/qr-code.json

Features

  • String-to-QR generation - Convert any text data to QR codes using qrcode library integration
  • SVG rendering - Crisp scalable graphics at any size using JavaScript vector output
  • shadcn/ui theming - CSS variable integration with foreground/background colors using Tailwind CSS
  • Custom colors - Foreground and background color controls using culori library for Next.js projects
  • Error correction - Configurable robustness levels for better scanning reliability using TypeScript props
  • Server components - React Server Component support with manual color props for React applications
  • Open source - Free QR code component with responsive sizing and accessibility features

Examples

Styling

The QR code is wrapped in a div so you can pass in a custom class name to style it.

Loading component...

Robustness

You can change the robustness of the QR code by passing the robustness prop. Higher levels offer a better error resistance but reduce the symbol's capacity.

Loading component...

Server Component

You can also use the QRCode component as a React Server Component, however you'll need to pass in the foreground and background prop manually as hex values.

Loading component...

Use Cases

  • Contact sharing - vCard and contact information distribution
  • URL sharing - Website links and deep linking for mobile apps
  • Authentication - Two-factor auth and secure login processes
  • Payment systems - Cryptocurrency addresses and payment links

Implementation

Built with qrcode library for generation. Uses culori for color processing. SVG output for scalability. Supports both client and server components with theme integration.