Now on CRAN: custom theme support for R Shinydashboard applications.
An R package to provide custom theme options for Shinydashboard applications.
Straightforward use of a new set of themes and logos.
Easy creation of new themes and logos, without knowledge of CSS code.
Use of live theme switchers in apps (Guide available here).
Theme designer (Available here)
R library(devtools) install_github("nik01010/dashboardthemes")
| Function | Description | Input | Output | | ------------- |----------------------|----------------------|-------------------| | shinyDashboardThemes | Calls a custom theme created using shinyDashboardThemeDIY | Theme name | Theme settings object | | shinyDashboardLogo | Calls a custom logo created using shinyDashboardLogoDIY | Theme name and logo text | Logo settings object | | shinyDashboardThemeDIY | Creates a custom theme object | Size, colour and other settings for each UI element. See function documentation for input options | Theme settings object | | shinyDashboardLogoDIY | Creates a custom logo object. Inspired from here | Size and colour for the logo. See function documentation for input options | Logo settings object | | cssGradientThreeColors | Creates a three colour gradient to be used in themes | Gradient direction, colours, position of middle colour | CSS gradient |
Use by inserting into the title parameter within the dashboardHeader part of an application. ```R
... ### ui ui <- dashboardPage(
### ui header dashboardHeader(
title = shinyDashboardLogo( theme = "blue_gradient", boldText = "Shiny", mainText = "App", badgeText = "v1.1" ) ...
Use by inserting into the dashboardBody part of an application.
### changing theme shinyDashboardThemes( theme = "blue_gradient" ) ### ui tabs ,tabItems( tabItem( ...
Example of creating a custom logo object. Each parameter can be changed as required. ```R
### creating custom logo object customLogo <- shinyDashboardLogoDIY(
boldText = "SD" ,mainText = "Themes" ,textSize = 16 ,badgeText = "v1.1" ,badgeTextColor = "white" ,badgeTextSize = 2 ,badgeBackColor = "#40E0D0" ,badgeBorderRadius = 3
### calling custom logo object in shinydashboard ... ### ui ui <- dashboardPage(
### ui header dashboardHeader(
### changing logo title = customLogo ...
Creating new themes
Example of creating a custom theme object. Each parameter can be changed as required.
creating custom theme object
| Theme | Code | Description | | ------------------ |------------|-----------------------------------------------| | Blue gradient | bluegradient | Demonstrates use of gradients, shadows and rounded corners | | Flat Red | flatred | Flat colour theme with red highlights. | | Grey light | greylight | Simple, light theme using a grey colour schemes | | Grey dark | greydark | Demonstrates use of inverted dark colour schemes | | OneNote | onenote | Styled similarly to the OneNote application | | Poor man's Flatly | poormansflatly | Poor man's version of the Flatly theme | Purple gradient | purple_gradient | Demonstrates high use of gradients and a smaller sidebar |
Poor man's Flatly
Some application components have not been fully customised:
Action button when pressed
Dropdown menu background
Popup menu and placeholder font colour in date inputs
Checkbox and radio buttons
This is not part of the official Shinydashboard package and is released as a separate set of functionality. Efforts will be made to ensure compatibility with future versions of Shinydashboard but there could be delays in doing so.