st-theme
A component that returns the active theme of the Streamlit app.
Decision gist · record as of 2026-08-14
Yes, with conditions. Install if you need to detect and respond to Streamlit's active theme in your app and can work around the known initial-load timing issue by providing a fallback. The low install friction, permissive license, and stable classifier make it straightforward to add. However, the 833-day maintenance gap means no recent bug fixes or Streamlit version updates—verify compatibility with your Streamlit version before relying on it in production.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Streamlit 1.20+.
- The CSS adjustment feature depends on browser support for the :has pseudo-class; initial theme detection may return None on first load due to a known browser-dependent timing issue.
- Low friction: pure Python wheel with only streamlit as a runtime dependency.
License · maintenance · safety
MIT License (permissive) — MIT License (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2024-05-03 (833 days) · last repo commit 2024-08-16 · 16 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 314,184 downloads/mo, #7,703 on PyPI
Alternatives
Verify before relying
pip install st-theme
import streamlit as st
from st_theme import st_theme
theme = st_theme()
st.write(theme)- Whether the known timing bug (theme returning None on initial load) has been resolved in version 1.2.3
- Current compatibility with Streamlit versions beyond 1.20 given 833 days since last release
- Whether the :has pseudo-class browser compatibility limitation affects a significant portion of target users
What it is and what it does
st-theme is a Streamlit component that queries the active theme of a running Streamlit app and returns it as a dictionary of style settings. It integrates directly into a Streamlit app's frontend to detect whether the user has selected light or dark mode, and updates the returned value whenever the user manually changes the theme after the app is running.
The package is designed to be lightweight and non-intrusive: by default it applies a CSS adjustment to remove the empty space that Streamlit normally reserves for rendered components, since st-theme only communicates with the frontend and renders nothing visible. This behavior can be disabled via the adjust parameter if it conflicts with your app's layout. The main gotcha is a known browser-dependent timing issue where the theme may not be returned immediately on first load, though it updates normally when the user switches themes afterward.
Use it for
- Dynamically style a Streamlit app's custom content based on whether the user has selected light or dark mode
- Detect the initial theme setting to apply a fallback configuration when st-theme returns None on first load
- Build theme-aware custom components that respond to the active Streamlit theme without requiring manual user input
- Log or track theme preferences in a Streamlit analytics or monitoring system
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Install if you need to detect and respond to Streamlit's active theme in your app and can work around the known initial-load timing issue by providing a fallback. The low install friction, permissive license, and stable classifier make it straightforward to add. However, the 833-day maintenance gap means no recent bug fixes or Streamlit version updates—verify compatibility with your Streamlit version before relying on it in production.
Install
st-theme on PyPI
Before you install
Low friction: pure Python wheel with only streamlit as a runtime dependency. Maintenance is dormant—last release was 833 days ago and the repository shows no recent activity, though it remains unarchived and marked Production/Stable.
Requires Streamlit 1.20+. The CSS adjustment feature depends on browser support for the :has pseudo-class; initial theme detection may return None on first load due to a known browser-dependent timing issue.
License in practice
MIT License (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install st-theme
import streamlit as st
from st_theme import st_theme
theme = st_theme()
st.write(theme)
Verify before relying
- Whether the known timing bug (theme returning None on initial load) has been resolved in version 1.2.3
- Current compatibility with Streamlit versions beyond 1.20 given 833 days since last release
- Whether the :has pseudo-class browser compatibility limitation affects a significant portion of target users
Package facts
| License | MIT License permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagestreamlit |
| Maintenance | Dormant 833 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 314,184 / month, #7,703 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Web EnvironmentIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Database :: Front-EndsTopic :: Office/Business :: Financial :: SpreadsheetTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: VisualizationTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Widget Sets |
Evidence: st_theme-1.2.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “streamlit theme detection”
- st-themeDetects and returns the active theme (light or dark) of a running…
- streamlit-cookies-controllerProvides read, write, and delete operations on browser cookies from a…
- streamlit-js-evalStreamlit-js-eval lets you run arbitrary JavaScript expressions from…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also streamlit-autorefresh · streamlit-sortables · darkdetect · streamlit-avatar · streamlit-keyup · st-annotated-text · streamlit-notify · streamlit-pdf · streamlit-plotly-events · streamlit-image-coordinates