Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iang/react-qr-code-generator
Sample react app that shows a QRCode component that can generate and download QR Codes.
https://github.com/iang/react-qr-code-generator
Last synced: 2 days ago
JSON representation
Sample react app that shows a QRCode component that can generate and download QR Codes.
- Host: GitHub
- URL: https://github.com/iang/react-qr-code-generator
- Owner: IanG
- Created: 2024-07-17T10:36:12.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-17T11:42:32.000Z (7 months ago)
- Last Synced: 2024-11-30T11:08:48.071Z (2 months ago)
- Language: TypeScript
- Size: 82 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-qr-code-generator
Simple React application that shows a QRCode component that can generate and download QR Codes.
This component wraps `qrcode.react` so it can be replaced with any other implementation in the future. This component is maintained [here](https://github.com/zpao/qrcode.react). This component exposes additional behaviour which allows users to download the generated QR Code as a `.png` file.
## Usage
To use the component you need to include:
```
import QRCode from "./components/QRCode.tsx";
```Then do create the component:
```
```
Which would render:
![](./doc/images/example-qr-code.jpg)
## Properties
The component has the following properties:
| Name | Type | Default | Description |
|--------------|---------|---------|------------------------------------------------------------------------------------------------------------------------|
| size | number | `100` | Size of the generated QR Code in pixels |
| visible | boolean | `true` | Determines if the QR code component should be visible or not |
| data | string | | The data that should be used to generate the QR Code (e.g. a url) |
| showData | boolean | `false` | True if the component should show the data contained within the generated QR Code |
| downloadable | boolean | `false` | True if the component should show the download button so the user can download the generated QR Code as a `.png` file. |