Soenneker.Maui.Blazor.Bridge 3.0.23

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Maui.Blazor.Bridge --version 3.0.23                
NuGet\Install-Package Soenneker.Maui.Blazor.Bridge -Version 3.0.23                
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="Soenneker.Maui.Blazor.Bridge" Version="3.0.23" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Soenneker.Maui.Blazor.Bridge --version 3.0.23                
#r "nuget: Soenneker.Maui.Blazor.Bridge, 3.0.23"                
#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 Soenneker.Maui.Blazor.Bridge as a Cake Addin
#addin nuget:?package=Soenneker.Maui.Blazor.Bridge&version=3.0.23

// Install Soenneker.Maui.Blazor.Bridge as a Cake Tool
#tool nuget:?package=Soenneker.Maui.Blazor.Bridge&version=3.0.23                

alternate text is missing from this package README image Soenneker.Maui.Blazor.Bridge

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Effortlessly integrate MAUI components within BlazorWebView, enabling seamless interaction between Blazor and native MAUI UI elements.


🚀 Features

✅ Embed MAUI components directly inside BlazorWebView like HTML elements.
✅ Maintain a structured overlay system for native elements.
✅ Provides typed and generic bridges for flexible component integration.


📦 Installation

Install the package via NuGet:

dotnet add package Soenneker.Maui.Blazor.Bridge

Register the interop in CreateMauiApp:

public static MauiApp CreateMauiApp()
{
    var builder = MauiApp.CreateBuilder();
    builder.Services.AddMauiBlazorBridgeAsScoped();
}

🛠️ Layout Setup

To integrate MAUI components within BlazorWebView, modify your MainPage.xaml.
Wrap the BlazorWebView inside a Grid, and include an AbsoluteLayout (OverlayContainer) to host native elements:

<Grid>
    
    <BlazorWebView x:Name="blazorWebView"
                   HostPage="wwwroot/index.html">
        <BlazorWebView.RootComponents>
            <RootComponent Selector="#app" ComponentType="{x:Type local:Routes}" />
        </BlazorWebView.RootComponents>
    </BlazorWebView>

    
    <AbsoluteLayout x:Name="OverlayContainer" BackgroundColor="Transparent" />
</Grid>

This setup ensures that MAUI-native elements overlay correctly within your BlazorWebView.


⚡ Usage

To bridge MAUI elements into Blazor, use either:

  • MauiBlazorTypedBridge<T> (Typed binding)
  • MauiBlazorGenericBridge (Generic binding)

🏗️ Example: Embedding a MauiLabel in Blazor

@page "/"

@implements IAsyncDisposable

<MauiBlazorTypedBridge @ref="_bridge" TComponent="MauiLabel" Component="_label"></MauiBlazorTypedBridge>

@code {
    MauiLabel? _label;
    MauiBlazorTypedBridge<MauiLabel>? _bridge;

    protected override void OnInitialized()
    {
        _label = new MauiLabel 
        { 
            Text = "This is a MAUI Label", 
            BackgroundColor = Colors.Transparent, 
            TextColor = Colors.Black 
        };
    }

    public async ValueTask DisposeAsync()
    {
        if (_bridge != null)
            await _bridge.DisposeAsync();
    }
}

This example adds a MauiLabel component inside a Blazor page, allowing it to function within the BlazorWebView.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.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
3.0.24 77 3/4/2025
3.0.23 71 3/4/2025
3.0.22 85 3/3/2025
3.0.21 85 3/3/2025
3.0.20 65 3/3/2025
3.0.19 101 3/3/2025
3.0.18 79 3/3/2025
3.0.17 83 3/2/2025
3.0.15 81 3/2/2025
3.0.14 80 3/2/2025
3.0.13 84 3/2/2025
3.0.12 82 3/2/2025
3.0.11 80 3/2/2025
3.0.10 85 3/2/2025
3.0.9 76 3/2/2025
3.0.8 76 3/2/2025
3.0.7 77 3/1/2025
3.0.6 76 3/1/2025
3.0.5 79 3/1/2025
3.0.4 84 3/1/2025
3.0.3 86 3/1/2025
3.0.2 77 3/1/2025
3.0.1 70 3/1/2025