Giter Club home page Giter Club logo

pinguapps / blazor.qrcode Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 2.0 42.07 MB

A Blazor component for generating QR codes. This component encodes specified data into a QR code image, which can be customized in terms of size, colors, and error correction level. The QR code is generated as an SVG for optimal scalability and clarity.

Home Page: https://pinguapps.github.io/Blazor.QRCode/

License: MIT License

C# 14.23% HTML 68.15% CSS 17.62%
asp-net-core aspnet-core aspnetcore blazor blazor-component blazor-components component dotnet qr qr-code

blazor.qrcode's Introduction

PinguApps.Blazor.QRCode

A Blazor component for generating QR codes. This component encodes specified data into a QR code image, which can be customized in terms of size, colors, and error correction level. The QR code is generated as an SVG for optimal scalability and clarity.

NuGet Version NuGet Downloads GitHub Repo stars GitHub Actions Workflow Status CodeFactor Grade

๐ŸŒ Demo

Check out the QRCode component on the demo site!

๐Ÿ”ง Installation

To install the package, you can either install with the following command: Install-Package PinguApps.Blazor.QRCode Or you can search in the Nuget package manager for PinguApps.Blazor.QRCode.

๐Ÿš€ Usage

Once the package is installed, you will want to add the following statement to your _Imports.razor:

@using PinguApps.Blazor.QRCode

Now you can simply use the component:

<QRCode Data="My Data!" Size="150px" />

๐ŸŸฃ Parameters

Data

The data to be encoded into the QR code.

Type Required? Default Value
String โŒ string.Empty

ErrorCorrection

Sets the error correction level for the QR code, which enables it to be decoded even if partially damaged or obscured.

Type Required? Default Value Possible Values
ErrorCorrection โŒ ErrorCorrection.Low ErrorCorrection.Low
ErrorCorrection.Medium
ErrorCorrection.Quartile
ErrorCorrection.High

Size

Sets the width and height of the generated SVG.

Type Required? Default Value Possible Values
String โŒ 100% Any valid html size for width & height

PaddingCells

The number of empty cells as padding around the QR code.

Type Required? Default Value
Int โŒ 1

ForeColor

Sets the foreground color of the QR code.

Type Required? Default Value Possible Values
String โŒ #000000 Any valid html color

BackColor

Sets the background color of the QR code.

Type Required? Default Value Possible Values
String โŒ #ffffff Any valid html color

AriaDescription

Provides an accessible description for the QR code, enhancing usability for screen reader users. This description is used as the aria-label attribute value of the QR code's SVG element, offering context or details about the QR code's content or purpose.

Type Required? Default Value
String โŒ QR Code

Class

Optional CSS class to be applied to the QR code.

Type Required? Default Value
String? โŒ null

Id

Optional ID to be applied to the QR code.

Type Required? Default Value
String? โŒ null

โœ… Features

  • JavaScript-Free: No dependency on JavaScript, ensuring full functionality even in environments where JavaScript is disabled or not supported.
  • Static SSR & Prerendering Compatibility: Seamlessly works with static SSR (Server-Side Rendering) and prerendering scenarios, making it suitable for the static SSR pages of the new .NET Identity template as a 2FA QR code generator.
  • Option to add logo or image: Allows the ability to add your own image to the center of the QR Code. If using this then favour selecting higher error correction values.
  • Adjustable Error Correction: Allows setting the error correction level (Low, Medium, Quartile, High) to make the QR code decodable even when partially damaged or obscured.
  • Dynamic Data Encoding: Capable of encoding provided string data into the QR code, facilitating versatile usage scenarios.
  • Customizable Size: Supports setting the width and height of the generated SVG QR code, with a default of "100%" for flexible integration into various UI designs.
  • Configurable Padding: Allows specifying the number of empty cells as padding around the QR code to adjust its appearance, with a default setting of 1.
  • Foreground and Background Color Customization: Offers options to set the foreground and background colors of the QR code, defaulting to black (#000000) and white (#ffffff), respectively.
  • Accessibility Support: Enhances usability for screen reader users with an accessible description for the QR code, which is used as the aria-label attribute value of the SVG element.
  • Styling Options: Supports optional CSS class and ID attributes for the QR code, enabling further customization and styling flexibility.

blazor.qrcode's People

Contributors

dependabot[bot] avatar pingu2k4 avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

blazor.qrcode's Issues

[Bug] Redundant .sln file in qrcode folder

Describe the bug

There's a duplicat .sln file in src/PinguApps.Blazor.QRCode

Reproduction Steps

...

Expected Behaviour

No response

Screenshots / Examples

No response

.NET version

6.0, 7.0, 8.0

Interactivity Mode

None

Additional Context

No response

[Bug] Dependabot doesn't scan nuget's

Describe the bug

Current nuget file is missing the nugets, as it doesn't scan recursive directories.

Can specify nuget multiple times and reference each directory, but also there should be a fix for multiple directories coming soon accoring to this issue.

Reproduction Steps

...

Expected Behaviour

No response

Screenshots / Examples

No response

.NET version

No response

Interactivity Mode

None

Additional Context

No response

[FEAT] Simplify github actions workflows

Describe the feature

We have 4 workflows, but this should be possible to simplify into 3.

  • PR's
    • build and test
  • changes to main
    • build and test
    • deploy demo site
    • publish nuget (for releases)
  • Release Drafter

Additional Context

No response

[Bug] Example docs and playground links do not work

Describe the bug

The links probably just need . placed in front of the leading /.

Reproduction Steps

...

Expected Behaviour

No response

Screenshots / Examples

No response

.NET version

6.0

Interactivity Mode

Interactive WASM

Additional Context

No response

[Bug] File not supported - Authy app

Describe the bug

Library is working great but for some reason its not working for Authy (did not try microsoft or google) by scanning QR code. I tried to delete spaces or replace them with dashes but its probably not the issue.
4izo kyps 2qx7 wv2l mk45 46xu 272b ni4p
4izokyps2qx7wv2lmk4546xu272bni4p
4izo-kyps-2qx7-wv2l-mk45-46xu-272b-ni4p

I also tried different appearances. I am using it for ASP.NET identity framework.

Thanks.

Reproduction Steps

...

Expected Behaviour

No response

Screenshots / Examples

No response

.NET version

8.0

Interactivity Mode

Interactive Server

Additional Context

No response

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • Update dotnet monorepo (Microsoft.AspNetCore.Components, Microsoft.AspNetCore.Components.Web, Microsoft.AspNetCore.Components.WebAssembly, Microsoft.AspNetCore.Components.WebAssembly.DevServer, Microsoft.AspNetCore.Components.WebAssembly.Server, Microsoft.AspNetCore.Mvc.Testing)

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/main.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-dotnet v4@6bd8b7f7774af54e05809fcc5431931b3eb1ddee
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-dotnet v4@6bd8b7f7774af54e05809fcc5431931b3eb1ddee
  • SteveSandersonMS/ghaction-rewrite-base-href v1@5b54862a8831e012d4f1a8b2660894415fdde8ec
  • JamesIves/github-pages-deploy-action v4@94f3c658273cf92fb48ef99e5fbc02bd2dc642b2
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-dotnet v4@6bd8b7f7774af54e05809fcc5431931b3eb1ddee
.github/workflows/pr.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-dotnet v4@6bd8b7f7774af54e05809fcc5431931b3eb1ddee
.github/workflows/release-drafter.yml
  • release-drafter/release-drafter v6@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348
html
src/BlazorWasmNet6/wwwroot/index.html
  • prism 1.29.0
  • prism 1.29.0
  • prism 1.29.0
  • prism 1.29.0
  • prism 1.29.0
  • prism 1.29.0
  • prism 1.29.0
  • prism 1.29.0
  • prism 1.29.0
  • prism 1.29.0
nuget
src/BlazorAutoNet8/BlazorAutoNet8.Client/BlazorAutoNet8.Client.csproj
  • Microsoft.AspNetCore.Components.WebAssembly 8.0.7
src/BlazorAutoNet8/BlazorAutoNet8/BlazorAutoNet8.csproj
  • Microsoft.AspNetCore.Components.WebAssembly.Server 8.0.7
src/BlazorWasmNet6/BlazorWasmNet6.csproj
  • Microsoft.AspNetCore.Components.WebAssembly.DevServer 6.0.32
  • Microsoft.AspNetCore.Components.WebAssembly 6.0.32
src/PinguApps.Blazor.QRCode/PinguApps.Blazor.QRCode.csproj
  • Net.Codecrete.QrCodeGenerator 2.0.5
  • Net.Codecrete.QrCodeGenerator 2.0.5
  • Net.Codecrete.QrCodeGenerator 2.0.5
tests/PinguApps.Blazor.QRCode.Tests/PinguApps.Blazor.QRCode.Tests.csproj
  • coverlet.collector 6.0.2
  • xunit.runner.visualstudio 2.8.2
  • xunit 2.9.0
  • Verify.Xunit 26.2.0
  • Microsoft.NET.Test.Sdk 17.10.0
  • Microsoft.AspNetCore.Mvc.Testing 8.0.7
  • Microsoft.AspNetCore.Components.Web 8.0.7
  • Microsoft.AspNetCore.Components 8.0.7
  • bunit 1.30.3

  • Check this box to trigger a request for Renovate to run again on this repository

[FEAT] Change to Size

Describe the feature

Change from instead of specifying width AND height, to just size

Additional Context

No response

[FEAT] Add dependabot

Describe the feature

To keep dependencies up to date

Additional Context

No response

[Bug] Demo site builds incorrectly

Describe the bug

incorrect base href

Reproduction Steps

...

Expected Behaviour

No response

Screenshots / Examples

No response

.NET version

6.0

Interactivity Mode

Interactive WASM

Additional Context

No response

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (local>pinguapps/renovate-config)

[FEAT] Add Renovate

Describe the feature

Add renovate to track dependencies

Additional Context

No response

[Bug] Null data can cause a crash

Describe the bug

When Data is null, it can cause a crash. this is true when binding to a string which is created under OnInitializedAsync

Reproduction Steps

  1. Bind Data to a nullable string
  2. Populate the string asyncrounously in OnInitializedAsync
  3. Expect a crash

Expected Behaviour

Doesn't crash

Screenshots / Examples

No response

.NET version

8.0

Interactivity Mode

Static SSR

Additional Context

No response

[FEAT] Add tests

Describe the feature

It would be great if we implemented unit testing

Additional Context

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.