by SamProf
@page "/" <MatAppBarContainer style="width: 100%; height: 100%;"> <MatAppBar Fixed="true"> <MatAppBarRow> <MatAppBarSection> <MatIconButton Icon="menu" OnClick="@((e) => ButtonClicked())"></MatIconButton> <MatAppBarTitle>MatBlazor</MatAppBarTitle> </MatAppBarSection> <MatAppBarSection Align="@MatAppBarSectionAlign.End"> <MatIconButton Icon="favorite"></MatIconButton> </MatAppBarSection> </MatAppBarRow> </MatAppBar> <MatAppBarContent > <MatDrawerContainer style="width: 100%; height: 100%;"> <MatDrawer bind-Opened="@Opened"> <MatList> <MatListItem> <MatIcon>favorite</MatIcon> <span style="padding-left: 10px;">Item 1</span> </MatListItem> <MatListItem> <MatIcon>favorite</MatIcon> <span style="padding-left: 10px;">Item 1</span> </MatListItem> <MatListItem> <MatIcon>favorite</MatIcon> <span style="padding-left: 10px;">Item 1</span> </MatListItem> </MatList> </MatDrawer> <MatDrawerContent> <h1>Page Content</h1> <p>MatBlazor comprises a range of components which implement common interaction patterns according to the Material Design specification.</p> </MatDrawerContent> </MatDrawerContainer> </MatAppBarContent> </MatAppBarContainer> @functions { bool Opened = true; void ButtonClicked() { Opened = !Opened; } }
namespace BlazorFiddleProject { using Microsoft.AspNetCore.Components.Builder; using Microsoft.Extensions.DependencyInjection; public class Startup { public void ConfigureServices(IServiceCollection services) { } public void Configure(IComponentsApplicationBuilder app) { app.AddComponent<App>("app"); } } }
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width"> <title>BlazorFiddleProject</title> <style> document, body { margin: 0px; padding: 0px; } app{ display: block; height: 100vh; width: 100vw; } </style> <script type="text/javascript"> </script> </head> <body> <app>Loading...</app> <script src="_framework/blazor.webassembly.js"></script> </body> </html>

Add component

BlazorFiddle was updated from Blazor 0.7 to .NET 6.0. Your old source code could not work. You need to upgrade to latest.