Sidebar open state? #373
-
I'm having trouble with adjusting the default layout in terms of the initial sidebar state, and I'm not sure what I'm doing wrong here. What I want is for the default sidebar state to be closed, so I would expect(perhaps incorrectly), that I could either set sidebar_open=False in a AppLayout call somewhere in the page, or create a layout function that's called with the page. I've tried all sorts of variations, but in all of them the sidebar_open=False appears to be ignored. This is the quick and dirty test code I was using. With the sharedlayout(False) within the page, I get a sidebar as expected, but its default state is open. Changing the call to True makes no difference and removing it altogether has the expected effect of removing the sidebar and leaving just the card.
Swapping the Sidebar and Applayout contexts does collapse the sidebar, but on click of the hamburger it's a floating window and not an inline sidebar. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, good question.
What you do, is add an new AppLayout in an already existing applayout, which by default will use the 'embedded' mode similar to what you see on https://solara.dev/docs/howto/layout . This is because you can't really have two sidebars on one page. Does this make sense? Did you managed to find this page in the documentation, and if so, what should we change according to you to make this more clear? Regards, Maarten |
Beta Was this translation helpful? Give feedback.
Hi,
good question.
Similar to https://solara.dev/docs/howto/layout you can define you own layout, but now override the sidebar_open default argument:
What you do, is add an new AppLayout in an already existing applayout, which by default will use the 'embedded' mode similar to what you see on https://solara.dev/docs/howto/layout . This is because you can't really have two sidebars on one page.
Does this make sense? Did you managed to find this page in the documentation, and if so, what should we change according to…