Theme a shiny app
SISBID 2025
https://github.com/dicook/SISBID
Theming your Shiny App
bslib
has many options available for theming and customizing your app- We’ll cover the easily available options here
- Exponentially more powerful with CSS and a bit of tinkering
Preset Themes
- Bootswatch provides preset themes
bs_themer()
lets you choose interactively
Try it out in code/3.4-theme/bs_themer.R
Your Turn
- Run the code in
code/3.4-theme/bs_themer.R
- Pick a theme you like.
- Get the console output corresponding to that theme
- modify
bs_themed.R
to use your theme code
Hint: Use the theme = ...
argument in one of the page_xxx
functions.
Adding Icons
- You can add icons to your
nav_panels()
with theicon
argument- Bootstrap Icons
- Match the version of Bootstrap your app uses
Your Turn
Customize the title and icons on the nav_panels
in title_customization.R
.
Choose appropriate icons and decide if they are decorative or semantic.
Resources
- Theming Shiny documentation
- Shiny Apps with bslib
- Unified Theming with brand.yml
- Professional Interface Development
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.