# @larscom/ng-qrcode-svg

> Simple QR code generator (SVG only) for Angular

Latest version **3.0.0** (published 2025-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @larscom/ng-qrcode-svg
pnpm add @larscom/ng-qrcode-svg
yarn add @larscom/ng-qrcode-svg
bun add @larscom/ng-qrcode-svg
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2025-11-14 |
| First published | 2022-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 94.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lars Kniep |
| Maintainers | larscom |
| Keywords | qr, qrcode, qr-code, angular, svg, render, image, reactive, simple, easy, print, img, scalable |

## Links

- npm: https://www.npmjs.com/package/@larscom/ng-qrcode-svg
- Repository: https://github.com/larscom/ng-qrcode-svg
- Homepage: https://github.com/larscom/ng-qrcode-svg#readme
- Issues: https://github.com/larscom/ng-qrcode-svg/issues
- npm.io page: https://npm.io/package/@larscom/ng-qrcode-svg

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2025-11-14
- 2.0.1 — 2024-12-19
- 2.0.0 — 2024-12-05
- 1.1.1 — 2024-07-24
- 1.1.0 — 2024-01-04
- 1.0.5 — 2023-12-28
- 1.0.4 — 2023-07-19
- 1.0.3 — 2022-11-05
- 1.0.1 — 2022-11-03
- 1.0.0 — 2022-11-03
- 0.0.1 — 2022-11-01

## README

# @larscom/ng-qrcode-svg

[![npm-version](https://img.shields.io/npm/v/@larscom/ng-qrcode-svg.svg?label=npm)](https://www.npmjs.com/package/@larscom/ng-qrcode-svg)
![npm](https://img.shields.io/npm/dw/@larscom/ng-qrcode-svg)
[![license](https://img.shields.io/npm/l/@larscom/ng-qrcode-svg.svg)](https://github.com/larscom/ng-qrcode-svg/blob/main/LICENSE)

> Simple QR code generator (SVG only) for Angular

![Demo GIF](https://github.com/larscom/ng-qrcode-svg/blob/main/.github/img/demo.gif)

## Installation

```bash
npm install @larscom/ng-qrcode-svg
```

## Usage

1. Import component `QrcodeSvgComponent`

```ts
import { NgModule } from '@angular/core'
import { QrcodeSvgComponent } from '@larscom/ng-qrcode-svg'

@NgModule({
  imports: [QrcodeSvgComponent]
})
export class MyModule {}
```

2. Use the `qrcode-svg` component which will render a QR code in SVG format

```html
<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 |

---
_Source: https://npm.io/package/@larscom/ng-qrcode-svg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
