Do you have a simple working example using the SideBar component as part of the MainLayout. All of your examples are part of the HUGE demo application and not easily unpacked to be used on its own. I even created a sample Syncfusion Blazor Server application with the SideBar example, but it just embeds into a separate page, which is not what I want.
I want to be able to embed the NavBar component into the SideBar component, and then show/hide that for the entire application, ie. MainLayout.
TIA,
Miles
|
<SfSidebar @ref="sidebarObj" Width="250px" @bind-IsOpen="SidebarToggle">
<ChildContent>
<div style="text-align: center;" class="text-content">
<span>
<NavMenu /><br/>
<SfButton @onclick="Toggle" CssClass="e-btn close-btn">Close Sidebar</SfButton>
</span>
</div>
</ChildContent>
</SfSidebar>
<div id="head">
<SfToolbar>
<ToolbarItems>
<ToolbarItem PrefixIcon="e-tbar-menu-icon tb-icons" TooltipText="Menu" OnClick="Toggle"></ToolbarItem>
</ToolbarItems>
</SfToolbar>
</div>
<div class="text-content e-main-content" style="text-align: center;width:100%;">@Body</div>
...
@code{
SfSidebar sidebarObj;
public bool SidebarToggle = false;
public void Toggle()
{
SidebarToggle = !SidebarToggle;
}
} |
Hi Indhumathy,
Yes, that works quite well actually. Is there a way to keep the hamburger icon menu visible all of the time? So then the user knows it is always there?
TIA,
Miles
|
<SfSidebar @ref="sidebarObj" Width="280px" Type=SidebarType.Push @bind-IsOpen="SidebarToggle" Target="@Target">
<ChildContent>
<NavMenu/>
</ChildContent>
</SfSidebar>
...
...
<div class="maincontent text-content" style="text-align: center;">
@Body
</div>
...
@code{
SfSidebar sidebarObj;
public string Target = ".maincontent"; |