Home

Awesome

NgxQrcodeGeneratorComponent

This is an Angular component that generates QR codes using the QRious library.

Installation

To use this component, follow these steps:

  1. Install the NgxQrcodeGeneratorComponent library by running the following command:

    npm i ngx-qrcode-generator
    
  2. Import the NgxQrcodeGeneratorComponent into your Angular module:

    import { NgxQrcodeGeneratorComponent } from 'ngx-qrcode-generator';
    
    @NgModule({
      declarations: [NgxQrcodeGeneratorComponent],
      // ...
    })
    export class YourModule { }
    
  3. Use the component in your Angular template:

    <ngx-qrcode-generator
      [background]="'white'"
      [backgroundAlpha]="1.0"
      [foreground]="'black'"
      [foregroundAlpha]="1.0"
      [level]="'L'"
      [mime]="'image/png'"
      [padding]="null"
      [size]="100"
      [value]="'your-QR-code-value'"
      [canvas]="false"
    ></ngx-qrcode-generator>
    

Usage

The NgxQrcodeGeneratorComponent has the following input properties:

Example

Here is an example of using the NgxQrcodeGeneratorComponent:

<ngx-qrcode-generator
  [value]="'https://example.com'"
  [size]="200"
  [foreground]="'#ff0000'"
  [background]="'#ffffff'"
></ngx-qrcode-generator>

In this example, a QR code is generated with the value 'https://example.com', size of 200 pixels, red foreground color ('#ff0000'), and white background color ('#ffffff').

Notes