SolaraS
Solara2y ago
3 replies
animusater

Interact with `Layout` defined in another file

In a file with a defined Page solara component, I can import a defined Layout specified in another file. Just importing is enough to render the page in that layout. However, it does not seem to allow for interacting with the layout; i.e. I cannot pass a "page title" or something similar. I'm curious if it's possible to interact with the Layout beyond being able to define the children, or if perhaps I should be inspecting the children and pulling out which elements I want for particulars parts of the layout?

For example:
# layout.py
import solara

@solara.component
def Layout(children=[]):
  with solara.Column(children=children):
    pass

# some_page.py
import solara
from .layout import Layout

@solara.component
def Page():
  solar.Text("Some page")
Was this page helpful?