Skip to content

Commit

Permalink
kozakdenys#17 update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Denys Kozak committed May 27, 2021
1 parent e7168c1 commit 773c7dc
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ npm install qr-code-styling
const qrCode = new QRCodeStyling({
width: 300,
height: 300,
type: "svg",
data: "https://www.facebook.com/",
image: "https://upload.wikimedia.org/wikipedia/commons/5/51/Facebook_f_logo_%282019%29.svg",
dotsOptions: {
Expand All @@ -52,6 +53,7 @@ npm install qr-code-styling
});
qrCode.append(document.getElementById("canvas"));
qrCode.download({ name: "qr", extension: "svg" });
</script>
</body>
</html>
Expand All @@ -70,19 +72,20 @@ options|object|Init object

`options` structure

Property |Type |Default Value|Description
-----------------------|------|-------------|-----------------------------------------------------
width |number|`300` |Size of canvas
height |number|`300` |Size of canvas
data |string| |The date will be encoded to the QR code
image |string| |The image will be copied to the center of the QR code
margin |number|`0` |Margin around canvas
qrOptions |object| |Options will be passed to `qrcode-generator` lib
imageOptions |object| |Specific image options, details see below
dotsOptions |object| |Dots styling options
cornersSquareOptions |object| |Square in the corners styling options
cornersDotOptionsHelper|object| |Dots in the corners styling options
backgroundOptions |object| |QR background styling options
Property |Type |Default Value|Description
-----------------------|-------------------------|-------------|-----------------------------------------------------
width |number |`300` |Size of canvas
height |number |`300` |Size of canvas
type |string (`'canvas' 'svg'`)|`canvas` |The type of the element that will be rendered
data |string | |The date will be encoded to the QR code
image |string | |The image will be copied to the center of the QR code
margin |number |`0` |Margin around canvas
qrOptions |object | |Options will be passed to `qrcode-generator` lib
imageOptions |object | |Specific image options, details see below
dotsOptions |object | |Dots styling options
cornersSquareOptions |object | |Square in the corners styling options
cornersDotOptionsHelper|object | |Dots in the corners styling options
backgroundOptions |object | |QR background styling options

`options.qrOptions` structure

Expand Down Expand Up @@ -184,10 +187,10 @@ downloadOptions|object|Options with extension and name of file (not required)

`downloadOptions` structure

Property |Type |Default Value|Description
---------|------------------------------|-------------|-----------------------------------------------------
name |string |`'qr'` |Name of the downloaded file
extension|string (`'png' 'jpeg' 'webp'`)|`'png'` |File extension
Property |Type |Default Value|Description
---------|------------------------------------|-------------|-----------------------------------------------------
name |string |`'qr'` |Name of the downloaded file
extension|string (`'png' 'jpeg' 'webp' 'svg'`)|`'png'` |File extension


### License
Expand Down

0 comments on commit 773c7dc

Please sign in to comment.