We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Default Sidebar to closed on page load

Thread ID:

Created:

Updated:

Platform:

Replies:

149427 Nov 26,2019 05:49 AM UTC Mar 10,2021 01:02 PM UTC Blazor 3
loading
Tags: Sidebar
Nick
Asked On November 26, 2019 05:49 AM UTC

Hey there,

Does anyone know how to default the Sidebar to closed when the page first loads?

I have tried doing it in the load and initialize events of the page but nothing seems to work.

Cheers
Nick

Sowmiya Padmanaban [Syncfusion]
Replied On November 27, 2019 01:12 PM UTC

Hi Nick, 
  
Thanks for contecting Syncfusion support. 
  
We have analyzed your requirement to close the sidebar element during initial rendering. In that case, you have to set the sidebar element type as “Push”. In that case, the sidebar is rendered in closed state. When you set type as Push in sidebar element, it will open sidebar in push mode even in mobile and desktop.  
Refer the below code snippet. 
<EjsSidebar Width="250px" @ref="sidebarObj" Type=SidebarType.Push> 
    <ChildContent> 
        <div style="text-align: center;" class="text-content"> Sidebar </div> 
    </ChildContent> 
</EjsSidebar> 
 
 

To know more about the sidebar type, Refer the below link. 
  
Please let us know, if you have any concerns. 
  
Regards, 
Sowmiya.P 


Frank
Replied On March 7, 2021 08:16 PM UTC

How does one make a docked sidebar display in the closed position on initial load of the page.  As shown here:

 

Sowmiya Padmanaban [Syncfusion]
Replied On March 10, 2021 01:02 PM UTC

Hi Frank, 
 
You can enable the Dock by setting the EnableDock property and DockSize for Sidebar component.  
 
Note: Dock Sidebar is not applicable to the Sidebar type as Auto. 
 
<SfSidebar @ref="sidebarObj" Width="220px" DockSize="72px" Type=SidebarType.Slide EnableDock=true @bind-IsOpen="SidebarToggle"> 
    <ChildContent> 
    </ChildContent> 
</SfSidebar> 
 
 
Please, refer to the sample link:  
 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon