shinyswatch
raw JSON → 0.10.0 verified Mon Apr 27 auth: no python
Provides Bootswatch + Bootstrap 5 themes for Shiny for Python. Current version 0.10.0 (2026-03-20), requires Shiny >=1.6.0. Released irregularly on PyPI.
pip install shinyswatch Common errors
error TypeError: 'Theme' object is not callable ↓
cause Trying to call a shinyswatch theme object as a function in a context where it expects HTML dependencies (common after v0.5.0).
fix
Use
shinyswatch.get_theme('flatly') directly in the theme argument, or use shinyswatch.get_theme_deps('flatly') for explicit dependencies. error ImportError: cannot import name 'theme' from 'shinyswatch' ↓
cause Trying to import `shinyswatch.theme` as a module after v0.7.0, where themes are now objects from `get_theme`.
fix
Use
from shinyswatch import get_theme and then get_theme('flatly'). error ModuleNotFoundError: No module named 'shiny' ↓
cause Missing Shiny installation; shinyswatch depends on Shiny.
fix
Install Shiny:
pip install shiny error TypeError: page_fluid() got an unexpected keyword argument 'theme' ↓
cause Using an older version of Shiny that does not support the `theme` parameter in page functions (Shiny <1.0.0).
fix
Upgrade Shiny to >=1.0.0:
pip install -U shiny Warnings
breaking Since v0.7.0, shinyswatch themes must be passed as the `theme` argument to `shiny.ui.page_*()` or `shiny.express.ui.page_opts()`, not added anywhere in the UI. ↓
fix Use `theme=get_theme('cerulean')` in the page layout function.
breaking shinyswatch v0.7.0+ requires Shiny >=1.0.0; v0.10.0 requires Shiny >=1.6.0. ↓
fix Update Shiny: `pip install -U shiny`
breaking In v0.5.0, `get_theme(name)` now returns a callable class instance. To get HTML dependencies, call the object or use `get_theme_deps(name)`. ↓
fix Use `theme = get_theme('yeti')` and pass directly to page; use `get_theme_deps('yeti')` if you need dependencies.
deprecated The `default` argument in `theme_picker_ui()` is deprecated since v0.7.0. Pass initial theme via the server function instead. ↓
fix Use `theme_picker_server(input, output, session, initial='darkly')` and omit `default` from UI.
gotcha Only one theme picker is allowed per app at a time, especially when used with dynamic UI (since v0.9.0). ↓
fix Ensure only one `theme_picker_ui` is rendered in the application.
Imports
- get_theme wrong
import shinyswatch, then shinyswatch.get_theme('flatly')correctfrom shinyswatch import get_theme - theme_picker_ui
from shinyswatch import theme_picker_ui - theme_picker_server
from shinyswatch import theme_picker_server
Quickstart
from shiny import App, ui
from shinyswatch import get_theme
app_ui = ui.page_fluid(
ui.h1("Hello, shinyswatch!"),
theme=get_theme("flatly"),
)
app = App(app_ui, server=None)