You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-qr-code

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-qr-code

A QR code generator for React and React Native.

2.0.18
latest
Source
npmnpm
Version published
Weekly downloads
749K
-1.86%
Maintainers
1
Weekly downloads
 
Created

What is react-qr-code?

The react-qr-code npm package is a simple and efficient library for generating QR codes in React applications. It allows developers to easily create QR codes by providing a URL or text string, which can then be rendered as a QR code image in the application.

What are react-qr-code's main functionalities?

Basic QR Code Generation

This feature allows you to generate a basic QR code by providing a URL or text string. The QR code is rendered as an image in the React component.


import React from 'react';
import QRCode from 'react-qr-code';

const App = () => {
  return (
    <div>
      <QRCode value="https://example.com" />
    </div>
  );
};

export default App;

Customizing QR Code Size

This feature allows you to customize the size of the QR code by specifying the 'size' prop. The QR code will be rendered with the specified dimensions.


import React from 'react';
import QRCode from 'react-qr-code';

const App = () => {
  return (
    <div>
      <QRCode value="https://example.com" size={256} />
    </div>
  );
};

export default App;

Customizing QR Code Colors

This feature allows you to customize the foreground and background colors of the QR code by specifying the 'fgColor' and 'bgColor' props.


import React from 'react';
import QRCode from 'react-qr-code';

const App = () => {
  return (
    <div>
      <QRCode value="https://example.com" fgColor="#0000ff" bgColor="#ffffff" />
    </div>
  );
};

export default App;

Other packages similar to react-qr-code

Keywords

code

FAQs

Package last updated on 06 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts