👋 This is a community-driven shadcn/ui resource. For the official documentation, visit ui.shadcn.com
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.
Installation
npx shadcn@latest add https://www.shadcn.io/registry/qr-code.jsonnpx shadcn@latest add https://www.shadcn.io/registry/qr-code.jsonpnpm dlx shadcn@latest add https://www.shadcn.io/registry/qr-code.jsonbunx shadcn@latest add https://www.shadcn.io/registry/qr-code.jsonFeatures
- 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.
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.
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.
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.
kbd
Keyboard shortcut display component for React and Next.js applications. Built with TypeScript support, Tailwind CSS styling, and shadcn/ui design featuring ARIA labels, custom separators, and modifier key support.
Status
Service status indicator component for React and Next.js applications. Built with TypeScript support, Tailwind CSS styling, and shadcn/ui design featuring automatic colors, ping animations, and customizable labels.