Shiny 0.11 switches away from the Bootstrap 2 web framework to the next version, Bootstrap 3. This is in part because Bootstrap 2 is no longer being developed, and in part because it allows us to tap into the ecosystem of Bootstrap 3 themes.
In Bootstrap 3, images in
<img> tags are no longer automatically scaled to the width of their container. If you use
img() in your UI code, or
<img> tags in your raw HTML source, it’s possible that they will be too large in the new version of Shiny. To address this you can add the
img(src = "picture.png", class = "img-responsive")
The R code above will generate the following HTML:
<img src="picture.png" class="img-responsive">
The sliders have been replaced. Previously, Shiny used the jslider library, but now it uses ion.RangeSlider. The new sliders have an updated appearance, and they have allowed us to fix many long-standing interface issues with the sliders.
sliderInput() function no longer uses the
locale options. Instead, you can use
sep options to control the prefix, postfix, and thousands separator.
updateSliderInput() can now control the min, max, value, and step size of a slider. Previously, only the value could be controlled this way, and if you wanted to change other values, you needed to use Shiny’s dynamic UI.
If in your HTML you are using custom CSS classes that are specific to Bootstrap, you may need to update them for Bootstrap 3. See the Bootstrap migration guide.
If you would like to use Shiny 0.11 with Bootstrap 2, you can use the shinybootstrap2 package. Installation and usage instructions are on available on the project page. We recommend that you do this only as a temporary solution because future development on Shiny will use Bootstrap 3.
If you want to install a specific version of Shiny other than the latest CRAN release, you can use the
install_version() function from devtools:
# Install devtools if you don't already have it: install.package("devtools") # Install the last version of Shiny prior to 0.11 devtools::install_version("shiny", "0.10.2.2")
Along with the release of Shiny 0.11, we’ve packaged up some Bootstrap 3 themes in the shinythemes package. This package makes it easy to use Bootstrap themes with Shiny.
We love it when R users help each other, but RStudio does not monitor or answer the comments in this thread. If you'd like to get specific help, we recommend the Shiny Discussion Forum for in depth discussion of Shiny related questions and How to get help for a list of the best ways to get help with R code.comments powered by Disqus