Skip to main content

Streamlit-Themes

The streamlit-themes package provides a streamlined way to customize the visual appearance of Streamlit applications.

Note: This package accesses the internal config at st._config, and is likely to break with future Streamlit updates. Use with caution. Also, updating the theme with streamlit-themes updates the theme for the entire Streamlit app (including all users), so it's not suitable for multi-user apps.

Installation

To install the streamlit-themes package, simply use pip:

pip install streamlit-themes

Demo

Alt Text

Basic Usage

Here's a basic example of how to use the streamlit-themes package:

import streamlit_themes as st_theme

# Set a custom theme
st_theme.set_theme(
    background_color='#FFFFFF',
    primary_color='#1A73E8',
    secondary_background_color='#F1F3F4',
    text_color='#202124',
    font='sans serif'
)

Functions

The following functions are available directly through the __init__.py file:

  • get_theme: retrieves the current theme settings.
  • set_theme: Sets the theme with given parameters.
  • get_preset_theme: Retrieves a preset theme.
  • set_preset_theme: Sets a preset theme.
  • get_all_preset_themes: Retrieves all preset themes.
  • custom_theme_widget: Creates a custom theme widget for user interaction.
  • preset_theme_widget: Creates a preset theme widget for user interaction.
  • Theme: Dataclass for storing themes.

Here are the preset theme keys available in the constants.py file:

Preset Themes

The streamlit-themes package provides a set of preset keys that can be used to quickly apply predefined themes.

Available Preset Keys

  • Beach
  • Pineapple
  • Peachy
  • Tropical
  • Mater
  • Gastly
  • Ocean
  • Abyssal
  • Green
  • Sandy
  • Sunset
  • Midnight

Example Usage

import streamlit_themes as st_theme

# Directly apply a preset theme
st_theme.set_preset_theme('Beach')

Metadata

Release files for streamlit-themes 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-themes 0.1.0
File Size Uploaded Provenance
streamlit_themes-0.1.0.tar.gz 8.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-themes 0.1.0
File Interpreter ABI Platform
streamlit_themes-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / streamlit_themes-0.1.0.tar.gz

Download URL streamlit_themes-0.1.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
32b428379cfef9285cdbac1dac12e63a9df7f8fe6d286983841e3826e60fdbe3
BLAKE2b-256 checksum
How to use checksums
7588695c868eed5784e4c34e8b90869d8ff837a86237b11d720786bd1e29ac2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.2

Release files / streamlit_themes-0.1.0-py3-none-any.whl

Download URL streamlit_themes-0.1.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
379d571d2887bb21bbe0851fb315ffb3f755843a1e5937e54b8256ddb0b38432
BLAKE2b-256 checksum
How to use checksums
c4ba7137a687488cff04041c961384011d6a96c4a2ab0959209dbd2557bfd2db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.11.2

Security for streamlit-themes 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page