Bootswatch + Bootstrap 5 themes for Shiny.
Project description
shinyswatch
Bootswatch + Bootstrap 5 themes for Shiny.
Installation
pip install shinyswatch
To install the latest development version from this repository:
pip install https://github.com/schloerke/py-shinyswatch/tarball/main
Usage
Add your theme within your App's top level UI defintion. For example:
# File: app.py
from shiny import App, Inputs, Outputs, Session, render, ui
import shinyswatch
app_ui = ui.page_fluid(
# Theme code - start
shinyswatch.theme.darkly(),
# Theme code - end
ui.input_slider("num", "Number:", min=10, max=100, value=30),
ui.output_text_verbatim("slider_val"),
)
def server(input: Inputs, output: Outputs, session: Session):
@output
@render.text
def slider_val():
return f"{input.num()}"
app = App(app_ui, server)
Examples
There are two examples in the shinyswatch repo. You can view them online at: shinyswatch.theme.darkly and get_theme.
To run the demos locally, you can clone the repo and run the examples by calling:
python3 -m shiny run examples/basic-darkly/app.py
# or
python3 -m shiny run examples/big-sketchy/app.py
Development
If you want to do development on shinyswatch for Python:
pip install -e ".[dev,test]"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
shinyswatch-0.2.0.tar.gz
(881.2 kB
view hashes)
Built Distribution
shinyswatch-0.2.0-py3-none-any.whl
(895.9 kB
view hashes)
Close
Hashes for shinyswatch-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ee7a087b2d5d808ae1b9fa58210ed2537ce3082390420c4863d1c92bc12d70a |
|
MD5 | 5eafcc35e8c9b45c7d2de708af28f18e |
|
BLAKE2b-256 | 70e9103150e5f785c26c4a7cf967277d6062ae7d29511b0bdd64d8545ae3f9ed |