https://github.com/encoresky/qrcode-generator
Easy and simple way to generate QR code
https://github.com/encoresky/qrcode-generator
qr qr-code qr-generator qrcode qrcode-generator react react-qr react-qr-code-generator react-qrcode-generator reactjs web-app-qr
Last synced: 3 months ago
JSON representation
Easy and simple way to generate QR code
- Host: GitHub
- URL: https://github.com/encoresky/qrcode-generator
- Owner: encoresky
- License: mit
- Created: 2022-12-26T12:10:15.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-03T08:41:47.000Z (almost 3 years ago)
- Last Synced: 2025-06-20T07:54:27.977Z (4 months ago)
- Topics: qr, qr-code, qr-generator, qrcode, qrcode-generator, react, react-qr, react-qr-code-generator, react-qrcode-generator, reactjs, web-app-qr
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/react-easy-qrcode-generator
- Size: 31.3 KB
- Stars: 28
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React Easy QR-Code Generator
Easilty generate QR code from any text or url. It is based on [QR Server API](https://goqr.me/api/doc/create-qr-code/).
## 💡 Features
- Generate QR code for any text and url.
- Small and lightweight.
- Works on all platforms Web, Android and iOS.
## 🔧 Installation
```bash
npm i react-easy-qrcode-generator # npm
yarn add react-easy-qrcode-generator # yarn
```
## 🖥️ Example
[](https://codesandbox.io/s/beautiful-ives-56h5f3?file=/src/App.js)
## 🖥️ Preview

## 📦 Usage
```tsx
import React, { useState } from "react";
import { qrcodeGenerator } from "react-easy-qrcode-generator";
export default function App() {
const [value, setValue] = useState("");
return (
setValue(e.target.value)} />
qrcodeGenerator({
value: value,
size: "180x180",
title: "Title",
qrAlt: "QR Code Image",
showQrId: "qr-code",
})
}
>
Generator QR
);
}
```
## 👀 API References
#### Functions
```
qrcodeGenerator({value, size, title, qrAlt, showQrId})
```
Takes the following parameters:
| Parameter | Type | Default value | Description |
| :--------- | :------- | :------------------------ | :----------- |
| `value` | `string` | `null` | **Required** |
| `size` | `string` | `180x180` | **Optional** |
| `title` | `string` | `React easy QR generator` | **Optional** |
| `qrAlt` | `string` | `React easy QR image` | **Optional** |
| `showQrId` | `string` | `null` | **Required** |
| `color` | `string` | `0-0-0` | **Optional** |
| `bgcolor` | `string` | `255-255-255` Valid examples for color and bgcolor: 255-0-0 (red),f00 (red), FF0000 (red), 0-255-0 (green), 0f0 (green), 00ff00 (green), 0-0-255 (blue), 00f (blue), 0000ff (blue), 556B2F (DarkOliveGreen) | **Optional** |
## 📜 License
[MIT](https://github.com/encoresky/qrcode-generator/blob/main/LICENSE)