Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
Dynamically change Shinydashboard css style elements

I need to whitelabel a shiny dashboard build within the shinydashboard package framework. For this I need to change the following tag code in my dashboard body dynamically:

tags$head(tags$style(HTML('
        /* logo */
        .skin-blue .main-header .logo {
                              background-color: #545454;
                              }')))

js <-"Shiny.addCustomMessageHandler('change_logo', function(logo_W) {
  /* logo */
    .skin-blue .main-header .logo {
      background-color: logo_W;
    }
});"

ui <- function() {
    dashboardPage(dashboardHeader(),
                  dashboardSidebar(),
                  dashboardBody(
                      tags$head(tags$style(HTML(js))),
                  ),
                  skin = "blue")
}

server <- function(input, output, session) {
start <- reactiveVal(1)
    observeEvent(start() == 1 , {
        session$sendCustomMessage("change_logo", "#545454")
    })
}

shinyApp(ui, server)

I tried to solve the problem in a few ways. One option was to put everything in a UIoutput, but this

doesn't work with shinydashboard, the css doesn't register and it messes up the initiation process.

I tried opening the shinyapp within another app to do a call in the starting app to the server for

the colorcoding, too bad that doesn't work either.

My plan is to do it with java then and I got this code so far for one the logo part of the style

tag. It doesn't work either, but saw an example of this where someone changed the skin color with

similar code, so it should be possible.

The help is much appreciated

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!