5

I am working on shiny dashboard and want some different color on skin than colors which are available in shiny documentation (skins available in shiny)

I want ('#2666cc','rgb(38, 102, 204)') this color on skin. is it possible in shiny dashboard?

Dashboard

Want new color in highlighted area.

Gaurav Chaudhari
  • 177
  • 1
  • 2
  • 10
  • There is also a part on [including CSS](https://rstudio.github.io/shinydashboard/appearance.html#css) in the link your provide. Did you try anything yourself yet? See for example [here](https://atendesigngroup.com/blog/how-determine-which-css-styling-element) on how to find out which element you need to change. – Florian May 22 '18 at 12:02
  • @Florian No did not try anything yet. Could you please tell me , how to style css for the highlighted area in my dashboard image uploaded above? – Gaurav Chaudhari May 22 '18 at 12:07

1 Answers1

8

In the link you posted, there is a CSS section, which explains everything. But for a start this should be fine :)

library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Custom font"),
  dashboardSidebar(
    # Custom CSS to hide the default logout panel
    tags$head(tags$style(HTML('.logo {
                              background-color: #2666cc !important;
                              }
                              .navbar {
                              background-color: #2666cc !important;
                              }
                              '))),

    # The dynamically-generated user panel
    uiOutput("userpanel")
  ),
  dashboardBody()
)

server <- function(input, output, session) {
  output$userpanel <- renderUI({
    # session$user is non-NULL only in authenticated sessions
    if (!is.null(session$user)) {
      sidebarUserPanel(
        span("Logged in as ", session$user),
        subtitle = a(icon("sign-out"), "Logout", href="__logout__"))
    }
  })
}

shinyApp(ui, server)
SeGa
  • 9,454
  • 3
  • 31
  • 70
  • Could you help me in plotting stack graph for output data in given link? [Click here](https://stackoverflow.com/questions/50474999/how-to-remove-duplicate-values-in-specific-column-without-removing-related-row) – Gaurav Chaudhari May 23 '18 at 19:57