Socket
Socket
Sign inDemoInstall

react-qrcode-logo

Package Overview
Dependencies
7
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-qrcode-logo

React component to generate a QR Code customizable with logo and more properties


Version published
Maintainers
1
Install size
312 kB
Created

Readme

Source

Typescript React component to generate a customizable QR Code.

Installation

npm install --save react-qrcode-logo

Usage

import * as React from 'react';
import { QRCode } from 'react-qrcode-logo';

React.render(
  <QRCode value="https://github.com/gcoro/react-qrcode-logo" />,
  mountNode
);

Props

PropTypeDefault valueDescription
valuestringhttps://reactjs.org/The value encoded in the QR Code. When the QR Code is decoded, this value will be returned
ecLevelL | M | Q | HMThe error correction level of the QR Code
enableCORSbooleanfalseEnable crossorigin attribute
sizenumber (in pixels)150The size of the QR Code
quietZonenumber (in pixels)10The size of the quiet zone around the QR Code. This will have the same color as QR Code bgColor
bgColorstring (css color)#FFFFFFBackground color
fgColorstring (css color)#000000Foreground color
logoImagestring (src attribute)The logo image. It can be a url/path or a base64 value
logoWidthnumber (in pixels)size * 0.2Logo image width
logoHeightnumber (in pixels)logoWidthLogo image height
logoOpacitynumber (css opacity 0 <= x <= 1)1Logo opacity. This allows you to modify the transparency of your logo, so that it won't compromise the readability of the QR Code
qrStylesquares | dotssquaresStyle of the QR Code modules

Example

You can find a very simple demo project here.

Contributing

Thanks to everyone who contributed :) PRs and suggestions are welcome.

gcoro
gcoro

JChord
JChord

mushang11
mushang11

halitogunc
halitogunc

Trexy94
Trexy94

ty-everett
ty-everett

More credits

This package was inspired by cssivision/qrcode-react and zpao/qrcode.react. Also looked up some parts from kazuhikoarase/qrcode-generator (which this package depends on).

Keywords

FAQs

Last updated on 01 Apr 2021

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