From be550db8178bda104e3c742e654cfcf8d1e4c37c Mon Sep 17 00:00:00 2001 From: Bunlong Date: Mon, 28 Nov 2022 22:13:23 +0700 Subject: [PATCH] Upgrade version --- CHANGELOG.md | 10 ++++ README.md | 130 +++++++++++++++++++++++++++++++++++++++++++++++++-- package.json | 2 +- 3 files changed, 137 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24b6203..acead1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 2.4.0 (2022-11-29) + +### ✨ Features + + * Add SVG + +Credits + +* [@Bunlong](https://github.com/Bunlong) + ## 2.3.0 (2022-11-14) ### ✨ Features diff --git a/README.md b/README.md index 17177a3..10a8958 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,12 @@ React hooks for generating QR code for your next React apps. ## 🎁 Features -* Render Canvas & Image +* Render Canvas, SVG and Image * Support Numeric, Alphanumeric, Kanji and Byte mode * Support Japanese, Chinese, Greek and Cyrillic characters * Support multibyte characters (like emojis smile) - +[Live Demo](https://next-qrcode.js.org) ## 🔧 Install @@ -215,6 +215,128 @@ export default App; +## 💡 SVG + +### Usage + +```js +import React from 'react'; +import { useQRCode } from 'next-qrcode'; + +function App() { + const { SVG } = useQRCode(); + + return ( + + ); +} + +export default App; +``` + +### SVG props + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropTypeRequireDescription
textstring✔️Text/URL to encode.
optionsoptionsQR code options.
logologoQR code options.
+ +### options + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropTypeDefaultRequireDescription
levelstringMCorrection level. Possible values are low, medium, quartile, high or L, M, Q, H.
marginnumber4Define how much wide the quiet zone should be.
scalenumber4Scale factor. A value of 1 means 1px per modules (black dots).
widthnumber4Forces 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). Note: dark color should always be darker than color.light.
color.lightstring#ffffffffColor of light module. Value must be in hex format (RGBA).
+ ## 💡 Image ### Usage @@ -349,9 +471,9 @@ export default App; ## 📜 Changelog -Latest version 2.3.0 (2022-11-14): +Latest version 2.4.0 (2022-11-29): - * Add logo to canvas + * Add SVG Details changes for each release are documented in the [CHANGELOG.md](https://github.com/Bunlong/next-qrcode/blob/master/CHANGELOG.md). diff --git a/package.json b/package.json index 546c239..8c3545e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "next-qrcode", - "version": "2.3.0", + "version": "2.4.0", "description": "React hooks for generating QR code for your next React apps.", "author": "Bunlong ", "license": "MIT",