RinteRface / shinydashboardPlus

extensions for shinydashboard
https://shinydashboardplus.rinterface.com
Other
454 stars 77 forks source link

question: "fixed" navbar is overlapping body-content #59

Closed Diniodoc closed 4 years ago

Diniodoc commented 4 years ago

Hi all,

I have the problem, that a “fixed-top” navbar is overlapping the top of the body content. Is there a way to fix that behaviour?

Example:

if (interactive()) {
  library(shiny)
  library(shinydashboard)
  library(shinydashboardPlus)
  shinyApp(
    ui = dashboardPagePlus(
      header = dashboardHeaderPlus(
        fixed = TRUE
      ),
      sidebar = dashboardSidebar(),
      body = dashboardBody(
        box(title="Title", status = "primary", h4("Box-Content"), width = 12),
        box(title="Title", status = "primary", h4("Box-Content"), width = 12)
      ),
      title = "DashboardPage"
    ),
    server = function(input, output) { }
  )
}

image

used packages:

Package Version
shiny 1.4.0.9000
shinydashboard 0.7.1
shinydashboardPlus 0.7.5.9000

Thank you Diniodoc

Diniodoc commented 4 years ago

Okay that behaviour seems to be a common bootstrap problem and it is not really caused by shinydashboardPlus.

A first and dirty solution is to add padding-top 65px to content.

tags$style(HTML(".content {padding-top: 65px;}"))

Fore sure that is no responsive design. On small devices, the navbar can wrap into several lines and the 65px do not suffice anymore.

Because it is not a bug i'll close the issue.

Greets Diniodoc