Bootswatch + Bootstrap 5 themes for Shiny.
Project description
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, call the theme function and add it 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 |
---|---|
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)
|
Development
If you want to do development on shinyswatch for Python:
pip install -e ".[dev,test]"
Examples
There are three 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
# or
python3 -m shiny run examples/big-sketchy/app.py
# or
python3 -m shiny run examples/components/app.py
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.2.tar.gz
(881.7 kB
view hashes)
Built Distribution
shinyswatch-0.2.2-py3-none-any.whl
(896.2 kB
view hashes)
Close
Hashes for shinyswatch-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cf552088a9186011541f0a2cc12dc35b0754bc00ee7f713ecdb30713e6c25be |
|
MD5 | 6b941a84867b542ef91a5e39129b6034 |
|
BLAKE2b-256 | 5a80a4c2627b0c3fca9affb9755640f991a6fedb09bae4da074e7b45a80737f7 |