Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rstudio/shinythemes
Themes for Shiny
https://github.com/rstudio/shinythemes
Last synced: 3 months ago
JSON representation
Themes for Shiny
- Host: GitHub
- URL: https://github.com/rstudio/shinythemes
- Owner: rstudio
- License: other
- Created: 2014-12-05T19:00:43.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2022-02-25T15:37:49.000Z (over 2 years ago)
- Last Synced: 2024-06-18T12:29:10.914Z (5 months ago)
- Language: R
- Homepage: http://rstudio.github.io/shinythemes/
- Size: 3.21 MB
- Stars: 150
- Watchers: 50
- Forks: 78
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - shinythemes - Themes for Shiny (R)
- awesome-shiny-extensions - shinythemes - Bootswatch themes (Bootstrap 3) for Shiny. (Theming / Generic Theming)
- jimsghstars - rstudio/shinythemes - Themes for Shiny (R)
README
shinythemes
===========> NOTE: This package has been superseded by the [`{bslib}` package](https://rstudio.github.io/bslib/), which provides Bootswatch (and as well as custom) themes for both Bootstrap 3 and 4.
See the documentation at https://rstudio.github.io/shinythemes/.
The shinythemes package provides some Bootstrap themes for use with Shiny. The themes are from from https://bootswatch.com/:
* [cerulean](https://bootswatch.com/3/cerulean/)
* [cosmo](https://bootswatch.com/3/cosmo/)
* [cyborg](https://bootswatch.com/3/cyborg/)
* [darkly](https://bootswatch.com/3/darkly/)
* [flatly](https://bootswatch.com/3/flatly/)
* [journal](https://bootswatch.com/3/journal/)
* [lumen](https://bootswatch.com/3/lumen/)
* [paper](https://bootswatch.com/3/paper/)
* [readable](https://bootswatch.com/3/readable/)
* [sandstone](https://bootswatch.com/3/sandstone/)
* [simplex](https://bootswatch.com/3/simplex/)
* [slate](https://bootswatch.com/3/slate/)
* [spacelab](https://bootswatch.com/3/spacelab/)
* [superhero](https://bootswatch.com/3/superhero/)
* [united](https://bootswatch.com/3/united/)
* [yeti](https://bootswatch.com/3/yeti/)## Using themes
Using the themes is simple. Use the `theme` argument to `bootstrapPage`, `fluidPage`, `navbarPage`, or `fixedPage`. The value should be `shinytheme("")`; for example, `shinytheme("cerulean")`.
For example, a single-file app might look like this:
```R
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](https://gallery.shinyapps.io/117-shinythemes/).
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:
```R
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()`.