{"id":15501674,"url":"https://github.com/pgarrett-scripps/streamlitthemes","last_synced_at":"2026-02-06T16:07:41.652Z","repository":{"id":245035429,"uuid":"817068313","full_name":"pgarrett-scripps/StreamlitThemes","owner":"pgarrett-scripps","description":"A python package for dynamically updating a streamlit pages theme","archived":false,"fork":false,"pushed_at":"2024-06-19T04:56:34.000Z","size":5857,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T19:05:18.824Z","etag":null,"topics":["streamlit","streamlit-component","streamlit-components","streamlit-web","streamlit-webapp","theme","themes"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pgarrett-scripps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-19T00:46:33.000Z","updated_at":"2025-02-20T07:15:16.000Z","dependencies_parsed_at":"2024-06-19T07:39:22.002Z","dependency_job_id":"5d873887-0ea1-4ad2-b301-a533aa18fcf9","html_url":"https://github.com/pgarrett-scripps/StreamlitThemes","commit_stats":null,"previous_names":["pgarrett-scripps/streamlitthemes"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pgarrett-scripps/StreamlitThemes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgarrett-scripps%2FStreamlitThemes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgarrett-scripps%2FStreamlitThemes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgarrett-scripps%2FStreamlitThemes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgarrett-scripps%2FStreamlitThemes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgarrett-scripps","download_url":"https://codeload.github.com/pgarrett-scripps/StreamlitThemes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgarrett-scripps%2FStreamlitThemes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265326963,"owners_count":23747651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["streamlit","streamlit-component","streamlit-components","streamlit-web","streamlit-webapp","theme","themes"],"created_at":"2024-10-02T09:05:18.203Z","updated_at":"2026-02-06T16:07:41.618Z","avatar_url":"https://github.com/pgarrett-scripps.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Streamlit-Themes\n\nThe `streamlit-themes` package provides a streamlined way to customize the visual appearance of Streamlit applications. \n\n**Note:** This package accesses the internal config directly at `st._config`, which is sort of a hack.\nUse with caution. Also, updating the theme with `streamlit-themes` updates the theme for the entire Streamlit app\n(including all users), so it's not suitable for multi-user apps.\n\n## Installation\n\nTo install the `streamlit-themes` package, simply use pip:\n\n```bash\npip install streamlit-themes\n```\n\n## Setup\n\nIf there is no custom theme provided in the .streamlit/config.toml file, then the getter functions\nwill return None values upon startup, and the custom color widget will default to a black values. \nTo avoid this, it's best to specify as custom theme in the .streamlit/config.toml file. For example:\n\n```toml\n[theme]\nprimaryColor=\"#3282B8\"\nbackgroundColor=\"#f1f0e8\"\nsecondaryBackgroundColor=\"#eee0c9\"\ntextColor=\"#45474b\"\nfont=\"sans serif\"\n```\n\n## Demo\n\n![Alt Text](demo.gif)\n\n## Basic Usage\n\nHere's a basic example of how to use the `streamlit-themes` package:\n\n```python\nimport streamlit_themes as st_themes\n\n# Set a custom theme\nst_themes.set_theme(\n    background_color='#FFFFFF',\n    primary_color='#1A73E8',\n    secondary_background_color='#F1F3F4',\n    text_color='#202124',\n    font='sans serif'\n)\n```\n\n## Functions\n\nThe following functions are available directly through `streamlit-themes`:\n\n```python\nimport streamlit_themes as st_themes\n```\n\n- **`get_theme`**: Retrieves the current theme settings.\n  ```python\n  current_theme = st_themes.get_theme()\n  ```\n\n- **`set_theme`**: Sets the theme with specified parameters (background color, primary color, secondary background color, text color, font).\n  ```python\n  st_themes.set_theme(\n      background_color='#FFFFFF',\n      primary_color='#1A73E8',\n      secondary_background_color='#F1F3F4',\n      text_color='#202124',\n      font='sans serif'\n  )\n  ```\n\n- **`get_preset_theme`**: Retrieves the settings of a specified preset theme.\n  ```python\n  preset_theme = st_themes.get_preset_theme('Beach')\n  ```\n\n- **`set_preset_theme`**: Applies a specified preset theme.\n  ```python\n  st_themes.set_preset_theme('Beach')\n  ```\n\n- **`get_all_preset_themes`**: Retrieves all available preset themes.\n  ```python\n  all_presets = st_themes.get_all_preset_themes()\n  ```\n\n- **`custom_theme_widget`**: Creates a Streamlit widget for customizing and applying themes.\n  ```python\n  st_themes.custom_theme_widget()\n  ```\n\n- **`preset_theme_widget`**: Creates a Streamlit widget for selecting and applying preset themes.\n  ```python\n  st_themes.preset_theme_widget()\n  ```\n  \n- **`Theme`**: A class that represents a theme with background color, primary color, secondary background color, text color, and font attributes.\n  ```python\n  theme = st_themes.Theme(\n      background_color='#FFFFFF',\n      primary_color='#1A73E8',\n      secondary_background_color='#F1F3F4',\n      text_color='#202124',\n      font='sans serif'\n  )\n  ```\n  \n## Preset Themes\n\nThe `streamlit-themes` package provides a set of preset keys that can be used to quickly apply predefined themes. \n\n### Available Preset Keys\n\n- `Beach`\n- `Pineapple`\n- `Peachy`\n- `Tropical`\n- `Mater`\n- `Gastly`\n- `Ocean`\n- `Abyssal`\n- `Green`\n- `Sandy`\n- `Sunset`\n- `Midnight`\n\n### Example Usage\n\n```python\nimport streamlit_themes as st_themes\n\n# Directly apply a preset theme\nst_themes.set_preset_theme('Beach')\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgarrett-scripps%2Fstreamlitthemes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgarrett-scripps%2Fstreamlitthemes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgarrett-scripps%2Fstreamlitthemes/lists"}