A QR code generator component that creates scannable QR codes from text, URLs, or other data as SVG graphics. RadzenQRCode supports extensive customization including colors, shapes, error correction, and embedded logos. Encodes data in a two-dimensional barcode format scannable by smartphones and QR code readers. Generates QR codes entirely client-side as SVG, with no external dependencies. Features data encoding (text, URLs, contact info, WiFi credentials, or any string data), error correction levels (Low, Medium, Quartile, High) for different damage resistance, customization of colors for modules (dots) and background with custom shapes (Square, Rounded, Circle), optional logo/image embedding in the center of the QR code, eye styling to customize the appearance of the three corner finder patterns, and responsive size (percentage or pixel-based) for responsive layouts. Higher error correction levels allow the QR code to remain scannable even when partially damaged or obscured (e.g., by a logo). Use Quartile or High error correction when embedding logos.
IComponent
IHandleEvent
IHandleAfterRender
RadzenComponent.SetParametersAsync
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenQRCode : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRenderBasic QR code for URL:
<RadzenQRCode Value="https://radzen.com" Size="200px" />
Customized QR code with logo:
<RadzenQRCode Value="https://example.com" Foreground="#4169E1" Background="#F0F0F0"
Image="logo.png" ImageSizePercent="25" Ecc="RadzenQREcc.High"
ModuleShape="QRCodeModuleShape.Rounded" Size="300px" />A QR code generator component that creates scannable QR codes from text, URLs, or other data as SVG graphics. RadzenQRCode supports extensive customization including colors, shapes, error correction, and embedded logos. Encodes data in a two-dimensional barcode format scannable by smartphones and QR code readers. Generates QR codes entirely client-side as SVG, with no external dependencies. Features data encoding (text, URLs, contact info, WiFi credentials, or any string data), error correction levels (Low, Medium, Quartile, High) for different damage resistance, customization of colors for modules (dots) and background with custom shapes (Square, Rounded, Circle), optional logo/image embedding in the center of the QR code, eye styling to customize the appearance of the three corner finder patterns, and responsive size (percentage or pixel-based) for responsive layouts. Higher error correction levels allow the QR code to remain scannable even when partially damaged or obscured (e.g., by a logo). Use Quartile or High error correction when embedding logos.
public RadzenQRCode()Gets or sets the background color of the QR code. Should contrast well with the foreground color for reliable scanning.
public string Background { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the background color of the QR code. Should contrast well with the foreground color for reliable scanning. |
Gets or sets the error correction level determining how much damage the QR code can sustain while remaining scannable. Higher levels add more redundancy but reduce data capacity. Use High or Quartile when embedding logos.
public RadzenQREcc Ecc { get; set; }
| Type | Description |
|---|---|
| RadzenQREcc | Gets or sets the error correction level determining how much damage the QR code can sustain while remaining scannable. Higher levels add more redundancy but reduce data capacity. Use High or Quartile when embedding logos. |
Optional color for eyes; if empty, falls back to Foreground.
public string EyeColor { get; set; }
| Type | Description |
|---|---|
| string | Optional color for eyes; if empty, falls back to Foreground. |
Optional color for bottom right eye; if empty, falls back to EyeColor.
public string EyeColorBottomLeft { get; set; }
| Type | Description |
|---|---|
| string | Optional color for bottom right eye; if empty, falls back to EyeColor. |
Optional color for top left eye; if empty, falls back to EyeColor.
public string EyeColorTopLeft { get; set; }
| Type | Description |
|---|---|
| string | Optional color for top left eye; if empty, falls back to EyeColor. |
Optional color for top right eye; if empty, falls back to EyeColor.
public string EyeColorTopRight { get; set; }
| Type | Description |
|---|---|
| string | Optional color for top right eye; if empty, falls back to EyeColor. |
Shape for finder eyes (the 3 corner boxes).
public QRCodeEyeShape EyeShape { get; set; }
| Type | Description |
|---|---|
| QRCodeEyeShape | Shape for finder eyes (the 3 corner boxes). |
Shape for top bottom finder eye.
public QRCodeEyeShape? EyeShapeBottomLeft { get; set; }
| Type | Description |
|---|---|
| QRCodeEyeShape? | Shape for top bottom finder eye. |
Shape for top left finder eye.
public QRCodeEyeShape? EyeShapeTopLeft { get; set; }
| Type | Description |
|---|---|
| QRCodeEyeShape? | Shape for top left finder eye. |
Shape for top right finder eye.
public QRCodeEyeShape? EyeShapeTopRight { get; set; }
| Type | Description |
|---|---|
| QRCodeEyeShape? | Shape for top right finder eye. |
Gets or sets the color of the QR code modules (the dark squares/dots). Supports any valid CSS color. Use high contrast with background for best scanability.
public string Foreground { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the color of the QR code modules (the dark squares/dots). Supports any valid CSS color. Use high contrast with background for best scanability. |
URL, data: URI, or raw base64 (will be prefixed) to render in the center.
public string Image { get; set; }
| Type | Description |
|---|---|
| string | URL, data: URI, or raw base64 (will be prefixed) to render in the center. |
Background color under the logo (usually white).
public string ImageBackground { get; set; }
| Type | Description |
|---|---|
| string | Background color under the logo (usually white). |
Background opacity under the logo (0..1). Default 1.
public double ImageBackgroundOpacity { get; set; }
| Type | Description |
|---|---|
| double | Background opacity under the logo (0..1). Default 1. |
Rounded-corner radius for the logo cutout in module units. Default 0.75.
public double ImageCornerRadius { get; set; }
| Type | Description |
|---|---|
| double | Rounded-corner radius for the logo cutout in module units. Default 0.75. |
Extra white padding around the logo in module units. Default 1.
public double ImagePaddingModules { get; set; }
| Type | Description |
|---|---|
| double | Extra white padding around the logo in module units. Default 1. |
Logo box size as % of the inner QR (without quiet zone). Safe range 5�60%. Default 20.
public double ImageSizePercent { get; set; }
| Type | Description |
|---|---|
| double | Logo box size as % of the inner QR (without quiet zone). Safe range 5�60%. Default 20. |
Gets or sets the visual shape of the QR code modules (data squares). Square creates standard QR codes, Rounded creates softer corners, Circle creates dot-based codes.
public QRCodeModuleShape ModuleShape { get; set; }
| Type | Description |
|---|---|
| QRCodeModuleShape | Gets or sets the visual shape of the QR code modules (data squares). Square creates standard QR codes, Rounded creates softer corners, Circle creates dot-based codes. |
Gets or sets the rendered size (both width and height) of the QR code SVG. Accepts CSS units (e.g., "200px", "100%", "10rem"). Use percentage for responsive sizing.
public string Size { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the rendered size (both width and height) of the QR code SVG. Accepts CSS units (e.g., "200px", "100%", "10rem"). Use percentage for responsive sizing. |
Gets or sets the text or data to encode in the QR code. Can be plain text, URLs, contact information (vCard), WiFi credentials, or any string data.
public string Value { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the text or data to encode in the QR code. Can be plain text, URLs, contact information (vCard), WiFi credentials, or any string data. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
Gets the component CSS class.
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
Returns the SVG markup of the rendered QR code as a string.
public Task<string> ToSvg()
| Type | Description |
|---|---|
| Task<string> | A Task<T> representing the asynchronous operation. The task result contains the SVG markup of the QR code. |