Skip to main content

Render Target

The playground renders whichever thing was created last: a standalone component or a PrefabApp. Create a PrefabApp after your components and it becomes the output, bringing its theme and mode along. For explicit control, define main() and return whatever you want rendered:
from prefab_ui.app import PrefabApp
from prefab_ui.themes import Presentation
from prefab_ui.components import Column, Heading

def main():
    with Column() as view:
        Heading("Dashboard")
    return PrefabApp(view=view, theme=Presentation(accent="cyan"))
main() always takes priority when your code creates multiple components or apps.

Themes

Themes from PrefabApp apply in the playground the same as in production. The toolbar’s theme picker overrides the code-defined theme when active; selecting “Code” restores it. See the themes docs for Basic, Dashboard, Presentation, and custom themes.