1.3.2 • Published 2 years ago

react-qrcode-pretty v1.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-qrcode-pretty

pages-build-deployment downloads npm

Qrcode generator website

Qrcode generator for react apps with many customization options.

Installation

Run the command below in the terminal to install react-qrcode-pretty in your project

npm i react-qrcode-pretty

Or with Yarn

yarn add react-qrcode-pretty

QrCode Props

PropTypeDefaultDetails
valuestringQrcode payload (required)
sizenumberautoSize of the qrcode without margin and padding
resizenumberundefinedResize ready qrcode with CSS
colorstring { 'eyes': string, 'body': string }'#000000'Foreground color for the entire qrcode or for each part (eyes and body) of the qrcode
modeNumeric Alphanumeric Byte Kanji'Byte'Mode that payload (value) will be logged
levelL M Q H'M'Error correction level
modules[0-40]0Number of qrcode modules. 0 is auto
imagestringundefinedLocation (src) of an image to be inserted into the center of the qrcode
imageBigbooleanfalseImage to be displayed in full size
overlapbooleanfalseFor the image to overlay the qrcode without cropping it
marginnumber0Margin size. Area without background color
paddingnumber0Padding size. Area with background color
variantstandard rounded dots fluid reverse shower gravity morse { 'eyes': variant, 'body': variant }'standard'Style applied to the entire qrcode or each part (eyes and body) of it
dividerbooleanfalseActive a small separation between the qrcode body points
bgColorstring'#FFFFFF'Background color
bgRoundedbooleanfalseBackground color rounded
childrenReact.ReactNodeundefinedThe canvas tag children
canvasPropsReact.HTMLAttributes<HTMLCanvasElement>{}The canvas attributes
onReady(canvas : HTMLCanvasElement) => voidundefinedProvides canvas properties and methods when available.

Code Example

import { QrCode } from "react-qrcode-pretty";

export default function QrCodeCustom() {

    return (

        <QrCode
            value="react-qrcode-pretty"
            variant={{
                eyes: 'gravity',
                body: 'fluid'
            }}
            color={{
                eyes: '#223344',
                body: '#335577'
            }}
            padding={ 20 }
            margin={ 30 }
            bgColor="#ddeeff"
            bgRounded
            divider
        />

    );

}

Qrcode Examples

Qrcode example Qrcode example Qrcode example Qrcode example

Author

License

This project is under the MIT license - see file LICENSE for details.

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.1.0-beta

2 years ago

0.1.0

2 years ago