Socket
Socket
Sign inDemoInstall

qrcode.react

Package Overview
Dependencies
7
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    qrcode.react

React component to generate QR codes


Version published
Weekly downloads
1.5M
increased by2.8%
Maintainers
1
Install size
189 kB
Created
Weekly downloads
 

Package description

What is qrcode.react?

The qrcode.react npm package is a React component that uses the 'qrcode-generator' library to render QR codes as SVGs in React applications. It allows for easy creation and customization of QR codes directly within React components.

What are qrcode.react's main functionalities?

Generating a basic QR code

This feature allows you to generate a simple QR code by passing a string as the 'value' prop to the QRCode component.

{"import QRCode from 'qrcode.react';\n\nconst MyComponent = () => (\n  <QRCode value='http://facebook.github.io/react/' />\n);"}

Customizing the QR code

This feature enables customization of the QR code by setting props such as 'size' for dimension, 'bgColor' for background color, 'fgColor' for foreground color, and 'level' for error correction level.

{"import QRCode from 'qrcode.react';\n\nconst MyComponent = () => (\n  <QRCode\n    value='http://facebook.github.io/react/'\n    size={256}\n    bgColor={'#ffffff'}\n    fgColor={'#000000'}\n    level={'H'}\n  />\n);"}

Including a logo or image in the center of the QR code

This feature allows for the inclusion of a logo or image in the center of the QR code. The 'imageSettings' prop can be used to provide the image source and other related settings.

{"import QRCode from 'qrcode.react';\n\nconst MyComponent = () => (\n  <QRCode\n    value='http://facebook.github.io/react/'\n    size={256}\n    bgColor={'#ffffff'}\n    fgColor={'#000000'}\n    level={'H'}\n    includeMargin={true}\n    imageSettings={{\n      src: 'path/to/logo.png',\n      x: null,\n      y: null,\n      height: 24,\n      width: 24,\n      excavate: true,\n    }}\n  />\n);"}

Other packages similar to qrcode.react

Changelog

Source

[0.7.2] - 2017-10-01

Added

  • Added support for React v16

Readme

Source

qrcode.react

A React component to generate QR codes.

Installation

npm install qrcode.react

Usage

var React = require('react');
var QRCode = require('qrcode.react');

React.render(
  <QRCode value="http://facebook.github.io/react/" />,
  mountNode
);

Available Props

proptypedefault value
valuestring
sizenumber128
bgColorstring (CSS color)"#FFFFFF"
fgColorstring (CSS color)"#000000"
levelstring ('L' 'M' 'Q' 'H')'L'

LICENSE ISC

Keywords

FAQs

Last updated on 01 Oct 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc