Skip to content
Shiny Controls v1.0 - The Ultra Control Suite for .NET MAUI & BlazorO...M...G!

Barcodes & QR Codes

Shiny.Maui.Controls.Barcodes and Shiny.Blazor.Controls.Barcodes are separate add-on packages that render 1D and 2D barcodes — including QR codes — using ZXing.Net. The PNG path uses a pure-managed, AOT-safe encoder built into the package: no SkiaSharp, no System.Drawing — so the exact same code ships clean on iOS, Android, Mac Catalyst, Windows, and Blazor WebAssembly.

There are three ways to produce a barcode, all backed by the same encoder:

Approach Where it lives Use it when
MAUI viewsBarcodeView, QRCodeView Shiny.Maui.Controls.Barcodes You want a barcode on a XAML page
Blazor componentsBarcodeView, QRCodeView Shiny.Blazor.Controls.Barcodes You want a barcode in a Razor component (SVG or PNG)
Headless BarcodeRenderer Shiny.Controls.Barcodes (shared) You need raw PNG bytes / SVG / data URI with no UI — PDFs, emails, label printing, services
  • NuGet downloads for Shiny.Maui.Controls.Barcodes
  • NuGet downloads for Shiny.Blazor.Controls.Barcodes
Frameworks
.NET MAUI
Blazor

MAUI

QR Code Barcode symbology gallery

Blazor

QR code Symbology gallery
QR code on Blazor Symbology gallery on Blazor
Changed files
  • MyApp/
MyApp.csproj
MyApp.csproj
1<Project Sdk="Microsoft.NET.Sdk">2	<PropertyGroup>3		<BaseTargetFramework>net10.0</BaseTargetFramework>4		<TargetFrameworks>$(TargetFrameworks);$(BaseTargetFramework)-ios</TargetFrameworks>5		<TargetFrameworks>$(TargetFrameworks);$(BaseTargetFramework)-android</TargetFrameworks>6		<!--useful for unit testing - not enabled by default since it can cause issues and callout projects that don't support target-->7		<!--<TargetFrameworks Condition="'$(CI)' != 'true'">$(TargetFrameworks);$(BaseTargetFramework)</TargetFrameworks>-->8	9		<RootNamespace>MyApp</RootNamespace>10		<SingleProject>true</SingleProject>11		<ImplicitUsings>enable</ImplicitUsings>12		<Nullable>enable</Nullable>13		<ApplicationTitle>MyApp</ApplicationTitle>14		<ApplicationId>com.companyname.app</ApplicationId>15		<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>16		<ApplicationVersion>1</ApplicationVersion>17		18		<MauiXamlInflator>SourceGen</MauiXamlInflator>19		<!--uncomment below for XAML expressions in net10-->20		<!--<EnablePreviewFeatures>true</EnablePreviewFeatures>-->2122		<MauiVersion>10.0.90</MauiVersion>23		<ShinyVersion>5.5.0</ShinyVersion>24		<ShinyControlsVersion>1.2.0</ShinyControlsVersion>25		<ShinyShellVersion>6.3.2</ShinyShellVersion>26		<ShinyDocumentDbVersion>13.4.0</ShinyDocumentDbVersion>27		<ShinyMauiHostingVersion>5.1.5</ShinyMauiHostingVersion>28		<ShinyExtensionsVersion>5.1.5</ShinyExtensionsVersion>29		<ShinyHttpServerVersion>1.0.4</ShinyHttpServerVersion>30		<ShinySpeechVersion>3.0.0-beta-0030</ShinySpeechVersion>31		<ShinySpatialVersion>2.0.0</ShinySpatialVersion>32		<ShinyHealthVersion>2.0.1</ShinyHealthVersion>33		<ShinyMusicVersion>4.1.0</ShinyMusicVersion>34		<ShinyObdVersion>1.1.0</ShinyObdVersion>35		<ShinyRecognitionVersion>1.0.0-beta-0006</ShinyRecognitionVersion>3637		<EnableAotAnalyzer>true</EnableAotAnalyzer>38        <EnableTrimAnalyzer>true</EnableTrimAnalyzer>39        <EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>4041	</PropertyGroup>4243	<!-- If you want to enable AOT for iOS, uncomment the below. Note that this will cause a significant increase in build time, but will result in faster runtime performance and smaller app size. You can also enable it for just Release builds if you prefer.44	<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' and '$(Configuration)' == 'Release'">45        <PublishAot>true</PublishAot>46    </PropertyGroup>47	-->4849	<PropertyGroup Condition="'$(TargetFramework)' != '$(BaseTargetFramework)'">50		<OutputType>Exe</OutputType>51		<UseMaui>true</UseMaui>52		<DefineConstants>$(DefineConstants);PLATFORM</DefineConstants>53	</PropertyGroup>5455	<PropertyGroup Condition="'$(TargetFramework)' == '$(BaseTargetFramework)'">56		<OutputType>Library</OutputType>57		<UseMaui>false</UseMaui>58	</PropertyGroup>5960	<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">61		<SupportedOSPlatformVersion>26.0</SupportedOSPlatformVersion>62		<TargetPlatformVersion>36</TargetPlatformVersion>63		<!--64		<EmbedAssembliesIntoApk Condition="'$(Configuration)' == 'Debug'">true</EmbedAssembliesIntoApk>65		<AndroidPackageFormats Condition="'$(Configuration)' == 'Release'">aab</AndroidPackageFormats>66		<AndroidLinkTool>r8</AndroidLinkTool>67		<AndroidLinkTool>proguard</AndroidLinkTool>68		-->69    </PropertyGroup>7071	<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' AND '$(Configuration)' == 'Debug'">72        <!--forces the simulator to pickup entitlements-->73        <EnableCodeSigning>true</EnableCodeSigning>74        <CodesignRequireProvisioningProfile>true</CodesignRequireProvisioningProfile>75        <DisableCodesignVerification>true</DisableCodesignVerification>76    </PropertyGroup>7778	<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">79		<SupportedOSPlatformVersion>15.0</SupportedOSPlatformVersion>80		<DefineConstants>$(DefineConstants);APPLE</DefineConstants>	81	</PropertyGroup>8283	<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' OR $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">84		<BundleResource Include="Platforms\iOS\PrivacyInfo.xcprivacy" LogicalName="PrivacyInfo.xcprivacy" />85		86		<CustomEntitlements Include="keychain-access-groups" Type="StringArray" Value="%24(AppIdentifierPrefix)$(ApplicationId)" Visible="false" />87	</ItemGroup>8889	<ItemGroup>90		<TrimmerRootDescriptor Include="Linker.xml" Condition="'$(Configuration)' == 'Release'" />9192		<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />93		<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />9495		<MauiImage Include="Resources\Images\*" />96		<MauiFont Include="Resources\Fonts\*" />97		<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />98	</ItemGroup>99100	<ItemGroup>101		<PackageReference Include="Shiny.Extensions.MauiHosting" Version="$(ShinyMauiHostingVersion)" />102		<PackageReference Include="Shiny.Maui.Controls.Barcodes" Version="$(ShinyControlsVersion)" />103		<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />104		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.10" Condition="'$(Configuration)' == 'Debug'" />105	</ItemGroup>106107	<ItemGroup Condition="'$(TargetFramework)' != '$(BaseTargetFramework)'">108		<PackageReference Include="Shiny.Hosting.Maui" Version="$(ShinyVersion)" />109	</ItemGroup>110111</Project>
  • 13 symbologiesQRCode, Aztec, DataMatrix, Pdf417, Code128, Code39, Code93, Codabar, Ean8, Ean13, UpcA, UpcE, Itf. See Symbologies.
  • QRCodeView shortcut — locks Format = QRCode, exposes a single square Size property, and adds ErrorCorrection (Low / Medium / Quartile / High).
  • Pure-managed PNG encoder — custom zlib + CRC32 + Adler32 implementation; no SkiaSharp / System.Drawing dependency.
  • Inline SVG on Blazor — single-<path> output with shape-rendering="crispEdges", scales infinitely without aliasing, stays tiny in the DOM.
  • Configurable foreground / background colors — hex on the shared options, MAUI Color on the MAUI views, CSS strings on Blazor.
  • Headless APIBarcodeRenderer.RenderPng / RenderSvg / RenderDataUri for use from view models, services, PDF builders, etc.
  • AOT-safe — pure managed code, no dynamic codegen, no reflection-only types.
claude plugin marketplace add shinyorg/skills
claude plugin install shiny@shiny

One plugin installs all 35 Shiny skills. Your agent loads only the skill relevant to what you're building, so there's no cost to having them all available.

copilot plugin marketplace add https://github.com/shinyorg/skills
copilot plugin install shiny@shiny

One plugin installs all 35 Shiny skills. Your agent loads only the skill relevant to what you're building, so there's no cost to having them all available.

View shiny-controls Skill
Terminal window
dotnet add package Shiny.Maui.Controls.Barcodes
xmlns:bc="http://shiny.net/maui/barcodes"

No DI registration is required — the views are plain ContentViews.

Terminal window
dotnet add package Shiny.Blazor.Controls.Barcodes
@using Shiny.Blazor.Controls.Barcodes
@using Shiny.Controls.Barcodes
<!-- 1D / 2D — pick any supported Format -->
<bc:BarcodeView Value="5901234123457"
Format="Ean13"
PixelWidth="400"
PixelHeight="150" />
<!-- QR code shortcut -->
<bc:QRCodeView Value="https://shinylib.net"
Size="300"
ErrorCorrection="High" />
<!-- SVG output (default) — crisp at any CSS size -->
<BarcodeView Value="5901234123457" Format="BarcodeFormat.Ean13" />
<!-- QR shortcut -->
<QRCodeView Value="https://shinylib.net" Size="300"
QRErrorCorrection="QRErrorCorrection.High" />
using Shiny.Controls.Barcodes;
byte[] png = BarcodeRenderer.RenderPng("https://shinylib.net", BarcodeFormat.QRCode);