{"library":"st-theme","title":"Streamlit Theme Component","type":"library","description":"st-theme is a Streamlit component that enables Python applications to retrieve the active theme settings (e.g., colors, font) of the Streamlit app. It is currently at version 1.2.3 and maintains an active development cadence with several minor releases per year, ensuring compatibility and bug fixes.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install st-theme"],"cli":null},"imports":["from streamlit_theme import st_theme"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/gabrieltempass/streamlit-theme","docs":"https://github.com/gabrieltempass/streamlit-theme","changelog":"https://github.com/gabrieltempass/streamlit-theme/releases","pypi":"https://pypi.org/project/st-theme/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import streamlit as st\nfrom streamlit_theme import st_theme\n\nst.set_page_config(layout=\"centered\", page_title=\"Theme Demo\")\n\nst.title(\"Current Streamlit Theme\")\nst.markdown(\"--- \")\n\ntheme = st_theme()\n\nif theme:\n    st.success(\"Theme successfully fetched!\")\n    st.write(\"Here are the active theme settings:\")\n    st.json(theme)\n    st.info(f\"Primary Color: {theme.get('primaryColor', 'N/A')}\")\n    st.info(f\"Background Color: {theme.get('backgroundColor', 'N/A')}\")\nelse:\n    st.warning(\"Theme could not be fetched immediately. This is a known browser-dependent issue upon initial load. Try changing the theme manually (light/dark mode) or refresh the page. A default theme is used as a fallback for display purposes.\")\n    # Provide a default or handle the None case gracefully\n    default_theme = {\n        \"base\": \"light\",\n        \"primaryColor\": \"#F63366\",\n        \"backgroundColor\": \"#FFFFFF\",\n        \"secondaryBackgroundColor\": \"#F0F2F6\",\n        \"textColor\": \"#262730\",\n        \"font\": \"sans serif\"\n    }\n    st.write(\"Displaying a fallback default theme:\")\n    st.json(default_theme)\n    st.info(\"Using a default light theme as a fallback for display.\")","lang":"python","description":"This quickstart demonstrates how to import and use the `st_theme` component to display the active theme settings of your Streamlit application. It also includes a robust way to handle the scenario where the theme might not be immediately available upon initial page load, providing a fallback.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"1.2.3","pypi_latest":"1.2.3","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":15.8,"avg_import_s":1.34,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"st-theme","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.47,"mem_mb":24.6,"disk_size":"445.0M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"st-theme","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":16.2,"import_time_s":0.6,"mem_mb":19.9,"disk_size":"414M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"st-theme","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":2.06,"mem_mb":26.4,"disk_size":"465.7M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"st-theme","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":15.4,"import_time_s":1.06,"mem_mb":21.8,"disk_size":"434M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"st-theme","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.94,"mem_mb":26.1,"disk_size":"449.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"st-theme","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":14.7,"import_time_s":1.27,"mem_mb":21.1,"disk_size":"418M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"st-theme","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.92,"mem_mb":26.3,"disk_size":"448.1M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"st-theme","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":15,"import_time_s":1.18,"mem_mb":21.8,"disk_size":"416M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"st-theme","exit_code":0,"wheel_type":"sdist","failure_reason":null,"import_side_effects":"noisy","install_time_s":null,"import_time_s":1.35,"mem_mb":19.7,"disk_size":"429.8M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"st-theme","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"noisy","install_time_s":17.6,"import_time_s":0.58,"mem_mb":15,"disk_size":"408M"}]}}