Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

155
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda