2.1.1 • Published 2 years ago

@vkontakte/vk-qr v2.1.1

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

npm NPM Build Status

VK-QR

JavaScript library for generating SVG code of VK-style QR codes.

Usage

Install via yarn

yarn add @vkontakte/vk-qr

or npm

npm install @vkontakte/vk-qr

And use in your code

import vkQr from '@vkontakte/vk-qr';

// Returns SVG code of generated 256x256 QR code with VK logo
const qrSvg = vkQr.createQR('Text to encode', {
  qrSize: 256,
  isShowLogo: true
});

API Reference

Syntax

generatedSvgCode = vkQr.createQR(text[, qrOptions]);

Parameters

  • text required String to generate a QR code

  • options optional An options object containing any custom settings that you want to apply to the generated QR code. The possible options are:

    • qrSize: Size of QR code. Default is 128

    • className: Class name of root SVG element

    • isShowLogo: Show VK logo in center of QR code Default is false

    • isShowBackground: Show QR background. Default is false

    • backgroundColor: QR code background HEX color. Works if isShowBackground is enabled. Default is "#ffffff"

    • foregroundColor: QR code HEX color

    • logoColor: Color of logo. Default is "#4680c2"

    • logoData: Reference to logo as a reference IRI

    • suffix: SVG elements id postfix

    • ecc: ECC level in range 0-3 (0 - low, 3 - high)

Return value

A string with SVG code.

License

The code is available under the MIT license.

2.1.1

2 years ago

2.0.13

4 years ago

2.0.12

4 years ago

2.0.10

5 years ago

2.0.9

6 years ago

2.0.9-beta.1

6 years ago

2.0.8

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago