Sidebar
Puts its children in the sidebar of the AppLayout (or any layout that supports it).
@solara.component
def Sidebar(children=[]):
...
This component does not need to be a direct child of the AppLayout, it can be at any level in your component tree.
On the solara.dev website and in the Jupyter notebook, the sidebar is shown in a dialog instead (embedded mode)
Example showing a sidebar (embedded mode)
import solara
@solara.component
def Page():
with solara.Column() as main:
with solara.Sidebar():
solara.Markdown("## I am in the sidebar")
solara.SliderInt(label="Ideal for placing controls")
solara.Info("I'm in the main content area, put your main content here")
return main
I'm in the main content area, put your main content here
Example
The sidebar can only be shown in embedded mode on this page. Visit the Scatter app demo to see an example of a full sidebar used in Soalra server.