Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually adjusting header height corrupts resposiveness #363

Open
pablo-rodr-bio2 opened this issue May 13, 2021 · 0 comments
Open

Manually adjusting header height corrupts resposiveness #363

pablo-rodr-bio2 opened this issue May 13, 2021 · 0 comments

Comments

@pablo-rodr-bio2
Copy link

pablo-rodr-bio2 commented May 13, 2021

(This is in fact a feature request: add an "height" attribute to dashboardHeader())

I used this solution in order to adjust height of a dashboardHeader() in shinydashboard.
My problem comes when I try to see different viewports.
In a normal monitor display, the new header height doesn't cover neither the sidebar nor the body of the page.
But using a mobile viewport, both are covered.

This is the code I'm using:

    library(shiny) 
library(shinydashboard)
    

    ui <- dashboardPage(
   dashboardHeader(
        # Set height of dashboardHeader
        tags$li(class = "dropdown",
                tags$style(".main-header {max-height: 200px}"),
                tags$style(".main-header .logo {height: 200px;}"),
                tags$style(".sidebar-toggle {height: 200px; padding-top: 1px !important;}"),
                tags$style(".navbar {min-height:200px !important}")
        )    ),   
dashboardSidebar(
        # Adjust the sidebar
        tags$style(".left-side, .main-sidebar {padding-top: 200px}"),
        selectInput(inputId="1", label = "Label1", choices = "variable", "Variable:"),
        selectInput(inputId="2", label = "Label2", choices = "variable", "Variable:")   ),   
dashboardBody(
        fluidRow(
          tabBox(width =12, 
                 tabPanel("Tab1", "First tab content"),
                 tabPanel("Tab2", "Tab content 2"))
        )   ) )
    
    server <- function(input, output){}
    
    shinyApp(ui, server)

This is a monitor display:

enter image description here

And this would be in a mobile viewport:

enter image description here

As you can see, both top of sidebar and body are hidden behind the new header height

Is there any way we can adjust the header's height without breaking the app responsiveness?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant