shinyswatch0.8.0
Published
Bootswatch + Bootstrap 5 themes for Shiny.
pip install shinyswatch
Package Downloads
Authors
Project URLs
Requires Python
>=3.8
Dependencies
- typing-extensions
>=3.10.0.0
- packaging
>=20.9
- htmltools
>=0.2.0
- shiny
>=1.2.0
- black
>=23.1.0; extra == "dev"
- flake8
>=6.0.0; extra == "dev"
- isort
>=5.11.2; extra == "dev"
- pyright
>=1.1.301; extra == "dev"
- pre-commit
>=2.15.0; extra == "dev"
- wheel
; extra == "dev"
- pandas
; extra == "dev"
- Jinja2
; extra == "dev"
- matplotlib
; extra == "dev"
- libsass
; extra == "dev"
- tinycss2
; extra == "dev"
- griffe
==0.47.0; extra == "docs"
- quartodoc
==0.7.5; extra == "docs"
- shinylive
; extra == "docs"
- plum-dispatch
; extra == "docs"
- jupyter
; extra == "docs"
- pytest
>=6.2.4; extra == "test"
shinyswatch
Bootswatch + Bootstrap 5 themes for Shiny.
Here are just three of the 25 themes in shinyswatch:
Minty | Sketchy | Superhero |
---|---|---|
Installation
pip install shinyswatch
To install the latest development version from this repository:
pip install https://github.com/rstudio/py-shinyswatch/tarball/main
Usage
To use a theme, add a shinyswatch.theme
theme object to your App’s UI
definition.
# Minty theme
shinyswatch.theme.minty
# Sketchy theme
shinyswatch.theme.sketchy
# Superhero theme
shinyswatch.theme.superhero
Example Shiny application:
File: app.py
| Screenshot |
---|---|
|
Note: When writing shiny apps that use shinyswatch on shinylive.io, remember to add
shinyswatch
to yourrequirements.txt
file!
Theme picker
To add a theme picker to your app, add the theme picker UI and server functions to your app’s UI and server definitions.
Demo theme picker app on shinylive.io.
Plot Theming
shinyswatch themes include a .colors
attribute that can be used to
theme plots or other outputs and UI elements. In the example below, try
changing the theme and re-running the app to see how the plot changes.
Demo plot theming app on shinylive.io.
Development
If you want to do development on shinyswatch for Python:
pip install -e ".[dev,test,docs]"
Examples
There are multiple examples in the shinyswatch repo.
To run the demos locally, you can run the examples by calling:
python3 -m shiny run examples/basic-darkly/app.py
python3 -m shiny run examples/big-sketchy/app.py
python3 -m shiny run examples/components/app.py
python3 -m shiny run examples/theme-picker/app.py