Open stonier opened 4 years ago
Hi! Just wanted to say that as the one who implemented set_page_config for title and favicon, I'm also in favor of being able to mutate the page title & favicon later. To help motivate this, use cases (like the one you've already added) are super helpful in convincing the Product team that this is a good idea, so thank you!
This works for me:
import streamlit as st
if 'bam!' not in st.session_state:
st.set_page_config('A boring Title')
else:
st.set_page_config(st.session_state.title, st.session_state.icon)
def bam():
st.session_state['bam!'] = True
st.session_state.title = st.session_state.title_input
st.session_state.icon = st.session_state.icon_input
st.text_input('Page Title', key='title_input')
st.selectbox('Page Icon',[':cake:',':bird:',':cat:',':dog:'], key='icon_input')
st.button('Bam!', on_click=bam)
That's an elegant way, works for me! Thanks.
Problem
Would like to configure the page title at some point after the first streamlit call (i.e. not known up-front what it might be, depends on interactive or URL query params).
Solution
MVP: Smallest possible step has already been implemented, https://github.com/streamlit/streamlit/pull/1794.
Possible additions:
Preferred solution: Additional methods that enable re-configuration of the page title and favicon from anywhere in a streamlit app. e.g. something like:
Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.
If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.