{"id":22362,"library":"shinyswatch","title":"shinyswatch","description":"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.","status":"active","version":"0.10.0","language":"python","source_language":"en","source_url":"https://github.com/rstudio/py-shinyswatch","tags":["shiny","bootswatch","bootstrap","themes"],"install":[{"cmd":"pip install shinyswatch","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Core dependency: shinyswatch requires Shiny >=1.6.0 (v0.10.0).","package":"shiny","optional":false}],"imports":[{"note":"Direct import works; the old way also works but is less explicit.","wrong":"import shinyswatch, then shinyswatch.get_theme('flatly')","symbol":"get_theme","correct":"from shinyswatch import get_theme"},{"note":"","wrong":"","symbol":"theme_picker_ui","correct":"from shinyswatch import theme_picker_ui"},{"note":"","wrong":"","symbol":"theme_picker_server","correct":"from shinyswatch import theme_picker_server"}],"quickstart":{"code":"from shiny import App, ui\nfrom shinyswatch import get_theme\n\napp_ui = ui.page_fluid(\n    ui.h1(\"Hello, shinyswatch!\"),\n    theme=get_theme(\"flatly\"),\n)\n\napp = App(app_ui, server=None)\n","lang":"python","description":"Minimal Shiny app using a shinyswatch theme (pass theme to page_* functions)."},"warnings":[{"fix":"Use `theme=get_theme('cerulean')` in the page layout function.","message":"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.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Update Shiny: `pip install -U shiny`","message":"shinyswatch v0.7.0+ requires Shiny >=1.0.0; v0.10.0 requires Shiny >=1.6.0.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Use `theme = get_theme('yeti')` and pass directly to page; use `get_theme_deps('yeti')` if you need dependencies.","message":"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)`.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Use `theme_picker_server(input, output, session, initial='darkly')` and omit `default` from UI.","message":"The `default` argument in `theme_picker_ui()` is deprecated since v0.7.0. Pass initial theme via the server function instead.","severity":"deprecated","affected_versions":">=0.7.0"},{"fix":"Ensure only one `theme_picker_ui` is rendered in the application.","message":"Only one theme picker is allowed per app at a time, especially when used with dynamic UI (since v0.9.0).","severity":"gotcha","affected_versions":">=0.9.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `shinyswatch.get_theme('flatly')` directly in the `theme` argument, or use `shinyswatch.get_theme_deps('flatly')` for explicit dependencies.","cause":"Trying to call a shinyswatch theme object as a function in a context where it expects HTML dependencies (common after v0.5.0).","error":"TypeError: 'Theme' object is not callable"},{"fix":"Use `from shinyswatch import get_theme` and then `get_theme('flatly')`.","cause":"Trying to import `shinyswatch.theme` as a module after v0.7.0, where themes are now objects from `get_theme`.","error":"ImportError: cannot import name 'theme' from 'shinyswatch'"},{"fix":"Install Shiny: `pip install shiny`","cause":"Missing Shiny installation; shinyswatch depends on Shiny.","error":"ModuleNotFoundError: No module named 'shiny'"},{"fix":"Upgrade Shiny to >=1.0.0: `pip install -U shiny`","cause":"Using an older version of Shiny that does not support the `theme` parameter in page functions (Shiny <1.0.0).","error":"TypeError: page_fluid() got an unexpected keyword argument 'theme'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}