shiny-bslib-theming

Solid

Advanced theming for Shiny apps using bslib and Bootstrap 5. Use when customizing app appearance with bs_theme(), Bootswatch themes, custom colors, typography, brand.yml integration, Bootstrap Sass variables, custom Sass/CSS rules, dark mode and color modes, dynamic theme switching, real-time theming, theme inspection, or making R plots match the app theme with thematic.

Web & Frontend 396 stars 34 forks Updated today MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
87
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Theming Shiny Apps with bslib Customize Shiny app appearance using bslib's Bootstrap 5 theming system. From quick Bootswatch themes to advanced Sass customization and dynamic color mode switching. ## Quick Start **"shiny" preset (recommended starting point):** ```r page_sidebar( theme = bs_theme(), # "shiny" preset by default — polished, not plain Bootstrap ... ) ``` **Bootswatch theme (for a different visual style):** ```r page_sidebar( theme = bs_theme(preset = "zephyr"), # or "cosmo", "minty", "darkly", etc. ... ) ``` **Custom colors and fonts:** ```r page_sidebar( theme = bs_theme( version = 5, bg = "#FFFFFF", fg = "#333333", primary = "#2c3e50", base_font = font_google("Lato"), heading_font = font_google("Montserrat") ), ... ) ``` **Auto-brand from `_brand.yml`:** If a `_brand.yml` file exists in your app or project directory, `bs_theme()` automatically discovers and applies it. No code changes needed. Requires the `brand.yml` R package. ```r bs_theme(brand = FALSE) # Disable auto-discovery bs_theme(brand = TRUE) # Require _brand.yml (error if not found) bs_theme(brand = "path/to/brand.yml") # Explicit path ``` ## Theming Workflow 1. Start with the `"shiny"` preset (default) or a Bootswatch theme close to your desired look 2. Customize main colors (`bg`, `fg`, `primary`) 3. Adjust fonts with `font_google()` or other font helpers 4. Fine-tune with Bootstrap Sass variables via `...` or `bs_add_variables()` 5. Add c...

Details

Author
posit-dev
Repository
posit-dev/skills
Created
6 months ago
Last Updated
today
Language
R
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category