How do I set the JS sidebar as hidden at startup?
Hide the sidebar at startup
You can hide the Sidebar element at startup by setting the isOpen property to false.
The isOpen property does not have any effect on the Sidebar rendered with Type set to Auto and by default, the Sidebar will be rendered in open state irrespective of the isOpen property.
For Auto type, set the isOpen property to false by using the created() event. Refer to the following code for hiding the sidebar element.
function onCreate() { //Create instance for sidebar element and set isOpen to false. defaultSidebar.isOpen = false; }
|
For your reference, we have prepared a sample. Refer to the sample link below.
https://stackblitz.com/edit/gmc3bn-i38q5j?file=index.ts
Conclusion
I hope you enjoyed learning about how to set the JS sidebar as hidden at startup.
You can refer to our JavaScript Sidebar feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Sidebar example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!