• Stars
    star
    402
  • Rank 107,380 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

React + Typescript component to generate a QR Code with custom colors and logo

react-qrcode-logo

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

Prop Type Default value Description
value string https://reactjs.org/ The value encoded in the QR Code. When the QR Code is decoded, this value will be returned
ecLevel L | M | Q | H M The error correction level of the QR Code
enableCORS boolean false Enable crossorigin attribute
size number (in pixels) 150 The size of the QR Code
quietZone number (in pixels) 10 The size of the quiet zone around the QR Code. This will have the same color as QR Code bgColor
bgColor string (css color) #FFFFFF Background color
fgColor string (css color) #000000 Foreground color
logoImage string (src attribute) The logo image. It can be a url/path or a base64 value
logoWidth number (in pixels) size * 0.2 Logo image width
logoHeight number (in pixels) logoWidth Logo image height
logoOpacity number (css opacity 0 <= x <= 1) 1 Logo opacity. This allows you to modify the transparency of your logo, so that it won't compromise the readability of the QR Code
logoOnLoad () => void Callback function to know when the logo in the QR Code is loaded
removeQrCodeBehindLogo boolean false Removes points behind the logo. If no logoPadding is specified, the removed part will have the same size as the logo
logoPadding number Adds a border with no points around the logo. When > 0, the padding will be visible even if the prop removeQrCodeBehindLogo is not set to true
logoPaddingStyle square | circle square Sets the shape of the padding area around the logo
qrStyle squares | dots squares Style of the QR Code modules
eyeRadius CornerRadii | CornerRadii[] The corner radius for the positional patterns (the three "eyes" around the QR code). See more details here
eyeColor EyeColor | EyeColor[] The color for the positional patterns (the three "eyes" around the QR code). See more details here
id string react-qrcode-logo Optional custom id for the QRCode canvas. You can use this prop if you have multiple QRCodes and need to differentiate them

Usage example

You can find a very simple demo project here.

Contributing

PRs and suggestions are welcome. When making a pull request, please explain in a clear way the changes you made and why you are making them (+ if you can also update the README accordingly, ty <3). Also try keep the current repo codestyle (eg. do not reformat all the code with prettier).

Thanks to everyone who contributed and/or will contribute :)

gcoro
gcoro

jgillick
jgillick

dos1in
dos1in

halitogunc
halitogunc

qwei-1874
qwei-1874

Trexy94
Trexy94

ty-everett
ty-everett

larstel
larstel

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).

More Repositories

1

QRCodeCustomizer

Example project for react-qrcode-logo package
TypeScript
21
star
2

gibs-leaflet

Module that integrates NASA GIBS Imagery with Leaflet
JavaScript
5
star
3

StartupDesignLab-B-Real

Progetto svolto dal gruppo B(e)Real per il progetto di Gestione di Imprese. Consiste nella progettazione di una startup, dalla generazione dell'idea al pitch di presentazione agli investitori.
4
star
4

WebTechnologies-LLSIF

The group project that me and my team made for Web Technologies exam, during the third year of university. It's an XHTML strict website, focusing on accessibility and usability.
HTML
4
star
5

GameOff2019-PASTFUTURE

Endless runner game. Our entry for Game Off 2019
C#
3
star
6

AlexaSkill-ScopriManga

Lambda for Alexa Skill "Scopri Manga"
JavaScript
3
star
7

hashcode2019

Our solution for slideshow problem; Hashcode 2019; Prosciutto&Funghi team
JavaScript
3
star
8

CryoInsight

Web app that lets you search through a vast database of glaciers/snow packs, and view their position on the map (plus some info and photos of them).
JavaScript
3
star
9

Database-SchoolIdolFestivalDB

Project for my Database course, done during the second year of university. It's a MySQL database.
SQLPL
2
star
10

italian-words-to-numbers

Javascript library to translate Italian written numbers to its numeric value
JavaScript
2
star
11

SWE-CommandLineTeam-Documentation

Documentazione prodotta dal gruppo CommandLine per il progetto di Ingegneria del Software, a.a. 2017/2018
1
star
12

OOP-BibliotecaScolastica

The project I made for my Object-Oriented Programming exam, during the second year of university. It's a school library search system.
C++
1
star
13

Flutter-stuff

Some stuff and sample projects I used to learn Flutter.
Dart
1
star