Skip to content

Instantly share code, notes, and snippets.

@toolittlecakes
toolittlecakes / st_fixed_container.py
Last active October 1, 2025 16:03
Sticky/fixed container for streamlit apps. Supports dynamic width change as well as dynamic color updates. Both top/bottom positions are available.
from typing import Literal
import streamlit as st
from streamlit.components.v1 import html
"""
st_fixed_container consist of two parts - fixed container and opaque container.
Fixed container is a container that is fixed to the top or bottom of the screen.
When transparent is set to True, the container is typical `st.container`, which is transparent by default.