Search code examples
rshinyshinydashboard

How to change shiny dashboard footer color


enter image description here

this is my snippet of Shiny Dashboard that I made with R and what I'm trying to do is to change the footer color that I highlight with a red marker, so I want to change it to white so it can blend with the body and I don't know exactly how to do that am I need a CSS file to do that?


Solution

  • I propose to use a combination of bs4Dash https://rinterface.github.io/bs4Dash/ and CSS:

    library(shiny)
    library(bs4Dash)
    
    shinyApp(
      ui = dashboardPage(
        title = "Basic Dashboard",
        header = dashboardHeader(),
        sidebar = dashboardSidebar(),
        controlbar = dashboardControlbar(),
        footer = dashboardFooter(
          left = a(
            href = "https://twitter.com/divadnojnarg",
            target = "_blank", "@DivadNojnarg",
          ),
          right = "2020"
        ),
        body = dashboardBody(
          tags$style(
            HTML(
              ".main-footer {
                background-color: green;
                color: white;
              }
              .main-footer a {
                color: white;
              }"
            )
          )
        )
      ),
      server = function(input, output) {}
    )
    
    

    enter image description here