1.0.3 • Published 1 year ago

solid-qr v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Installation

Yarn

yarn add solid-qr

PNPM

pnpm add solid-qr

NPM

npm i solid-qr

Usage

import SolidQR from "solid-qr"
// or
import { SolidQR } from "solid-qr"

const Example = () => {
  return <SolidQR text="Hello World"/>
}

Configuration

The solid-qr component receives the same props as a regular img would, plus two custom ones used to generate the QR code.

  1. text: A string used to generate the QR Code.
  2. options: An object with the following structure
KeyTypeDefaultDescription
versionnumberQR Code version ranging from 1 to 40. If not specified the more suitable value will be calculated.
errorCorrectionLevellow \| medium \| quartile \| highmediumQR Code error correction level
maskPattern1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7Mask pattern used to mask the symbol. If not specified the more suitable value will be calculated.
marginnumber2Define how much wide the quiet zone should be.
scalenumber4Scale factor. A value of 1 means 1px per modules (black dots).
widthnumber512Forces a specific width for the output image.If width is too small to contain the qr symbol, this option will be ignored.Takes precedence over scale.
color.darkstring#000000ffColor of dark module. Value must be in hex format (RGBA).
color.lightstring#ffffffffColor of light module. Value must be in hex format (RGBA).
1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago