4

I am trying to change the theme of my R Shiny application to "Minty" from the bootswatch theme website: https://bootswatch.com/. However, when I use the shinythemes argument in my code, the theme is not adjusted when I run the application. Any help appreciated.

Update: I was able to get the theme working using the suggestions below, but it doesn't really look similar in terms of color and the navigation bar.

enter image description here

AyeTown
  • 717
  • 4
  • 16
  • Can you include a [reproducible set of code](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)? Otherwise we don't know what you're looking at or how you've tried to set a theme – camille Sep 13 '19 at 20:10

1 Answers1

3

Minty isn't included in shinythemes so something like fluidPage(theme = shinytheme("minty"), ...) won't work. You can add a theme to your app manually by:

1) Downloading the .css file from bootswatch

2) Placing that .css file in the www/ directory associated with your app as follows:

myapp

|-- server.R

|-- ui.R

|-- www/ > mytheme.css

3) Modifying your ui code to include this:

fluidPage(
  theme = "mytheme.css",
  ...)

Adapted from here (scroll down)

Greg
  • 3,398
  • 5
  • 15
  • 29
  • Cheers m8... gonna try it out now. – AyeTown Sep 14 '19 at 23:54
  • So I took the steps above, however, it doesn't really look like the theme. I'll add the image to my post above for you to view. – AyeTown Sep 15 '19 at 00:05
  • Hmm, I think the issue might be that Minty is built for Bootstrap 4.3.1 whereas Shiny uses Bootstrap 3.3.1. I tried using both Bootstrap versions of Cerulean and got different results. There isn't a 3.3.1 version of Minty. – Greg Sep 15 '19 at 02:12
  • Noooooooooo! Thanks anyways, haha – AyeTown Sep 15 '19 at 16:07