Awesome
@larscom/ng-qrcode-svg
Simple QR code generator (SVG only) for Angular
Installation
npm install @larscom/ng-qrcode-svg
Usage
- Import component
QrcodeSvgComponent
import { NgModule } from '@angular/core'
import { QrcodeSvgComponent } from '@larscom/ng-qrcode-svg'
@NgModule({
imports: [QrcodeSvgComponent]
})
export class MyModule {}
- Use the
qrcode-svg
component which will render a QR code in SVG format
<qrcode-svg value="hello world!"></qrcode-svg>
Component Properties
Name | Description | Default |
---|---|---|
@Input() value: string | The value which need to be encoded | undefined |
@Input() ecl: 'low' | 'medium' | 'quartile' | 'high' | Error correction level | medium |
@Input() borderSize: number | The padding between the edge and the QR code (quiet zone) | 2 |
@Input() size: string | number | The size of the QR code SVG (css format) | 250px |
@Input() backgroundColor: string | The 'path' color (background) | #FFFFFF |
@Input() foregroundColor: string | The 'rect' color (foreground) | #000000 |
@Input() alt: string | undefined | HTML alt attribute | undefined |
@Input() ariaLabel: string | undefined | HTML aria-label attribute | undefined |