bhavitvyamalik's picture
multiapp
54dc7b4
raw
history blame contribute delete
417 Bytes
import streamlit as st
class MultiApp:
def __init__(self, state):
self.apps = []
self.state = state
def add_app(self, title, func):
self.apps.append({"title": title, "function": func})
def run(self):
st.sidebar.header("Go To:")
app = st.sidebar.radio(
"", self.apps, format_func=lambda app: app["title"]
)
app["function"](self.state)