Git Product home page Git Product logo

proficientdesigners / react-qr-code Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rosskhanas/react-qr-code

0.0 0.0 0.0 5.26 MB

A QR code generator for React and React Native.

Home Page: https://rosskhanas.github.io/react-qr-code/

License: MIT License

Shell 1.22% JavaScript 16.20% Ruby 3.12% C++ 17.60% Objective-C 6.02% Java 39.29% Objective-C++ 11.23% Makefile 3.80% Starlark 1.52%

react-qr-code's Introduction

react-qr-code

npm package Dependency Status devDependency Status peerDependency Status

A component for React. This library works with React and React Native (using React Native SVG).

Screenshots

Android & iOS

Installation

yarn add react-qr-code

When using this library with React Native, you will also need to have react-native-svg installed.

yarn add react-native-svg
cd ios && pod install

The Gist

import React from "react";
import ReactDOM from "react-dom";
import QRCode from "react-qr-code";

ReactDOM.render(<QRCode value="hey" />, document.getElementById("Container"));

Note: If the QR code is likely to appear next to dark objects, you will need to wrap it in a light-colored container to preserve the 'quiet zone', e.g.

<div style={{ background: 'white', padding: '16px' }}>
    <QRCode ... />
</div>

Responsive QR code example:

// Can be anything instead of `maxWidth` that limits the width.
<div style={{ height: "auto", margin: "0 auto", maxWidth: 64, width: "100%" }}>
    <QRCode
    size={256}
    style={{ height: "auto", maxWidth: "100%", width: "100%" }}
    value={value}
    viewBox={`0 0 256 256`}
    />
</div>

API

prop type default value
bgColor string '#FFFFFF'
fgColor string '#000000'
level string ('L' 'M' 'Q' 'H') 'L'
size number 256
title string
value string

License

MIT

react-qr-code's People

Contributors

anchengjian avatar azat-io avatar dependabot[bot] avatar greenkeeper[bot] avatar greenkeeperio-bot avatar josh-klimaszewski avatar jzhu1224 avatar lukesdm avatar mercpls avatar onur-eren avatar rosskhanas avatar saadamirpk avatar soonoo avatar trm217 avatar tyler-whitman avatar valentinvoigt avatar yfunk avatar zolbooo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.