Use st.popover to keep secondary controls out of the main layout until a user needs them. It displays a small popup panel opened by clicking an associated button, similar to an expander. section 9.7.1 section 9.8
Put game settings behind a Settings button
Wrap an editor in a context manager: `with st.popover("Settings", use_container_width=True):`. Place `st.data_editor` inside the block and return its edited settings. Users see a compact Settings control, open it when needed, and adjust Quizmaster or Difficulty without occupying the main page. section 9.7.1
Build the interaction in three steps:
- Choose the trigger label, such as Settings. section 9.7.1
- Write the popup contents inside `with st.popover(...)`. section 9.7.1
- Use the returned editor value elsewhere, such as updating a game's settings and its question prompt. section 9.7.1
+----------------+------------+ | Quizmaster | Difficulty | +----------------+------------+ | Alex Trebek | Medium | +----------------+------------+
A compact settings table illustrates the kind of content users can reveal inside the popup. section 9.7.1
