You can add the following code in the partial class of the MainLayout:
protected override async Task OnAfterRenderAsync(bool firstRender) { if(firstRender) { sidebar0.Toggle(); body0.Toggle(); } }