streamlit/streamlit · error · StreamlitAPIException

`st.bottom` cannot be used inside `st.sidebar`. The bottom c

Error message

`st.bottom` cannot be used inside `st.sidebar`. The bottom container is only available in the main app area.

What it means

Error "`st.bottom` cannot be used inside `st.sidebar`. The bottom container is only available in the main app area." thrown in streamlit/streamlit.

Source

Thrown at lib/streamlit/elements/bottom.py:54

    """

    _bottom_dg: DeltaGenerator

    def __init__(self, bottom_dg: DeltaGenerator) -> None:
        # Use object.__setattr__ to avoid triggering __getattr__
        object.__setattr__(self, "_bottom_dg", bottom_dg)

    def _check_context(self) -> None:
        """Raise StreamlitAPIException if st.bottom is used in an invalid context."""
        current_stack = context_dg_stack.get()
        if not current_stack:
            return

        current_dg = current_stack[-1]
        root_container = current_dg._root_container

        if root_container == RootContainer.SIDEBAR:
            raise StreamlitAPIException(
                "`st.bottom` cannot be used inside `st.sidebar`. "
                "The bottom container is only available in the main app area."
            )
        # Check for dialog first since dialogs use EVENT root container
        # but should get a more specific error message
        if "dialog" in current_dg._ancestor_block_types:
            raise StreamlitAPIException(
                "`st.bottom` cannot be used inside a dialog. "
                "The bottom container is only available in the main app area."
            )
        if root_container == RootContainer.EVENT:
            raise StreamlitAPIException(
                "`st.bottom` cannot be used inside event containers. "
                "The bottom container is only available in the main app area."
            )

    def __getattr__(self, name: str) -> Any:
        self._check_context()

View on GitHub (pinned to 202661fc55)

When it happens

Trigger: Thrown at lib/streamlit/elements/bottom.py:54 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of streamlit/streamlit@202661fc55 (2026-08-26). Data as JSON: /api/errors/65a72d9a249ce046. Report an issue: GitHub.