Default Sidebar to closed on page load
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
SIGN IN To post a reply.
6 Replies
SP
Sowmiya Padmanaban
Syncfusion Team
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> |
Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazorApp21536433884.zip
To know more about the sidebar type, Refer the below link.
Please let us know, if you have any concerns.
Regards,
Sowmiya.P
FR
Frank
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:
SP
Sowmiya Padmanaban
Syncfusion Team
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
RA
Rajib
May 8, 2025 11:27 AM UTC
Thanks this works
RA
Rajib
May 8, 2025 11:27 AM UTC
Thanks this works
FL
Florence Lilian Awino
Syncfusion Team
May 23, 2025 05:29 AM UTC
Hi Rajib,
We are glad your issue was resolved. If you need further assistance, please don't hesitate to contact us.
SIGN IN To post a reply.
- 6 Replies
- 5 Participants
-
NI Nick
- Nov 26, 2019 05:49 AM UTC
- May 23, 2025 05:29 AM UTC