Routing

Use the @app.sistine() decorator to register a route:

python
from sistine import Sistine, el

app = Sistine(title="My App")

@app.sistine("/")
def home():
    return str(el.h1("Home Page"))

@app.sistine("/user/{user_id}")
def profile(user_id: int):
    return str(el.h1(f"User {user_id}"))

Query Parameters

You can access standard URL query parameters (e.g. ?sort=asc&page=2) directly from Streamlit's experimental API:

python
import streamlit as st

@app.sistine("/search")
def search():
    query_params = st.query_params
    sort_order = query_params.get("sort", "desc")
    
    return str(el.div()(
        el.h1(f"Search Results (Sorted: {sort_order})")
    ))

Client-side Navigation

Navigate via the ?route= query parameter using Sistine's router:

python
# This automatically changes the route without full page reload
el.a(href="/?route=/user/42")("Go to User 42")