Change color in shinydashboard

Viewed 4730

I have the following which changes the color of the primary status in shinydashboard to the custom blue I have stated.

tags$style(HTML(".box.box-solid.box-primary>.box-header {
                                color:#FFFFFF;
                                background-color:#005CB9;}

                                .box.box-solid.box-primary{
                                border-bottom-color:#005CB9;
                                border-left-color:#005CB9;
                                border-right-color:#005CB9;
                                border-top-color:#005CB9;
                                }")),

However I need to change the color of an infobox as this uses color = instead of the status =. Does anyone know the tags I need to change to customise one of the default colors in shinydashboard?

Thanks

2 Answers

By now library(fresh) provides a convenient way to customize the appearance of library(shinydashboard), library(shinydashboardPlus) or library(bs4Dash):

library(shiny)
library(shinydashboard)
library(fresh)

mytheme <- create_theme(
  adminlte_color(
    light_blue = "#434C5E"
  ),
  adminlte_sidebar(
    width = "400px",
    dark_bg = "#D8DEE9",
    dark_hover_bg = "#81A1C1",
    dark_color = "#2E3440"
  ),
  adminlte_global(
    content_bg = "#FFF",
    box_bg = "#D8DEE9", 
    info_box_bg = "#D8DEE9"
  )
)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    use_theme(mytheme)
  )
)

server <- function(input, output) { }

shinyApp(ui, server)

result

Also see this related article.

Related