What is Blazor Hybrid in MAUI and when would you use it?
Short answer
Blazor Hybrid hosts Blazor (Razor) components in a BlazorWebView inside a native MAUI app, running .NET locally (not on a server) with full native API access. Use it to reuse web UI/components across web and native, or when your team prefers HTML/CSS.
Advertisement
AModel answer
Blazor Hybrid hosts Blazor (Razor) components in a BlazorWebView inside a native MAUI app, running .NET locally (not on a server) with full native API access. Use it to reuse web UI/components across web and native, or when your team prefers HTML/CSS. You can mix Blazor and native MAUI pages in one app.
<BlazorWebView HostPage="wwwroot/index.html">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type local:Main}" />
</BlazorWebView.RootComponents>
</BlazorWebView>Real-world example
A company reuses its Blazor component library to build the mobile app's UI while still calling native device APIs.
Likely follow-ups
- Does Blazor Hybrid need a server? | Can you mix native and Blazor pages?
Related topics