@page "/"
@page "/MatAppBarFrame"
<MatDrawerContainer Style="width: 100vw; height: 100vh;">
<MatHidden Breakpoint="@MatBreakpoint.SM" Direction="@MatHiddenDirection.Up">
<ChildContent>
<MatDrawer @bind-Opened="@Opened" Mode="@MatDrawerMode.Modal">
Drawer Content
</MatDrawer>
</ChildContent>
<ElseContent>
<MatDrawer @bind-Opened="@Opened" Mode="@MatDrawerMode.Dismissible">
Drawer Content
</MatDrawer>
</ElseContent>
</MatHidden>
<MatDrawerContent>
<MatAppBarContainer>
<MatAppBar Fixed="true">
<MatAppBarRow>
<MatAppBarSection>
<MatIconButton Icon="menu"></MatIconButton>
<MatAppBarTitle>MatBlazor - Material Design components for Blazor</MatAppBarTitle>
</MatAppBarSection>
<MatAppBarSection Align="@MatAppBarSectionAlign.End">
<MatIconButton Icon="favorite"></MatIconButton>
</MatAppBarSection>
</MatAppBarRow>
</MatAppBar>
<MatAppBarContent>
Content
</MatAppBarContent>
</MatAppBarContainer>
<div>
<MatButton OnClick="@((e) => ButtonClicked())">
@if (Opened)
{
<span>Hide Menu</span>
}
else
{
<span>Open Menu</span>
}
</MatButton>
</div>
<p>Page Content</p>
</MatDrawerContent>
</MatDrawerContainer>
@code
{
bool Opened = true;
void ButtonClicked()
{
Opened = !Opened;
}
}