Default Page
Grimoire comes packaged with a function to style your page and render your options by default. It returns a decorator which can be applied to your page functions.
from grimoire.templates import default_page
@app.page(start=True)
@default_page("Minimal Example")
def start(state, second):
state.message = "Hello, traveller"
return Div(
P("Hello, Grimoire!")
), [("Go to the second page", second)], state
# Also try changing up some of the colors
@app.page()
default_page(
"Minimal Example",
primary_bg_color="#ff0000",
secondary_bg_color="#00ff00"
font_color="#bbbbbb"
)
def second(state, start):
return Div(
P(f"message: {state.message}")
), [("Start over", start)], state