shinythemes v1.1.2

0

Monthly downloads

0th

Percentile

Themes for Shiny

Themes for use with Shiny. Includes several Bootstrap themes from <http://bootswatch.com/>, which are packaged for use with Shiny applications.

Readme

shinythemes

See the documentation at http://rstudio.github.io/shinythemes/.

The shinythemes package provides some Bootstrap themes for use with Shiny. The themes are from from http://bootswatch.com/:

Using themes

Using the themes is simple. Use the theme argument to bootstrapPage, fluidPage, navbarPage, or fixedPage. The value should be shinytheme("<theme>"); for example, shinytheme("cerulean").

For example, a single-file app might look like this:

shinyApp(
  ui = navbarPage("United",
    theme = shinythemes::shinytheme("united"),  # <--- Specify theme here
    tabPanel("Plot", "Plot tab contents..."),
    navbarMenu("More",
      tabPanel("Summary", "Summary tab contents..."),
      tabPanel("Table", "Table tab contents...")
    )
  ),
  server = function(input, output) { }
)

Live theme selector

If you want to quickly test out different themes with an application, you can simply add themeSelector() somewhere to the UI. This will add a select box which lets you choose the theme. It will change the theme without having to reload or restart your app. You can see the theme selector in action here.

The theme selector is only meant to be used while developing an application. Once you've decided on which theme to use, pass it to the theme argument as described earlier.

Here's an example app with the theme selector:

shinyApp(
  ui = fluidPage(
    shinythemes::themeSelector(),  # <--- Add this somewhere in the UI
    sidebarPanel(
      textInput("txt", "Text input:", "text here"),
      sliderInput("slider", "Slider input:", 1, 100, 30),
      actionButton("action", "Button"),
      actionButton("action2", "Button2", class = "btn-primary")
    ),
    mainPanel(
      tabsetPanel(
        tabPanel("Tab 1"),
        tabPanel("Tab 2")
      )
    )
  ),
  server = function(input, output) {}
)

Once you've found a theme that you like, use it in the page as shown above, with theme = shinythemes::shinytheme(<theme here>).

Functions in shinythemes

Name Description
shinytheme Return the URL for a Shiny theme
shinythemes Themes for Shiny
themeSelector Add a theme selector widget in a floating panel
No Results!

Last month downloads

Details

URL http://rstudio.github.io/shinythemes/
License GPL-3 | file LICENSE
RoxygenNote 6.1.0.9000
NeedsCompilation no
Packaged 2018-11-06 16:28:32 UTC; winston
Repository CRAN
Date/Publication 2018-11-06 17:00:03 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/shinythemes)](http://www.rdocumentation.org/packages/shinythemes)