Heron.BlazorQRScanner 1.0.1

dotnet add package Heron.BlazorQRScanner --version 1.0.1                
NuGet\Install-Package Heron.BlazorQRScanner -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Heron.BlazorQRScanner" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Heron.BlazorQRScanner --version 1.0.1                
#r "nuget: Heron.BlazorQRScanner, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Heron.BlazorQRScanner as a Cake Addin
#addin nuget:?package=Heron.BlazorQRScanner&version=1.0.1

// Install Heron.BlazorQRScanner as a Cake Tool
#tool nuget:?package=Heron.BlazorQRScanner&version=1.0.1                

Heron.BlazorQRScanner

A simple QR code scanner for Blazor.

The project is basically just a wrapper around the jsQR javascript library.

Getting Started

Install the Heron.BlazorQRScanner package.

dotnet add package Heron.BlazorQRScanner

Add the following to _Imports.razor.

@using Heron.BlazorQRScanner

Usage

The component has 2 properties AutoStart and AutoStop which are both true by default. This means you can simply place the Scanner component on a page and the camera will be opened and scanning started as soon the page is opened. Scanning will stop as soon as a QR Code is found.

A simple implementation looks like this

@if (string.IsNullOrEmpty(_code))
{
    <Scanner CodeFound="CodeFound" />   
}
else
{
    <div>
        Code = @_code
    </div>
}

@code
{
    private string _code = string.Empty;

    private void CodeFound(string code)
    {
        _code = code;
    }
}

Alternatively starting and stopping scanning can be done by calling the Start and Stop methods on the component.

Support

For any issues or feature requests, please open a new issue on GitHub.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 97 11/11/2024
1.0.0 92 10/3/2024
1.0.0-beta.1 59 6/7/2024