symbolrush
symbolrush

Reputation: 7457

Custom colors in r shinydashboard package

I'm wondering if there exists some tricks out there to customize the colors available through the shinydashboard package?


As the documentation suggests, there are only a small number of colors available. Still I'm wondering (and hoping) that there are some tricks to customize that palette, preferably using RGB colors (like #123456).

Is there such a magic trick out there? Or is there another package similar to shinydashboard, that allows customizing colors?

Upvotes: 1

Views: 549

Answers (1)

ismirsehregal
ismirsehregal

Reputation: 33417

library(fresh) allows this degree of customization (the convenient way) regarding library(shinydashboard) or library(shinydashboardPlus):

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)

Also see this related article.

Upvotes: 3

Related Questions