Adjust height of the whole header bar in dashboardHeader in shiny dashboard

后端 未结 1 1383
面向向阳花
面向向阳花 2021-01-03 09:42

I have seen that there is a similar question here :

Adjust height of dashboardheader in shinydashboard

but I don\'t have the reputation to comment on the gi

相关标签:
1条回答
  • 2021-01-03 10:08

    You need to override the min-height of the navbar and padding on the sidebar-toggle. I have updated your example below:

    library(shiny)
    library(shinydashboard)
    
    ui <- dashboardPage(
      dashboardHeader(
        # Set height of dashboardHeader
        tags$li(class = "dropdown",
                tags$style(".main-header {max-height: 20px}"),
                tags$style(".main-header .logo {height: 20px;}"),
                tags$style(".sidebar-toggle {height: 20px; padding-top: 1px !important;}"),
                tags$style(".navbar {min-height:20px !important}")
        ) 
      ),
       dashboardSidebar(
        # Adjust the sidebar
        tags$style(".left-side, .main-sidebar {padding-top: 20px}")
      ),
      dashboardBody()
    )
    
    server <- function(input, output){}
    
    shinyApp(ui, server)
    
    0 讨论(0)
提交回复
热议问题